Add Dify integration and enhance workflow node specifications
- Introduce new fields `dify_api_url` and `dify_api_key` in `AssistantConfig` for Dify API integration. - Update `requirements.txt` to include `dify-client-python` for Dify SDK support. - Modify `config_resolver` to handle Dify connection information. - Add a new `globalNode` type in workflow specifications to provide unified settings across workflows. - Enhance node specifications with additional constraints and default values for better configuration management. - Update frontend components to support the new `globalNode` type and its properties, improving workflow editor functionality.
This commit is contained in:
@@ -15,7 +15,7 @@ from models import AssistantConfig
|
||||
from pipecat.processors.aggregators.llm_context import LLMContext
|
||||
from pipecat.processors.frame_processor import FrameProcessor
|
||||
|
||||
from services.brains.base import BrainSpec
|
||||
from services.brains.base import BaseBrain, BrainSpec
|
||||
from services.brains.fastgpt_llm import FastGPTLLMService, normalize_base_url
|
||||
|
||||
|
||||
@@ -38,15 +38,16 @@ def _extract_welcome(payload: Any) -> str:
|
||||
return ""
|
||||
|
||||
|
||||
class FastGPTBrain:
|
||||
class FastGPTBrain(BaseBrain):
|
||||
def __init__(self):
|
||||
self.spec = BrainSpec(
|
||||
type="fastgpt",
|
||||
supported_runtime_modes=frozenset({"pipeline"}),
|
||||
owns_context=False,
|
||||
)
|
||||
self._chat_id = uuid4().hex
|
||||
|
||||
spec = BrainSpec(
|
||||
type="fastgpt",
|
||||
supported_runtime_modes=frozenset({"pipeline"}),
|
||||
owns_context=False,
|
||||
)
|
||||
|
||||
async def greeting(self, cfg: AssistantConfig) -> str:
|
||||
"""优先用 FastGPT 后台配置的开场白;无 app_id 或取不到时回退 cfg.greeting。"""
|
||||
if not cfg.fastgpt_app_id:
|
||||
|
||||
Reference in New Issue
Block a user