Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix bug when adding openai or openai-compatible stt model instance (#9006)
zg0d233fcfa1252a052
diff --git a/api/core/agent/output_parser/cot_output_parser.py b/api/core/agent/output_parser/cot_output_parser.pyindex d04e38777a5..99876b2f5eb 100644--- a/api/core/agent/output_parser/cot_output_parser.py+++ b/api/core/agent/output_parser/cot_output_parser.py@@ -14,7 +14,7 @@ class CotAgentOutputParser:) -> Generator[Union[str, AgentScratchpadUnit.Action], None, None]:def parse_action(json_str):try:- action = json.loads(json_str)+ action = json.loads(json_str, strict=False)action_name = Noneaction_input = Nonediff --git a/api/core/model_runtime/model_providers/openai/speech2text/speech2text.py b/api/core/model_runtime/model_providers/openai/speech2text/speech2text.pyindex 18f97e45f33..0d54d2ea9a9 100644--- a/api/core/model_runtime/model_providers/openai/speech2text/speech2text.py+++ b/api/core/model_runtime/model_providers/openai/speech2text/speech2text.py@@ -2,6 +2,8 @@ from typing import IO, Optionalfrom openai import OpenAI+from core.model_runtime.entities.common_entities import I18nObject+from core.model_runtime.entities.model_entities import AIModelEntity, FetchFrom, ModelTypefrom core.model_runtime.errors.validate import CredentialsValidateFailedErrorfrom core.model_runtime.model_providers.__base.speech2text_model import Speech2TextModelfrom core.model_runtime.model_providers.openai._common import _CommonOpenAI@@ -58,3 +60,18 @@ class OpenAISpeech2TextModel(_CommonOpenAI, Speech2TextModel):response = client.audio.transcriptions.create(model=model, file=file)return response.text++ def get_customizable_model_schema(self, model: str, credentials: dict) -> AIModelEntity | None:+ """+ used to define customizable model schema+ """+ entity = AIModelEntity(+ model=model,+ label=I18nObject(en_US=model),+ fetch_from=FetchFrom.CUSTOMIZABLE_MODEL,+ model_type=ModelType.SPEECH2TEXT,+ model_properties={},+ parameter_rules=[],+ )++ return entitydiff --git a/api/core/model_runtime/model_providers/openai_api_compatible/speech2text/speech2text.py b/api/core/model_runtime/model_providers/openai_api_compatible/speech2text/speech2text.pyindex 405096578cd..cef77cc9419 100644--- a/api/core/model_runtime/model_providers/openai_api_compatible/speech2text/speech2text.py+++ b/api/core/model_runtime/model_providers/openai_api_compatible/speech2text/speech2text.py@@ -3,6 +3,8 @@ from urllib.parse import urljoinimport requests+from core.model_runtime.entities.common_entities import I18nObject+from core.model_runtime.entities.model_entities import AIModelEntity, FetchFrom, ModelTypefrom core.model_runtime.errors.invoke import InvokeBadRequestErrorfrom core.model_runtime.errors.validate import CredentialsValidateFailedErrorfrom core.model_runtime.model_providers.__base.speech2text_model import Speech2TextModel@@ -59,3 +61,18 @@ class OAICompatSpeech2TextModel(_CommonOaiApiCompat, Speech2TextModel):self._invoke(model, credentials, audio_file)except Exception as ex:raise CredentialsValidateFailedError(str(ex))++ def get_customizable_model_schema(self, model: str, credentials: dict) -> AIModelEntity | None:+ """+ used to define customizable model schema+ """+ entity = AIModelEntity(+ model=model,+ label=I18nObject(en_US=model),+ fetch_from=FetchFrom.CUSTOMIZABLE_MODEL,+ model_type=ModelType.SPEECH2TEXT,+ model_properties={},+ parameter_rules=[],+ )++ return entitydiff --git a/api/core/tools/tool/workflow_tool.py b/api/core/tools/tool/workflow_tool.pyindex ad0c7fc631f..a885b8784f2 100644--- a/api/core/tools/tool/workflow_tool.py+++ b/api/core/tools/tool/workflow_tool.py@@ -68,10 +68,13 @@ class WorkflowTool(Tool):result = []- outputs = data.get("outputs", {})- outputs, files = self._extract_files(outputs)- for file in files:- result.append(self.create_file_var_message(file))+ outputs = data.get("outputs")+ if outputs == None:+ outputs = {}+ else:+ outputs, files = self._extract_files(outputs)+ for file in files:+ result.append(self.create_file_var_message(file))result.append(self.create_text_message(json.dumps(outputs, ensure_ascii=False)))result.append(self.create_json_message(outputs))