Skip to content

Commit e3e6691

Browse files
bugfix: model
1 parent f909e72 commit e3e6691

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

backend/agent_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def create_agent(**kwargs) -> Agent:
8484
model_from_config = (config or {}).get("model_select")
8585
model_from_kwargs = kwargs.pop("model", None)
8686

87-
model_name = model_from_config or model_from_kwargs or "gemini-2.5-flash"
87+
model_name = model_from_kwargs or model_from_config or "gemini-2.5-flash"
8888
model = OpenAIChatCompletionsModel(model_name, openai_client=client)
8989

9090
# Safety: ensure no stray 'model' remains in kwargs to avoid duplicate kwarg errors

backend/service/mcp_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
FilePath: /comfyui_copilot/backend/service/mcp-client.py
77
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
88
'''
9-
from ..utils.globals import BACKEND_BASE_URL
9+
from ..utils.globals import BACKEND_BASE_URL, get_comfyui_copilot_api_key
1010
from .. import core
1111
import asyncio
1212
import os
@@ -76,6 +76,7 @@ async def comfyui_agent_invoke(messages: List[Dict[str, Any]], images: List[Imag
7676
params= {
7777
"url": BACKEND_BASE_URL + "/mcp-server/mcp",
7878
"timeout": 300.0,
79+
"headers": {"X-Session-Id": session_id, "Authorization": f"Bearer {get_comfyui_copilot_api_key()}"}
7980
},
8081
cache_tools_list=True,
8182
client_session_timeout_seconds=300.0

0 commit comments

Comments
 (0)