feat: add template of FastGPT

This commit is contained in:
Soulter
2025-02-22 15:43:14 +08:00
parent 0a2abd8214
commit 2807e1e892
3 changed files with 20 additions and 3 deletions
+15
View File
@@ -540,6 +540,14 @@ CONFIG_METADATA_2 = {
"variables": {},
"timeout": 60,
},
"fastgpt": {
"id": "fastgpt",
"type": "openai_chat_completion",
"enable": True,
"key": [],
"api_base": "https://api.fastgpt.in/api/v1",
"timeout": 60,
},
"whisper(API)": {
"id": "whisper",
"type": "openai_whisper_api",
@@ -582,6 +590,13 @@ CONFIG_METADATA_2 = {
"obvious_hint": True,
"hint": "可选。工作流固定输入变量,将会作为工作流的输入。也可以在对话时使用 /set 指令动态设置变量。如果变量名冲突,优先使用动态设置的变量。",
},
# "fastgpt_app_type": {
# "description": "应用类型",
# "type": "string",
# "hint": "FastGPT 应用的应用类型。",
# "options": ["agent", "workflow", "plugin"],
# "obvious_hint": True,
# },
"dashscope_app_type": {
"description": "应用类型",
"type": "string",
@@ -125,4 +125,4 @@ class ProviderDashscope(ProviderOpenAIOfficial):
raise Exception("暂不支持获得 阿里云百炼 的历史消息记录。")
async def terminate(self):
await self.api_client.close()
pass
@@ -48,8 +48,10 @@ class ProviderOpenAIOfficial(Provider):
base_url=provider_config.get("api_base", None),
timeout=self.timeout
)
self.set_model(provider_config['model_config']['model'])
model_config = provider_config.get("model_config", {})
model = model_config.get("model", "unknown")
self.set_model(model)
async def get_models(self):
try: