20260510
This commit is contained in:
parent
8168059655
commit
3a8b7d7948
|
|
@ -16,14 +16,6 @@ class BaseAgent:
|
||||||
通用智能体基类
|
通用智能体基类
|
||||||
"""
|
"""
|
||||||
|
|
||||||
model = OpenAIChatModel(
|
|
||||||
model_name="deepseek-v4-flash",
|
|
||||||
provider=OpenAIProvider(
|
|
||||||
base_url="https://tokenhub.tencentmaas.com/v1",
|
|
||||||
api_key="sk-D9Y1mCe8VlvNqLuSC4mAjqEwxJ2nW4C0h8a7EPn8kg9RLsHq",
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
def __init__(self, system_prompt: str, output_type: Any, tools: List = []):
|
def __init__(self, system_prompt: str, output_type: Any, tools: List = []):
|
||||||
"""
|
"""
|
||||||
初始化智能体
|
初始化智能体
|
||||||
|
|
@ -43,7 +35,13 @@ class BaseAgent:
|
||||||
实例化智能体
|
实例化智能体
|
||||||
"""
|
"""
|
||||||
agent = Agent(
|
agent = Agent(
|
||||||
model=self.model,
|
model=OpenAIChatModel(
|
||||||
|
model_name="deepseek-v4-flash",
|
||||||
|
provider=OpenAIProvider(
|
||||||
|
base_url="https://tokenhub.tencentmaas.com/v1",
|
||||||
|
api_key="sk-D9Y1mCe8VlvNqLuSC4mAjqEwxJ2nW4C0h8a7EPn8kg9RLsHq",
|
||||||
|
),
|
||||||
|
),
|
||||||
system_prompt=system_prompt,
|
system_prompt=system_prompt,
|
||||||
output_type=output_type,
|
output_type=output_type,
|
||||||
)
|
)
|
||||||
|
|
@ -59,4 +57,3 @@ class BaseAgent:
|
||||||
:return: 智能体回复
|
:return: 智能体回复
|
||||||
"""
|
"""
|
||||||
return await self.agent.run(user_prompt=user_prompt, **kwargs)
|
return await self.agent.run(user_prompt=user_prompt, **kwargs)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue