|
@@ -2,11 +2,10 @@ import json
|
|
|
from typing import List, Optional
|
|
|
|
|
|
from pqai_agent.agent import DEFAULT_MAX_RUN_STEPS
|
|
|
-from pqai_agent.chat_service import OpenAICompatible, VOLCENGINE_MODEL_DEEPSEEK_V3
|
|
|
+from pqai_agent.chat_service import OpenAICompatible
|
|
|
from pqai_agent.logging_service import logger
|
|
|
from pqai_agent.toolkit.function_tool import FunctionTool
|
|
|
-from pqai_agent.toolkit.image_describer import ImageDescriber
|
|
|
-from pqai_agent.toolkit.message_notifier import MessageNotifier
|
|
|
+
|
|
|
|
|
|
|
|
|
class SimpleOpenAICompatibleChatAgent:
|
|
@@ -61,26 +60,3 @@ class SimpleOpenAICompatibleChatAgent:
|
|
|
n_steps += 1
|
|
|
|
|
|
raise Exception("Max run steps exceeded")
|
|
|
-
|
|
|
-if __name__ == '__main__':
|
|
|
- import pqai_agent.logging_service
|
|
|
- pqai_agent.logging_service.setup_root_logger()
|
|
|
- tools = [
|
|
|
- *ImageDescriber().get_tools(),
|
|
|
- *MessageNotifier().get_tools()
|
|
|
- ]
|
|
|
- system_instruction = "You are a helpful assistant."
|
|
|
- agent = SimpleOpenAICompatibleChatAgent(
|
|
|
- model=VOLCENGINE_MODEL_DEEPSEEK_V3,
|
|
|
- system_prompt=system_instruction,
|
|
|
- tools=tools
|
|
|
- )
|
|
|
-
|
|
|
- user_input = query = """
|
|
|
-分析以下图片的内容:"http://wx.qlogo.cn/mmhead/Q3auHgzwzM5glpnBtDUianJErYf9AQsptLM3N78xP3sOR8SSibsG35HQ/0"
|
|
|
-根据内容联想作一首诗
|
|
|
-Please think step by step.
|
|
|
- """
|
|
|
-
|
|
|
- result = agent.run(user_input)
|
|
|
- print(result)
|