agentUniverse 0.0.9.dev2__tar.gz → 0.0.10.dev1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/PKG-INFO +6 -1
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/embedding/dashscope_embedding.py +8 -10
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/knowledge.py +38 -1
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/store/chroma_store.py +3 -2
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/agent.py +38 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/executing_agent/executing_agent.py +32 -3
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/memory/langchain_instance.py +3 -3
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/peer_planner/peer_planner.py +2 -2
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/react_planner/react_planner.py +13 -0
- agentuniverse-0.0.10.dev1/agentuniverse/base/annotation/trace.py +160 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/monitor/monitor.py +30 -2
- agentuniverse-0.0.10.dev1/agentuniverse/llm/default/deep_seek_openai_style_llm.py +70 -0
- agentuniverse-0.0.10.dev1/agentuniverse/llm/default/deep_seek_openai_style_llm.yaml +8 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/llm.py +2 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/openai_style_llm.py +19 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/pyproject.toml +6 -1
- agentuniverse-0.0.9.dev2/agentuniverse/agent/action/knowledge/embedding/qwen_embedding.py +0 -82
- agentuniverse-0.0.9.dev2/agentuniverse/base/annotation/trace.py +0 -97
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/LICENSE +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/README_PYPI.md +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/embedding/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/embedding/embedding.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/embedding/openai_embedding.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/knowledge_manager.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/reader/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/reader/file/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/reader/file/docx_reader.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/reader/file/file_reader.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/reader/file/pdf_reader.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/reader/file/pptx_reader.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/reader/file/web_pdf_reader.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/reader/reader.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/store/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/store/document.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/store/milvus_store.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/store/query.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/knowledge/store/store.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/tool/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/tool/enum.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/tool/tool.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/action/tool/tool_manager.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/agent_manager.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/agent_model.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/executing_agent/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/executing_agent/default_cn_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/executing_agent/default_en_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/executing_agent/executing_agent.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/expressing_agent/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/expressing_agent/default_cn_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/expressing_agent/default_en_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/expressing_agent/expressing_agent.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/expressing_agent/expressing_agent.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/nl2api_agent/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/nl2api_agent/default_cn_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/nl2api_agent/default_en_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/nl2api_agent/nl2api_agent.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/nl2api_agent/nl2api_agent.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/peer_agent/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/peer_agent/peer_agent.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/peer_agent/peer_agent.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/planning_agent/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/planning_agent/default_cn_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/planning_agent/default_en_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/planning_agent/planning_agent.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/planning_agent/planning_agent.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/rag_agent/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/rag_agent/default_cn_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/rag_agent/default_en_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/rag_agent/rag_agent.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/rag_agent/rag_agent.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/react_agent/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/react_agent/default_cn_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/react_agent/default_en_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/react_agent/react_agent.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/react_agent/react_agent.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/reviewing_agent/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/reviewing_agent/default_cn_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/reviewing_agent/default_en_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/reviewing_agent/reviewing_agent.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/default/reviewing_agent/reviewing_agent.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/input_object.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/memory/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/memory/chat_memory.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/memory/default/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/memory/default/default_memory.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/memory/default/default_memory.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/memory/enum.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/memory/memory.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/memory/memory_manager.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/memory/message.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/memory/summarizer_cn_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/memory/summarizer_en_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/output_object.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/executing_planner/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/executing_planner/executing_planner.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/executing_planner/executing_planner.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/expressing_planner/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/expressing_planner/expressing_planner.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/expressing_planner/expressing_planner.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/nl2api_planner/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/nl2api_planner/nl2api_planner.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/nl2api_planner/nl2api_planner.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/peer_planner/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/peer_planner/peer_planner.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/planner.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/planner_manager.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/planning_planner/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/planning_planner/planning_planner.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/planning_planner/planning_planner.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/rag_planner/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/rag_planner/rag_planner.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/rag_planner/rag_planner.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/react_planner/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/react_planner/react_planner.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/react_planner/stream_callback.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/reviewing_planner/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/reviewing_planner/reviewing_planner.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent/plan/planner/reviewing_planner/reviewing_planner.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/service.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/service_configer.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/service_instance.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/service_manager.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/dal/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/dal/entity/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/dal/entity/request_do.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/dal/request_library.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/flask_server.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/gunicorn_server.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/post_fork_queue.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/request_task.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/rpc/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/rpc/grpc/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/rpc/grpc/agentuniverse_service.proto +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/rpc/grpc/agentuniverse_service_pb2.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/rpc/grpc/agentuniverse_service_pb2_grpc.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/rpc/grpc/grpc_server_booster.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/rpc/rpc_server.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/thread_with_result.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/web_booster.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/agent_serve/web/web_util.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/agentuniverse.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/annotation/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/annotation/singleton.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/component/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/component/application_component_manager.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/component/component_base.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/component/component_configer_util.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/component/component_enum.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/component/component_manager_base.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/application_configer/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/application_configer/app_configer.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/application_configer/application_config_manager.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/component_configer/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/component_configer/component_configer.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/component_configer/configers/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/component_configer/configers/agent_configer.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/component_configer/configers/knowledge_configer.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/component_configer/configers/llm_configer.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/component_configer/configers/memory_configer.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/component_configer/configers/planner_configer.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/component_configer/configers/prompt_configer.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/component_configer/configers/sqldb_wrapper_config.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/component_configer/configers/tool_configer.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/config_type_enum.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/configer.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/custom_configer/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/config/custom_configer/custom_key_configer.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/context/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/context/framework_context.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/context/framework_context_manager.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/env_util.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/logging/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/logging/general_logger.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/logging/logging_config.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/logging/logging_util.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/memory_util.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/monitor/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/prompt/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/prompt/combine_cn_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/prompt/combine_en_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/prompt/summary_cn_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/prompt/summary_en_prompt.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/prompt_util.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/system_util.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/database/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/database/sqldb_wrapper.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/database/sqldb_wrapper_manager.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/claude_langchain_instance.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/default/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/default/baichuan_openai_style_llm.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/default/baichuan_openai_style_llm.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/default/claude_llm.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/default/claude_llm.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/default/default_ollama_llm.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/default/default_ollama_llm.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/default/default_openai_llm.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/default/default_openai_llm.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/default/kimi_openai_style_llm.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/default/kimi_openai_style_llm.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/default/qwen_openai_style_llm.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/default/qwen_openai_style_llm.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/default/wenxin_llm.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/default/wenxin_llm.yaml +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/langchain_instance.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/llm_manager.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/llm_output.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/ollama_langchain_instance.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/openai_llm.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/openai_style_langchain_instance.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/llm/wenxin_langchain_instance.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/prompt/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/prompt/chat_prompt.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/prompt/enum.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/prompt/prompt.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/prompt/prompt_manager.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/prompt/prompt_model.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse_connector/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse_extension/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse_extension/logger/__init__.py +0 -0
- {agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse_extension/logger/sls_sink.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: agentUniverse
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.10.dev1
|
|
4
4
|
Summary: agentUniverse is a framework for developing applications powered by multi-agent base on large language model.
|
|
5
5
|
Home-page: https://github.com/alipay/agentUniverse
|
|
6
6
|
Author: AntGroup
|
|
@@ -21,6 +21,7 @@ Requires-Dist: anthropic (>=0.26.0,<0.27.0)
|
|
|
21
21
|
Requires-Dist: cffi (>=1.15.1,<2.0.0)
|
|
22
22
|
Requires-Dist: chromadb (==0.4.24)
|
|
23
23
|
Requires-Dist: dashscope (>=1.19.1,<2.0.0)
|
|
24
|
+
Requires-Dist: duckduckgo-search (>=6.1.7,<7.0.0)
|
|
24
25
|
Requires-Dist: flask (>=2.3.2,<3.0.0)
|
|
25
26
|
Requires-Dist: flask_cors (==4.0.0)
|
|
26
27
|
Requires-Dist: googleapis-common-protos (>=1.63.0,<2.0.0)
|
|
@@ -32,9 +33,12 @@ Requires-Dist: langchain-community (==0.0.38)
|
|
|
32
33
|
Requires-Dist: langchain-core (==0.1.52)
|
|
33
34
|
Requires-Dist: loguru (==0.7.2)
|
|
34
35
|
Requires-Dist: myst-parser (>=2.0.0,<3.0.0)
|
|
36
|
+
Requires-Dist: numpy (>=1.26.0,<2.0.0)
|
|
35
37
|
Requires-Dist: ollama (>=0.2.1,<0.3.0)
|
|
36
38
|
Requires-Dist: openai (==1.13.3)
|
|
37
39
|
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc (>=1.25.0,<2.0.0)
|
|
40
|
+
Requires-Dist: pandas (>=2.2.2,<3.0.0)
|
|
41
|
+
Requires-Dist: pyarrow (>=16.1.0,<17.0.0)
|
|
38
42
|
Requires-Dist: pydantic (>=2.6.4,<3.0.0)
|
|
39
43
|
Requires-Dist: pymilvus (>=2.4.3,<3.0.0) ; extra == "store-ext"
|
|
40
44
|
Requires-Dist: qianfan (>=0.3.12,<0.4.0)
|
|
@@ -44,6 +48,7 @@ Requires-Dist: sphinx-rtd-theme (>=2.0.0,<3.0.0)
|
|
|
44
48
|
Requires-Dist: tiktoken (==0.5.2)
|
|
45
49
|
Requires-Dist: tqdm (>=4.66.3,<5.0.0)
|
|
46
50
|
Requires-Dist: werkzeug (>=3.0.3,<4.0.0)
|
|
51
|
+
Requires-Dist: wikipedia (>=1.4.0,<2.0.0)
|
|
47
52
|
Project-URL: Repository, https://github.com/alipay/agentUniverse
|
|
48
53
|
Description-Content-Type: text/markdown
|
|
49
54
|
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import aiohttp
|
|
9
9
|
import requests
|
|
10
10
|
from typing import List, Generator, Optional
|
|
11
|
+
from pydantic import Field
|
|
11
12
|
import json
|
|
12
13
|
|
|
13
14
|
from agentuniverse.base.util.env_util import get_from_env
|
|
@@ -27,14 +28,9 @@ def batched(inputs: List,
|
|
|
27
28
|
|
|
28
29
|
class DashscopeEmbedding(Embedding):
|
|
29
30
|
"""The Dashscope embedding class."""
|
|
30
|
-
dashscope_api_key: Optional[str] =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"""Initialize the dashscope embedding class, need dashscope api key."""
|
|
34
|
-
super().__init__(**kwargs)
|
|
35
|
-
self.dashscope_api_key = get_from_env("DASHSCOPE_API_KEY")
|
|
36
|
-
if not self.dashscope_api_key:
|
|
37
|
-
raise Exception("No DASHSCOPE_API_KEY in your environment.")
|
|
31
|
+
dashscope_api_key: Optional[str] = Field(
|
|
32
|
+
default_factory=lambda: get_from_env("DASHSCOPE_API_KEY")
|
|
33
|
+
)
|
|
38
34
|
|
|
39
35
|
|
|
40
36
|
def get_embeddings(self, texts: List[str]) -> List[List[float]]:
|
|
@@ -69,7 +65,8 @@ class DashscopeEmbedding(Embedding):
|
|
|
69
65
|
)
|
|
70
66
|
resp_json = response.json()
|
|
71
67
|
return resp_json
|
|
72
|
-
|
|
68
|
+
if not self.dashscope_api_key:
|
|
69
|
+
raise Exception("No DASHSCOPE_API_KEY in your environment.")
|
|
73
70
|
result = []
|
|
74
71
|
post_params = {
|
|
75
72
|
"model": self.embedding_model_name,
|
|
@@ -128,7 +125,8 @@ class DashscopeEmbedding(Embedding):
|
|
|
128
125
|
) as resp:
|
|
129
126
|
resp_json = await resp.json()
|
|
130
127
|
return resp_json
|
|
131
|
-
|
|
128
|
+
if not self.dashscope_api_key:
|
|
129
|
+
raise Exception("No DASHSCOPE_API_KEY in your environment.")
|
|
132
130
|
result = []
|
|
133
131
|
post_params = {
|
|
134
132
|
"model": self.embedding_model_name,
|
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
# @Author : wangchongshi
|
|
6
6
|
# @Email : wangchongshi.wcs@antgroup.com
|
|
7
7
|
# @FileName: knowledge.py
|
|
8
|
-
from typing import Optional, Dict, List
|
|
8
|
+
from typing import Optional, Dict, List
|
|
9
|
+
|
|
10
|
+
from langchain_core.utils.json import parse_json_markdown
|
|
11
|
+
from langchain.tools import Tool as LangchainTool
|
|
9
12
|
|
|
10
13
|
from agentuniverse.agent.action.knowledge.reader.reader import Reader
|
|
11
14
|
from agentuniverse.agent.action.knowledge.store.document import Document
|
|
@@ -77,3 +80,37 @@ class Knowledge(ComponentBase):
|
|
|
77
80
|
if component_configer.ext_info:
|
|
78
81
|
self.ext_info = component_configer.ext_info
|
|
79
82
|
return self
|
|
83
|
+
|
|
84
|
+
def langchain_query(self, query: str) -> str:
|
|
85
|
+
"""Query the knowledge using LangChain.
|
|
86
|
+
|
|
87
|
+
Query documents from the store and return the results.
|
|
88
|
+
"""
|
|
89
|
+
parse_query = parse_json_markdown(query)
|
|
90
|
+
query = Query(**parse_query)
|
|
91
|
+
knowledge = self.store.query(query)
|
|
92
|
+
res = ['This is Query Result']
|
|
93
|
+
for doc in knowledge:
|
|
94
|
+
res.append(doc.text)
|
|
95
|
+
return "\n=========================================\n".join(res)
|
|
96
|
+
|
|
97
|
+
def as_langchain_tool(self) -> LangchainTool:
|
|
98
|
+
"""Convert the Knowledge object to a LangChain tool.
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
Any: the LangChain tool object
|
|
102
|
+
"""
|
|
103
|
+
args_description = """
|
|
104
|
+
This is a knowledge base tool, which stores the content you may need. To use this tool, you need to give a json string with the following format:
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"query_str": "<your query here>",
|
|
108
|
+
"top_k": <number of results to return>,
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
"""
|
|
112
|
+
return LangchainTool(
|
|
113
|
+
name=self.name,
|
|
114
|
+
description=self.description + args_description,
|
|
115
|
+
func=self.langchain_query,
|
|
116
|
+
)
|
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
# @Email : wangchongshi.wcs@antgroup.com
|
|
7
7
|
# @FileName: chroma_store.py
|
|
8
8
|
from typing import List, Any, Optional
|
|
9
|
+
from pydantic import SkipValidation
|
|
9
10
|
|
|
10
11
|
import chromadb
|
|
11
12
|
from chromadb import QueryResult
|
|
12
|
-
from chromadb.api.models import Collection
|
|
13
|
+
from chromadb.api.models.Collection import Collection
|
|
13
14
|
|
|
14
15
|
from agentuniverse.agent.action.knowledge.store.document import Document
|
|
15
16
|
from agentuniverse.agent.action.knowledge.store.query import Query
|
|
@@ -28,7 +29,7 @@ class ChromaStore(Store):
|
|
|
28
29
|
"""
|
|
29
30
|
|
|
30
31
|
collection_name: Optional[str] = 'chroma_db'
|
|
31
|
-
collection: Collection = None
|
|
32
|
+
collection: SkipValidation[Collection] = None
|
|
32
33
|
persist_path: Optional[str] = None
|
|
33
34
|
|
|
34
35
|
def __init__(self, **kwargs):
|
|
@@ -6,21 +6,26 @@
|
|
|
6
6
|
# @Email : lc299034@antgroup.com
|
|
7
7
|
# @FileName: agent.py
|
|
8
8
|
"""The definition of agent paradigm."""
|
|
9
|
+
import json
|
|
9
10
|
from abc import abstractmethod
|
|
10
11
|
from datetime import datetime
|
|
11
12
|
from typing import Optional
|
|
12
13
|
|
|
14
|
+
from langchain_core.utils.json import parse_json_markdown
|
|
15
|
+
|
|
13
16
|
from agentuniverse.agent.agent_model import AgentModel
|
|
14
17
|
from agentuniverse.agent.input_object import InputObject
|
|
15
18
|
from agentuniverse.agent.output_object import OutputObject
|
|
16
19
|
from agentuniverse.agent.plan.planner.planner import Planner
|
|
17
20
|
from agentuniverse.agent.plan.planner.planner_manager import PlannerManager
|
|
21
|
+
from agentuniverse.base.annotation.trace import trace_agent
|
|
18
22
|
from agentuniverse.base.component.component_base import ComponentBase
|
|
19
23
|
from agentuniverse.base.component.component_enum import ComponentEnum
|
|
20
24
|
from agentuniverse.base.config.application_configer.application_config_manager \
|
|
21
25
|
import ApplicationConfigManager
|
|
22
26
|
from agentuniverse.base.config.component_configer.configers.agent_configer \
|
|
23
27
|
import AgentConfiger
|
|
28
|
+
from agentuniverse.base.util.logging.logging_util import LOGGER
|
|
24
29
|
from agentuniverse.llm.llm import LLM
|
|
25
30
|
|
|
26
31
|
|
|
@@ -66,6 +71,7 @@ class Agent(ComponentBase):
|
|
|
66
71
|
"""
|
|
67
72
|
pass
|
|
68
73
|
|
|
74
|
+
@trace_agent
|
|
69
75
|
def run(self, **kwargs) -> OutputObject:
|
|
70
76
|
"""Agent instance running entry.
|
|
71
77
|
|
|
@@ -156,3 +162,35 @@ class Agent(ComponentBase):
|
|
|
156
162
|
plan=plan, memory=memory, action=action)
|
|
157
163
|
self.agent_model = agent_model
|
|
158
164
|
return self
|
|
165
|
+
|
|
166
|
+
def langchain_run(self, input: str, callbacks=None, **kwargs):
|
|
167
|
+
"""Run the agent model using LangChain."""
|
|
168
|
+
try:
|
|
169
|
+
parse_result = parse_json_markdown(input)
|
|
170
|
+
except Exception as e:
|
|
171
|
+
LOGGER.error(f"langchain run parse_json_markdown error,input(parse_result) error({str(e)})")
|
|
172
|
+
return "Error , Your Action Input is not a valid JSON string"
|
|
173
|
+
output_object = self.run(**parse_result, callbacks=callbacks, **kwargs)
|
|
174
|
+
result_dict = {}
|
|
175
|
+
for key in self.output_keys():
|
|
176
|
+
result_dict[key] = output_object.get_data(key)
|
|
177
|
+
return result_dict
|
|
178
|
+
|
|
179
|
+
def as_langchain_tool(self):
|
|
180
|
+
"""Convert to LangChain tool."""
|
|
181
|
+
from langchain.agents.tools import Tool
|
|
182
|
+
format_dict = {}
|
|
183
|
+
for key in self.input_keys():
|
|
184
|
+
format_dict.setdefault(key, "input val")
|
|
185
|
+
format_str = json.dumps(format_dict)
|
|
186
|
+
|
|
187
|
+
args_description = f"""
|
|
188
|
+
to use this tool,your input must be a json string,must contain all keys of {self.input_keys()},
|
|
189
|
+
and the value of the key must be a json string,the format of the json string is as follows:
|
|
190
|
+
```{format_str}```
|
|
191
|
+
"""
|
|
192
|
+
return Tool(
|
|
193
|
+
name=self.agent_model.info.get("name"),
|
|
194
|
+
func=self.langchain_run,
|
|
195
|
+
description=self.agent_model.info.get("description") + args_description
|
|
196
|
+
)
|
|
@@ -8,8 +8,11 @@
|
|
|
8
8
|
import copy
|
|
9
9
|
from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED
|
|
10
10
|
from typing import Optional, Any
|
|
11
|
+
|
|
12
|
+
from agentuniverse.agent.action.tool.tool_manager import ToolManager
|
|
11
13
|
from agentuniverse.agent.agent import Agent
|
|
12
14
|
from agentuniverse.agent.input_object import InputObject
|
|
15
|
+
from agentuniverse.agent.plan.planner.planner import Planner
|
|
13
16
|
from agentuniverse.agent.plan.planner.planner_manager import PlannerManager
|
|
14
17
|
|
|
15
18
|
|
|
@@ -75,9 +78,35 @@ class ExecutingAgent(Agent):
|
|
|
75
78
|
for task in framework:
|
|
76
79
|
agent_input_copy: dict = copy.deepcopy(agent_input)
|
|
77
80
|
agent_input_copy['input'] = task
|
|
81
|
+
planner: Planner = PlannerManager().get_instance_obj(self.agent_model.plan.get('planner').get('name'))
|
|
78
82
|
futures.append(
|
|
79
|
-
self.executor.submit(
|
|
80
|
-
|
|
81
|
-
self.agent_model, agent_input_copy, input_object))
|
|
83
|
+
self.executor.submit(planner.invoke, self.agent_model, agent_input_copy,
|
|
84
|
+
self.process_intput_object(input_object, task, planner.input_key)))
|
|
82
85
|
wait(futures, return_when=ALL_COMPLETED)
|
|
83
86
|
return {'futures': futures}
|
|
87
|
+
|
|
88
|
+
def process_intput_object(self, input_object: InputObject, subtask: str, planner_input_key: str) -> InputObject:
|
|
89
|
+
"""Process input object for the executing agent.
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
input_object (InputObject): input parameters passed by the user.
|
|
93
|
+
subtask (str): subtask to be executed.
|
|
94
|
+
planner_input_key (str): planner input key.
|
|
95
|
+
|
|
96
|
+
Returns:
|
|
97
|
+
input_object (InputObject): processed input object.
|
|
98
|
+
"""
|
|
99
|
+
# get agent toolsets.
|
|
100
|
+
action: dict = self.agent_model.action or dict()
|
|
101
|
+
tools: list = action.get('tool') or list()
|
|
102
|
+
input_object_copy: InputObject = copy.deepcopy(input_object)
|
|
103
|
+
# wrap input_object for agent knowledge.
|
|
104
|
+
input_object_copy.add_data(planner_input_key, subtask)
|
|
105
|
+
# wrap input_object for agent toolsets.
|
|
106
|
+
for tool_name in tools:
|
|
107
|
+
tool = ToolManager().get_instance_obj(tool_name)
|
|
108
|
+
if tool is None:
|
|
109
|
+
continue
|
|
110
|
+
# note: only insert the first key of tool input.
|
|
111
|
+
input_object_copy.add_data(tool.input_keys[0], subtask)
|
|
112
|
+
return input_object_copy
|
|
@@ -9,6 +9,7 @@ from typing import List, Optional, Dict, Any
|
|
|
9
9
|
|
|
10
10
|
from langchain_core.messages import BaseMessage, get_buffer_string
|
|
11
11
|
from langchain.memory import ConversationSummaryBufferMemory, ConversationTokenBufferMemory
|
|
12
|
+
from langchain_core.output_parsers import StrOutputParser
|
|
12
13
|
|
|
13
14
|
from agentuniverse.agent.memory.enum import ChatMessageEnum
|
|
14
15
|
from agentuniverse.agent.memory.message import Message
|
|
@@ -115,9 +116,8 @@ class AuConversationSummaryBufferMemory(ConversationSummaryBufferMemory):
|
|
|
115
116
|
)
|
|
116
117
|
prompt_version = self.prompt_version if self.prompt_version else 'chat_memory.summarizer_cn'
|
|
117
118
|
prompt: Prompt = PromptManager().get_instance_obj(prompt_version)
|
|
118
|
-
chain = prompt.as_langchain() | self.llm
|
|
119
|
-
|
|
120
|
-
return res.content
|
|
119
|
+
chain = prompt.as_langchain() | self.llm | StrOutputParser()
|
|
120
|
+
return chain.invoke(input={'summary': existing_summary, 'new_lines': new_lines})
|
|
121
121
|
|
|
122
122
|
|
|
123
123
|
class AuConversationTokenBufferMemory(ConversationTokenBufferMemory):
|
|
@@ -146,7 +146,7 @@ class PeerPlanner(Planner):
|
|
|
146
146
|
|
|
147
147
|
if not expressing_result or jump_step in ["planning", "executing", "expressing"]:
|
|
148
148
|
if not expressingAgent:
|
|
149
|
-
LOGGER.warn("no
|
|
149
|
+
LOGGER.warn("no expressing agent.")
|
|
150
150
|
expressing_result = OutputObject({})
|
|
151
151
|
else:
|
|
152
152
|
LOGGER.info(f"Starting expressing agent.")
|
|
@@ -160,7 +160,7 @@ class PeerPlanner(Planner):
|
|
|
160
160
|
|
|
161
161
|
if not reviewing_result or jump_step in ["planning", "executing", "expressing", "reviewing"]:
|
|
162
162
|
if not reviewingAgent:
|
|
163
|
-
LOGGER.warn("no
|
|
163
|
+
LOGGER.warn("no reviewing agent.")
|
|
164
164
|
loopResults.append({
|
|
165
165
|
"planning_result": planning_result,
|
|
166
166
|
"executing_result": executing_result,
|
|
@@ -11,8 +11,12 @@ from langchain.agents import AgentExecutor, create_react_agent
|
|
|
11
11
|
from langchain.tools import Tool as LangchainTool
|
|
12
12
|
from langchain_core.runnables import RunnableConfig
|
|
13
13
|
|
|
14
|
+
from agentuniverse.agent.action.knowledge.knowledge import Knowledge
|
|
15
|
+
from agentuniverse.agent.action.knowledge.knowledge_manager import KnowledgeManager
|
|
14
16
|
from agentuniverse.agent.action.tool.tool import Tool
|
|
15
17
|
from agentuniverse.agent.action.tool.tool_manager import ToolManager
|
|
18
|
+
from agentuniverse.agent.agent import Agent
|
|
19
|
+
from agentuniverse.agent.agent_manager import AgentManager
|
|
16
20
|
from agentuniverse.agent.agent_model import AgentModel
|
|
17
21
|
from agentuniverse.agent.input_object import InputObject
|
|
18
22
|
from agentuniverse.agent.memory.chat_memory import ChatMemory
|
|
@@ -78,6 +82,15 @@ class ReActPlanner(Planner):
|
|
|
78
82
|
for tool_name in tool_names:
|
|
79
83
|
tool: Tool = ToolManager().get_instance_obj(tool_name)
|
|
80
84
|
lc_tools.append(tool.as_langchain())
|
|
85
|
+
knowledge: list = action.get('knowledge') or list()
|
|
86
|
+
for knowledge_name in knowledge:
|
|
87
|
+
knowledge_tool: Knowledge = KnowledgeManager().get_instance_obj(knowledge_name)
|
|
88
|
+
lc_tools.append(knowledge_tool.as_langchain_tool())
|
|
89
|
+
|
|
90
|
+
agents: list = action.get('agent') or list()
|
|
91
|
+
for agent_name in agents:
|
|
92
|
+
agent_tool: Agent = AgentManager().get_instance_obj(agent_name)
|
|
93
|
+
lc_tools.append(agent_tool.as_langchain_tool())
|
|
81
94
|
return lc_tools
|
|
82
95
|
|
|
83
96
|
def handle_prompt(self, agent_model: AgentModel, planner_input: dict) -> Prompt:
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# !/usr/bin/env python3
|
|
2
|
+
# -*- coding:utf-8 -*-
|
|
3
|
+
|
|
4
|
+
# @Time : 2024/6/5 15:33
|
|
5
|
+
# @Author : wangchongshi
|
|
6
|
+
# @Email : wangchongshi.wcs@antgroup.com
|
|
7
|
+
# @FileName: trace.py
|
|
8
|
+
import asyncio
|
|
9
|
+
import functools
|
|
10
|
+
import inspect
|
|
11
|
+
import json
|
|
12
|
+
|
|
13
|
+
from functools import wraps
|
|
14
|
+
|
|
15
|
+
from agentuniverse.agent.input_object import InputObject
|
|
16
|
+
from agentuniverse.agent.output_object import OutputObject
|
|
17
|
+
from agentuniverse.base.util.monitor.monitor import Monitor
|
|
18
|
+
from agentuniverse.llm.llm_output import LLMOutput
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def trace_llm(func):
|
|
22
|
+
"""Annotation: @trace_llm
|
|
23
|
+
|
|
24
|
+
Decorator to trace the LLM invocation, add llm input and output to the monitor.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
@wraps(func)
|
|
28
|
+
async def wrapper_async(*args, **kwargs):
|
|
29
|
+
# get llm input from arguments
|
|
30
|
+
llm_input = _get_llm_input(func, *args, **kwargs)
|
|
31
|
+
# check whether the tracing switch is enabled
|
|
32
|
+
self = llm_input.pop('self', None)
|
|
33
|
+
if self and hasattr(self, 'tracing'):
|
|
34
|
+
if self.tracing is False:
|
|
35
|
+
return await func(*args, **kwargs)
|
|
36
|
+
# invoke function
|
|
37
|
+
result = await func(*args, **kwargs)
|
|
38
|
+
# not streaming
|
|
39
|
+
if isinstance(result, LLMOutput):
|
|
40
|
+
# add llm invocation info to monitor
|
|
41
|
+
Monitor().trace_llm_invocation(source=func.__qualname__, llm_input=llm_input, llm_output=result.text)
|
|
42
|
+
return result
|
|
43
|
+
else:
|
|
44
|
+
# streaming
|
|
45
|
+
async def gen_iterator():
|
|
46
|
+
llm_output = []
|
|
47
|
+
async for chunk in result:
|
|
48
|
+
llm_output.append(chunk.text)
|
|
49
|
+
yield chunk
|
|
50
|
+
# add llm invocation info to monitor
|
|
51
|
+
Monitor().trace_llm_invocation(source=func.__qualname__, llm_input=llm_input,
|
|
52
|
+
llm_output="".join(llm_output))
|
|
53
|
+
|
|
54
|
+
return gen_iterator()
|
|
55
|
+
|
|
56
|
+
@functools.wraps(func)
|
|
57
|
+
def wrapper_sync(*args, **kwargs):
|
|
58
|
+
# get llm input from arguments
|
|
59
|
+
llm_input = _get_llm_input(func, *args, **kwargs)
|
|
60
|
+
# check whether the tracing switch is enabled
|
|
61
|
+
self = llm_input.pop('self', None)
|
|
62
|
+
if self and hasattr(self, 'tracing'):
|
|
63
|
+
if self.tracing is False:
|
|
64
|
+
return func(*args, **kwargs)
|
|
65
|
+
# invoke function
|
|
66
|
+
result = func(*args, **kwargs)
|
|
67
|
+
# not streaming
|
|
68
|
+
if isinstance(result, LLMOutput):
|
|
69
|
+
# add llm invocation info to monitor
|
|
70
|
+
Monitor().trace_llm_invocation(source=func.__qualname__, llm_input=llm_input, llm_output=result.text)
|
|
71
|
+
return result
|
|
72
|
+
else:
|
|
73
|
+
# streaming
|
|
74
|
+
def gen_iterator():
|
|
75
|
+
llm_output = []
|
|
76
|
+
for chunk in result:
|
|
77
|
+
llm_output.append(chunk.text)
|
|
78
|
+
yield chunk
|
|
79
|
+
# add llm invocation info to monitor
|
|
80
|
+
Monitor().trace_llm_invocation(source=func.__qualname__, llm_input=llm_input,
|
|
81
|
+
llm_output="".join(llm_output))
|
|
82
|
+
|
|
83
|
+
return gen_iterator()
|
|
84
|
+
|
|
85
|
+
if asyncio.iscoroutinefunction(func):
|
|
86
|
+
# async function
|
|
87
|
+
return wrapper_async
|
|
88
|
+
else:
|
|
89
|
+
# sync function
|
|
90
|
+
return wrapper_sync
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def _get_llm_input(func, *args, **kwargs) -> dict:
|
|
94
|
+
"""Get the llm input from arguments."""
|
|
95
|
+
sig = inspect.signature(func)
|
|
96
|
+
bound_args = sig.bind(*args, **kwargs)
|
|
97
|
+
bound_args.apply_defaults()
|
|
98
|
+
return {k: v for k, v in bound_args.arguments.items()}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def trace_agent(func):
|
|
102
|
+
"""Annotation: @trace_agent
|
|
103
|
+
|
|
104
|
+
Decorator to trace the agent invocation, add agent input and output to the monitor.
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
@functools.wraps(func)
|
|
108
|
+
def wrapper_sync(*args, **kwargs):
|
|
109
|
+
# get agent input from arguments
|
|
110
|
+
agent_input = _get_agent_input(func, *args, **kwargs)
|
|
111
|
+
# check whether the tracing switch is enabled
|
|
112
|
+
source = func.__qualname__
|
|
113
|
+
self = agent_input.pop('self', None)
|
|
114
|
+
|
|
115
|
+
tracing = None
|
|
116
|
+
if isinstance(self, object):
|
|
117
|
+
agent_model = getattr(self, 'agent_model', None)
|
|
118
|
+
if isinstance(agent_model, object):
|
|
119
|
+
info = getattr(agent_model, 'info', None)
|
|
120
|
+
profile = getattr(agent_model, 'profile', None)
|
|
121
|
+
if isinstance(info, dict):
|
|
122
|
+
source = info.get('name', None)
|
|
123
|
+
if isinstance(profile, dict):
|
|
124
|
+
tracing = profile.get('tracing', None)
|
|
125
|
+
|
|
126
|
+
if tracing is False:
|
|
127
|
+
return func(*args, **kwargs)
|
|
128
|
+
|
|
129
|
+
# invoke function
|
|
130
|
+
result = func(*args, **kwargs)
|
|
131
|
+
# serialize agent input and output dict
|
|
132
|
+
agent_input = serialize_agent_invocation(agent_input)
|
|
133
|
+
agent_output = serialize_agent_invocation(result)
|
|
134
|
+
# add agent invocation info to monitor
|
|
135
|
+
Monitor().trace_agent_invocation(source=source, agent_input=agent_input, agent_output=agent_output)
|
|
136
|
+
return result
|
|
137
|
+
|
|
138
|
+
# sync function
|
|
139
|
+
return wrapper_sync
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def _get_agent_input(func, *args, **kwargs) -> dict:
|
|
143
|
+
"""Get the agent input from arguments."""
|
|
144
|
+
sig = inspect.signature(func)
|
|
145
|
+
bound_args = sig.bind(*args, **kwargs)
|
|
146
|
+
bound_args.apply_defaults()
|
|
147
|
+
return {k: v for k, v in bound_args.arguments.items()}
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def default_serializer(obj):
|
|
151
|
+
if isinstance(obj, InputObject):
|
|
152
|
+
return obj.to_dict()
|
|
153
|
+
elif isinstance(obj, OutputObject):
|
|
154
|
+
return obj.to_dict()
|
|
155
|
+
raise TypeError(f"Object of type {type(obj).__name__} is not JSON serializable")
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def serialize_agent_invocation(agent_invocation):
|
|
159
|
+
agent_invocation_serialized = json.loads(json.dumps(agent_invocation, default=default_serializer))
|
|
160
|
+
return agent_invocation_serialized
|
{agentuniverse-0.0.9.dev2 → agentuniverse-0.0.10.dev1}/agentuniverse/base/util/monitor/monitor.py
RENAMED
|
@@ -16,6 +16,7 @@ from agentuniverse.base.annotation.singleton import singleton
|
|
|
16
16
|
from agentuniverse.base.config.configer import Configer
|
|
17
17
|
|
|
18
18
|
LLM_INVOCATION_SUBDIR = "llm_invocation"
|
|
19
|
+
AGENT_INVOCATION_SUBDIR = "agent_invocation"
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
@singleton
|
|
@@ -54,11 +55,38 @@ class Monitor(BaseModel):
|
|
|
54
55
|
|
|
55
56
|
# write to jsonl
|
|
56
57
|
with jsonlines.open(path_save, 'a') as writer:
|
|
57
|
-
|
|
58
|
-
writer.write(json_record)
|
|
58
|
+
writer.write(llm_invocation)
|
|
59
59
|
|
|
60
60
|
def _get_or_create_subdir(self, subdir: str) -> str:
|
|
61
61
|
"""Get or create a subdirectory if it doesn't exist in the monitor directory."""
|
|
62
62
|
path = os.path.join(self.dir, subdir)
|
|
63
63
|
os.makedirs(path, exist_ok=True)
|
|
64
64
|
return path
|
|
65
|
+
|
|
66
|
+
def trace_agent_invocation(self, source: str, agent_input: Union[str, dict],
|
|
67
|
+
agent_output: Union[str, dict]) -> None:
|
|
68
|
+
"""Trace the agent invocation and save it to the monitor jsonl file."""
|
|
69
|
+
if self.activate:
|
|
70
|
+
try:
|
|
71
|
+
import jsonlines
|
|
72
|
+
except ImportError:
|
|
73
|
+
raise ImportError(
|
|
74
|
+
"jsonlines is required to trace llm invocation: `pip install jsonlines`"
|
|
75
|
+
)
|
|
76
|
+
# get the current time
|
|
77
|
+
date = datetime.datetime.now()
|
|
78
|
+
agent_invocation = {
|
|
79
|
+
"source": source,
|
|
80
|
+
"date": date.strftime("%Y-%m-%d %H:%M:%S"),
|
|
81
|
+
"agent_input": agent_input,
|
|
82
|
+
"agent_output": agent_output,
|
|
83
|
+
}
|
|
84
|
+
# files are stored in hours
|
|
85
|
+
filename = f"agent_{source}_{date.strftime('%Y-%m-%d-%H')}.jsonl"
|
|
86
|
+
# file path to save
|
|
87
|
+
path_save = os.path.join(str(self._get_or_create_subdir(AGENT_INVOCATION_SUBDIR)), filename)
|
|
88
|
+
|
|
89
|
+
# write to jsonl
|
|
90
|
+
with jsonlines.open(path_save, 'a') as writer:
|
|
91
|
+
writer.write(agent_invocation)
|
|
92
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# !/usr/bin/env python3
|
|
2
|
+
# -*- coding:utf-8 -*-
|
|
3
|
+
|
|
4
|
+
# @Time : 2024/5/21 17:49
|
|
5
|
+
# @Author : weizjajj
|
|
6
|
+
# @Email : weizhongjie.wzj@antgroup.com
|
|
7
|
+
# @FileName: claude_llm.py
|
|
8
|
+
|
|
9
|
+
from typing import Optional, Any, Union, Iterator, AsyncIterator
|
|
10
|
+
|
|
11
|
+
from pydantic import Field
|
|
12
|
+
|
|
13
|
+
from agentuniverse.base.annotation.trace import trace_llm
|
|
14
|
+
from agentuniverse.base.util.env_util import get_from_env
|
|
15
|
+
from agentuniverse.llm.llm_output import LLMOutput
|
|
16
|
+
from agentuniverse.llm.openai_style_llm import OpenAIStyleLLM
|
|
17
|
+
|
|
18
|
+
DEEpSEEkMAXCONTETNLENGTH = {
|
|
19
|
+
"deepseek-chat": 32000,
|
|
20
|
+
"deepseek-coder": 32000,
|
|
21
|
+
"claude-3-haiku-20240307": 200000,
|
|
22
|
+
"claude-2.1": 200000,
|
|
23
|
+
"claude-2.0": 100000,
|
|
24
|
+
"claude-instant-1.2": 100000
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class DefaultDeepSeekLLM(OpenAIStyleLLM):
|
|
29
|
+
"""The agentUniverse default openai llm module.
|
|
30
|
+
|
|
31
|
+
LLM parameters, such as name/description/model_name/max_tokens,
|
|
32
|
+
are injected into this class by the default_openai_llm.yaml configuration.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
api_key: Optional[str] = Field(default_factory=lambda: get_from_env("DEEPSEEK_API_KEY"))
|
|
36
|
+
organization: Optional[str] = Field(default_factory=lambda: get_from_env("DEEPSEEK_ORGANIZATION"))
|
|
37
|
+
api_base: Optional[str] = Field(default_factory=lambda: get_from_env("DEEPSEEK_API_BASE"))
|
|
38
|
+
proxy: Optional[str] = Field(default_factory=lambda: get_from_env("DEEPSEEK_PROXY"))
|
|
39
|
+
|
|
40
|
+
@trace_llm
|
|
41
|
+
def call(self, messages: list, **kwargs: Any) -> Union[LLMOutput, Iterator[LLMOutput]]:
|
|
42
|
+
""" The call method of the LLM.
|
|
43
|
+
|
|
44
|
+
Users can customize how the model interacts by overriding call method of the LLM class.
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
messages (list): The messages to send to the LLM.
|
|
48
|
+
**kwargs: Arbitrary keyword arguments.
|
|
49
|
+
"""
|
|
50
|
+
return super().call(messages, **kwargs)
|
|
51
|
+
|
|
52
|
+
@trace_llm
|
|
53
|
+
async def acall(self, messages: list, **kwargs: Any) -> Union[LLMOutput, AsyncIterator[LLMOutput]]:
|
|
54
|
+
""" The async call method of the LLM.
|
|
55
|
+
|
|
56
|
+
Users can customize how the model interacts by overriding acall method of the LLM class.
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
messages (list): The messages to send to the LLM.
|
|
60
|
+
**kwargs: Arbitrary keyword arguments.
|
|
61
|
+
"""
|
|
62
|
+
return await super().acall(messages, **kwargs)
|
|
63
|
+
|
|
64
|
+
def max_context_length(self) -> int:
|
|
65
|
+
"""Max context length.
|
|
66
|
+
|
|
67
|
+
The total length of input tokens and generated tokens is limited by the openai model's context length.
|
|
68
|
+
"""
|
|
69
|
+
return DEEpSEEkMAXCONTETNLENGTH.get(self.model_name, 4096)
|
|
70
|
+
|
|
@@ -103,6 +103,8 @@ class LLM(ComponentBase):
|
|
|
103
103
|
if component_configer.ext_info:
|
|
104
104
|
self.ext_info = component_configer.ext_info
|
|
105
105
|
self.tracing = component_configer.tracing
|
|
106
|
+
if 'max_context_length' in component_configer.configer.value:
|
|
107
|
+
self._max_context_length = component_configer.configer.value['max_context_length']
|
|
106
108
|
return self
|
|
107
109
|
|
|
108
110
|
def set_by_agent_model(self, **kwargs) -> None:
|