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
feat(tools/podcast_generator): add support for setting openai base url with the podcast_generationor tool (#10517)
Xiao Ley451ccb778d8a
diff --git a/api/core/tools/provider/builtin/podcast_generator/podcast_generator.yaml b/api/core/tools/provider/builtin/podcast_generator/podcast_generator.yamlindex bd02b32020a..d4edb17b286 100644--- a/api/core/tools/provider/builtin/podcast_generator/podcast_generator.yaml+++ b/api/core/tools/provider/builtin/podcast_generator/podcast_generator.yaml@@ -32,3 +32,15 @@ credentials_for_provider:placeholder:en_US: Enter your TTS service API keyzh_Hans: 输入您的 TTS 服务 API 密钥+ openai_base_url:+ type: text-input+ required: false+ label:+ en_US: OpenAI base URL+ zh_Hans: OpenAI base URL+ help:+ en_US: Please input your OpenAI base URL+ zh_Hans: 请输入你的 OpenAI base URL+ placeholder:+ en_US: Please input your OpenAI base URL+ zh_Hans: 请输入你的 OpenAI base URLdiff --git a/api/core/tools/provider/builtin/podcast_generator/tools/podcast_audio_generator.py b/api/core/tools/provider/builtin/podcast_generator/tools/podcast_audio_generator.pyindex 476e2d01e1d..165e93956ef 100644--- a/api/core/tools/provider/builtin/podcast_generator/tools/podcast_audio_generator.py+++ b/api/core/tools/provider/builtin/podcast_generator/tools/podcast_audio_generator.py@@ -5,6 +5,7 @@ import warningsfrom typing import Any, Literal, Optional, Unionimport openai+from yarl import URLfrom core.tools.entities.tool_entities import ToolInvokeMessagefrom core.tools.errors import ToolParameterValidationError, ToolProviderCredentialValidationError@@ -53,15 +54,24 @@ class PodcastAudioGeneratorTool(BuiltinTool):if not host1_voice or not host2_voice:raise ToolParameterValidationError("Host voices are required")- # Get OpenAI API key from credentials+ # Ensure runtime and credentialsif not self.runtime or not self.runtime.credentials:raise ToolProviderCredentialValidationError("Tool runtime or credentials are missing")++ # Get OpenAI API key from credentialsapi_key = self.runtime.credentials.get("api_key")if not api_key:raise ToolProviderCredentialValidationError("OpenAI API key is missing")+ # Get OpenAI base URL+ openai_base_url = self.runtime.credentials.get("openai_base_url", None)+ openai_base_url = str(URL(openai_base_url) / "v1") if openai_base_url else None+# Initialize OpenAI client- client = openai.OpenAI(api_key=api_key)+ client = openai.OpenAI(+ api_key=api_key,+ base_url=openai_base_url,+ )# Create a thread poolmax_workers = 5