mirror of
https://github.com/langgenius/dify.git
synced 2026-09-24 23:22:26 +08:00
refactor(api): migrate snippet workspace endpoints to BaseModel (#37956)
Co-authored-by: Asuka Minato <i@asukaminato.eu.org>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import json
|
||||
import logging
|
||||
from collections.abc import Iterator, Mapping, Sequence
|
||||
from collections.abc import Generator, Mapping, Sequence
|
||||
from contextlib import contextmanager
|
||||
from datetime import UTC, datetime
|
||||
from typing import Any
|
||||
@@ -68,7 +68,7 @@ class SnippetService:
|
||||
self._workflow_run_repo = DifyAPIRepositoryFactory.create_api_workflow_run_repository(session_maker)
|
||||
|
||||
@contextmanager
|
||||
def _session_scope(self) -> Iterator[Session]:
|
||||
def _session_scope(self) -> Generator[Session, None, None]:
|
||||
current_session = getattr(self, "_session", None)
|
||||
if current_session is not None:
|
||||
yield current_session
|
||||
@@ -625,8 +625,6 @@ class SnippetService:
|
||||
conversation_variables=[],
|
||||
rag_pipeline_variables=draft_workflow.rag_pipeline_variables,
|
||||
kind=WorkflowKind.SNIPPET.value,
|
||||
marked_name="",
|
||||
marked_comment="",
|
||||
)
|
||||
session.add(workflow)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user