mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-21 04:54:21 +00:00
fix: llm model wrongly required when runner is not local-agent (#1386)
This commit is contained in:
committed by
GitHub
parent
f2e1ae432c
commit
13d36412dd
@@ -99,7 +99,7 @@ class ModelManager:
|
||||
for model in self.model_list:
|
||||
if model.name == name:
|
||||
return model
|
||||
raise ValueError(f'无法确定模型 {name} 的信息,请在元数据中配置')
|
||||
raise ValueError(f'无法确定模型 {name} 的信息')
|
||||
|
||||
async def get_model_by_uuid(self, uuid: str) -> entities.LLMModelInfo:
|
||||
"""通过uuid获取模型"""
|
||||
|
||||
@@ -4,6 +4,7 @@ import asyncio
|
||||
|
||||
from ...core import app, entities as core_entities
|
||||
from ...provider import entities as provider_entities
|
||||
from ...provider.modelmgr import entities as model_entities
|
||||
|
||||
|
||||
class SessionManager:
|
||||
@@ -41,6 +42,7 @@ class SessionManager:
|
||||
query: core_entities.Query,
|
||||
session: core_entities.Session,
|
||||
prompt_config: list[dict],
|
||||
llm_model: model_entities.LLMModelInfo,
|
||||
) -> core_entities.Conversation:
|
||||
"""获取对话或创建对话"""
|
||||
|
||||
@@ -62,9 +64,7 @@ class SessionManager:
|
||||
conversation = core_entities.Conversation(
|
||||
prompt=prompt,
|
||||
messages=[],
|
||||
use_llm_model=await self.ap.model_mgr.get_model_by_uuid(
|
||||
query.pipeline_config['ai']['local-agent']['model']
|
||||
),
|
||||
use_llm_model=llm_model,
|
||||
use_funcs=await self.ap.tool_mgr.get_all_functions(
|
||||
plugin_enabled=True,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user