mars-cmbagent 1.0.0__py3-none-any.whl
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.
- cmbagent/Robot-MS-Aqua.png +0 -0
- cmbagent/Robot-MS-Grey.png +0 -0
- cmbagent/__init__.py +74 -0
- cmbagent/agents/aaai_keywords_finder/__init__.py +0 -0
- cmbagent/agents/aaai_keywords_finder/aaai_keywords_finder.py +42 -0
- cmbagent/agents/aaai_keywords_finder/aaai_keywords_finder.yaml +80 -0
- cmbagent/agents/aas_keyword_finder/__init__.py +0 -0
- cmbagent/agents/aas_keyword_finder/aas_keyword_finder.py +23 -0
- cmbagent/agents/aas_keyword_finder/aas_keyword_finder.yaml +46 -0
- cmbagent/agents/admin/__init__.py +0 -0
- cmbagent/agents/admin/admin.py +19 -0
- cmbagent/agents/admin/admin.yaml +11 -0
- cmbagent/agents/assistant/assistant.yaml +64 -0
- cmbagent/agents/camb_context/camb_context.py +16 -0
- cmbagent/agents/camb_context/camb_context.yaml +71 -0
- cmbagent/agents/camb_response_formatter/__init__.py +0 -0
- cmbagent/agents/camb_response_formatter/camb_response_formatter.py +66 -0
- cmbagent/agents/camb_response_formatter/camb_response_formatter.yaml +9 -0
- cmbagent/agents/classy_context/classy_context.py +16 -0
- cmbagent/agents/classy_context/classy_context.yaml +71 -0
- cmbagent/agents/classy_response_formatter/__init__.py +0 -0
- cmbagent/agents/classy_response_formatter/classy_response_formatter.py +62 -0
- cmbagent/agents/classy_response_formatter/classy_response_formatter.yaml +9 -0
- cmbagent/agents/classy_sz_response_formatter/__init__.py +0 -0
- cmbagent/agents/classy_sz_response_formatter/classy_sz_response_formatter.py +60 -0
- cmbagent/agents/classy_sz_response_formatter/classy_sz_response_formatter.yaml +9 -0
- cmbagent/agents/cobaya_response_formatter/__init__.py +0 -0
- cmbagent/agents/cobaya_response_formatter/cobaya_response_formatter.py +60 -0
- cmbagent/agents/cobaya_response_formatter/cobaya_response_formatter.yaml +9 -0
- cmbagent/agents/control/__init__.py +0 -0
- cmbagent/agents/control/control.py +16 -0
- cmbagent/agents/control/control.yaml +47 -0
- cmbagent/agents/control_starter/__init__.py +0 -0
- cmbagent/agents/control_starter/control_starter.py +23 -0
- cmbagent/agents/control_starter/control_starter.yaml +40 -0
- cmbagent/agents/copilot_control/__init__.py +1 -0
- cmbagent/agents/copilot_control/_copilot_routing_models.py +228 -0
- cmbagent/agents/copilot_control/copilot_control.py +23 -0
- cmbagent/agents/copilot_control/copilot_control.yaml +114 -0
- cmbagent/agents/engineer/__init__.py +0 -0
- cmbagent/agents/engineer/engineer.py +16 -0
- cmbagent/agents/engineer/engineer.yaml +215 -0
- cmbagent/agents/engineer_nest/__init__.py +0 -0
- cmbagent/agents/engineer_nest/engineer_nest.py +23 -0
- cmbagent/agents/engineer_nest/engineer_nest.yaml +12 -0
- cmbagent/agents/engineer_response_formatter/__init__.py +0 -0
- cmbagent/agents/engineer_response_formatter/engineer_response_formatter.py +76 -0
- cmbagent/agents/engineer_response_formatter/engineer_response_formatter.yaml +51 -0
- cmbagent/agents/executor/__init__.py +0 -0
- cmbagent/agents/executor/executor.py +21 -0
- cmbagent/agents/executor/executor.yaml +22 -0
- cmbagent/agents/executor_bash/__init__.py +0 -0
- cmbagent/agents/executor_bash/executor_bash.py +21 -0
- cmbagent/agents/executor_bash/executor_bash.yaml +22 -0
- cmbagent/agents/executor_response_formatter/__init__.py +0 -0
- cmbagent/agents/executor_response_formatter/executor_response_formatter.py +68 -0
- cmbagent/agents/executor_response_formatter/executor_response_formatter.yaml +26 -0
- cmbagent/agents/idea_hater/__init__.py +0 -0
- cmbagent/agents/idea_hater/idea_hater.py +23 -0
- cmbagent/agents/idea_hater/idea_hater.yaml +65 -0
- cmbagent/agents/idea_hater_response_formatter/__init__.py +0 -0
- cmbagent/agents/idea_hater_response_formatter/idea_hater_response_formatter.py +51 -0
- cmbagent/agents/idea_hater_response_formatter/idea_hater_response_formatter.yaml +9 -0
- cmbagent/agents/idea_maker/__init__.py +0 -0
- cmbagent/agents/idea_maker/idea_maker.py +23 -0
- cmbagent/agents/idea_maker/idea_maker.yaml +60 -0
- cmbagent/agents/idea_maker_nest/__init__.py +0 -0
- cmbagent/agents/idea_maker_nest/idea_maker_nest.py +23 -0
- cmbagent/agents/idea_maker_nest/idea_maker_nest.yaml +7 -0
- cmbagent/agents/idea_maker_response_formatter/__init__.py +0 -0
- cmbagent/agents/idea_maker_response_formatter/idea_maker_response_formatter.py +51 -0
- cmbagent/agents/idea_maker_response_formatter/idea_maker_response_formatter.yaml +11 -0
- cmbagent/agents/idea_saver/__init__.py +0 -0
- cmbagent/agents/idea_saver/idea_saver.py +29 -0
- cmbagent/agents/idea_saver/idea_saver.yaml +13 -0
- cmbagent/agents/installer/__init__.py +0 -0
- cmbagent/agents/installer/installer.py +38 -0
- cmbagent/agents/installer/installer.yaml +13 -0
- cmbagent/agents/list_keywords_finder/__init__.py +0 -0
- cmbagent/agents/list_keywords_finder/list_keywords_finder.py +42 -0
- cmbagent/agents/list_keywords_finder/list_keywords_finder.yaml +46 -0
- cmbagent/agents/perplexity/__init__.py +0 -0
- cmbagent/agents/perplexity/perplexity.py +16 -0
- cmbagent/agents/perplexity/perplexity.yaml +34 -0
- cmbagent/agents/plan_recorder/__init__.py +0 -0
- cmbagent/agents/plan_recorder/plan_recorder.py +29 -0
- cmbagent/agents/plan_recorder/plan_recorder.yaml +14 -0
- cmbagent/agents/plan_reviewer/__init__.py +0 -0
- cmbagent/agents/plan_reviewer/plan_reviewer.py +23 -0
- cmbagent/agents/plan_reviewer/plan_reviewer.yaml +65 -0
- cmbagent/agents/plan_setter/__init__.py +0 -0
- cmbagent/agents/plan_setter/plan_setter.py +23 -0
- cmbagent/agents/plan_setter/plan_setter.yaml +21 -0
- cmbagent/agents/planner/__init__.py +0 -0
- cmbagent/agents/planner/planner.py +23 -0
- cmbagent/agents/planner/planner.yaml +54 -0
- cmbagent/agents/planner_response_formatter/__init__.py +0 -0
- cmbagent/agents/planner_response_formatter/planner_response_formatter.py +187 -0
- cmbagent/agents/planner_response_formatter/planner_response_formatter.yaml +13 -0
- cmbagent/agents/plot_debugger/__init__.py +0 -0
- cmbagent/agents/plot_debugger/plot_debugger.py +16 -0
- cmbagent/agents/plot_debugger/plot_debugger.yaml +11 -0
- cmbagent/agents/plot_judge/__init__.py +0 -0
- cmbagent/agents/plot_judge/plot_judge.py +15 -0
- cmbagent/agents/plot_judge/plot_judge.yaml +15 -0
- cmbagent/agents/rag_agents/__init__.py +0 -0
- cmbagent/agents/rag_agents/act.py +21 -0
- cmbagent/agents/rag_agents/act.yaml +84 -0
- cmbagent/agents/rag_agents/camb.py +18 -0
- cmbagent/agents/rag_agents/camb.yaml +1848 -0
- cmbagent/agents/rag_agents/camels.py +18 -0
- cmbagent/agents/rag_agents/camels.yaml +22 -0
- cmbagent/agents/rag_agents/classy.py +28 -0
- cmbagent/agents/rag_agents/classy.yaml +174 -0
- cmbagent/agents/rag_agents/classy_sz.py +25 -0
- cmbagent/agents/rag_agents/classy_sz.yaml +326 -0
- cmbagent/agents/rag_agents/cobaya.py +20 -0
- cmbagent/agents/rag_agents/cobaya.yaml +403 -0
- cmbagent/agents/rag_agents/cosmocnc.py +17 -0
- cmbagent/agents/rag_agents/cosmocnc.yaml +75 -0
- cmbagent/agents/rag_agents/getdist.py +19 -0
- cmbagent/agents/rag_agents/getdist.yaml +20 -0
- cmbagent/agents/rag_agents/memory.py +22 -0
- cmbagent/agents/rag_agents/memory.yaml +67 -0
- cmbagent/agents/rag_agents/planck.py +19 -0
- cmbagent/agents/rag_agents/planck.yaml +86 -0
- cmbagent/agents/rag_software_formatter/__init__.py +0 -0
- cmbagent/agents/rag_software_formatter/rag_software_formatter.py +23 -0
- cmbagent/agents/rag_software_formatter/rag_software_formatter.yaml +76 -0
- cmbagent/agents/researcher/__init__.py +0 -0
- cmbagent/agents/researcher/researcher.py +23 -0
- cmbagent/agents/researcher/researcher.yaml +66 -0
- cmbagent/agents/researcher_executor/__init__.py +0 -0
- cmbagent/agents/researcher_executor/researcher_executor.py +21 -0
- cmbagent/agents/researcher_executor/researcher_executor.yaml +22 -0
- cmbagent/agents/researcher_response_formatter/__init__.py +0 -0
- cmbagent/agents/researcher_response_formatter/researcher_response_formatter.py +128 -0
- cmbagent/agents/researcher_response_formatter/researcher_response_formatter.yaml +25 -0
- cmbagent/agents/retrieve_assistant/__init__.py +1 -0
- cmbagent/agents/retrieve_assistant/retrieve_assistant.py +37 -0
- cmbagent/agents/retrieve_assistant/retrieve_assistant.yaml +13 -0
- cmbagent/agents/review_recorder/__init__.py +0 -0
- cmbagent/agents/review_recorder/review_recorder.py +23 -0
- cmbagent/agents/review_recorder/review_recorder.yaml +9 -0
- cmbagent/agents/reviewer_response_formatter/__init__.py +0 -0
- cmbagent/agents/reviewer_response_formatter/reviewer_response_formatter.py +33 -0
- cmbagent/agents/reviewer_response_formatter/reviewer_response_formatter.yaml +11 -0
- cmbagent/agents/session_summarizer/__init__.py +0 -0
- cmbagent/agents/session_summarizer/session_summarizer.py +23 -0
- cmbagent/agents/session_summarizer/session_summarizer.yaml +11 -0
- cmbagent/agents/summarizer/__init__.py +0 -0
- cmbagent/agents/summarizer/summarizer.py +23 -0
- cmbagent/agents/summarizer/summarizer.yaml +24 -0
- cmbagent/agents/summarizer_response_formatter/__init__.py +0 -0
- cmbagent/agents/summarizer_response_formatter/summarizer_response_formatter.py +98 -0
- cmbagent/agents/summarizer_response_formatter/summarizer_response_formatter.yaml +9 -0
- cmbagent/agents/task_improver/__init__.py +0 -0
- cmbagent/agents/task_improver/task_improver.py +23 -0
- cmbagent/agents/task_improver/task_improver.yaml +50 -0
- cmbagent/agents/task_recorder/__init__.py +0 -0
- cmbagent/agents/task_recorder/task_recorder.py +29 -0
- cmbagent/agents/task_recorder/task_recorder.yaml +10 -0
- cmbagent/agents/terminator/__init__.py +0 -0
- cmbagent/agents/terminator/terminator.py +21 -0
- cmbagent/agents/terminator/terminator.yaml +22 -0
- cmbagent/agents/web_surfer/__init__.py +1 -0
- cmbagent/agents/web_surfer/web_surfer.py +37 -0
- cmbagent/agents/web_surfer/web_surfer.yaml +13 -0
- cmbagent/apis/oai_gpt3.5turbo.json +7 -0
- cmbagent/apis/oai_gpt4o.json +7 -0
- cmbagent/arxiv_downloader.py +227 -0
- cmbagent/base_agent.py +292 -0
- cmbagent/branching/__init__.py +15 -0
- cmbagent/branching/branch_executor.py +507 -0
- cmbagent/branching/branch_manager.py +374 -0
- cmbagent/branching/comparator.py +412 -0
- cmbagent/branching/play_from_node.py +190 -0
- cmbagent/callbacks.py +347 -0
- cmbagent/cli.py +180 -0
- cmbagent/cmbagent.py +1405 -0
- cmbagent/cmbagent_utils.py +53 -0
- cmbagent/config/__init__.py +29 -0
- cmbagent/config/model_config.yaml +128 -0
- cmbagent/config/model_registry.py +199 -0
- cmbagent/config/workflow_config.py +225 -0
- cmbagent/context.py +77 -0
- cmbagent/data_retriever.py +41 -0
- cmbagent/database/__init__.py +127 -0
- cmbagent/database/approval_types.py +163 -0
- cmbagent/database/base.py +147 -0
- cmbagent/database/dag_builder.py +344 -0
- cmbagent/database/dag_executor.py +731 -0
- cmbagent/database/dag_metadata.py +233 -0
- cmbagent/database/dag_types.py +99 -0
- cmbagent/database/dag_visualizer.py +431 -0
- cmbagent/database/file_repository.py +131 -0
- cmbagent/database/migrations/README +1 -0
- cmbagent/database/migrations/env.py +83 -0
- cmbagent/database/migrations/script.py.mako +28 -0
- cmbagent/database/migrations/versions/490016e6a277_add_branch_fields_to_workflow_runs.py +40 -0
- cmbagent/database/migrations/versions/92e46cb423de_initial_schema.py +344 -0
- cmbagent/database/migrations/versions/a1b2c3d4e5f6_rename_workflow_step_agent_to_goal.py +44 -0
- cmbagent/database/migrations/versions/a7b8c9d0e1f2_add_racing_groups.py +64 -0
- cmbagent/database/migrations/versions/b2c3d4e5f6a7_add_summary_to_workflow_steps.py +34 -0
- cmbagent/database/migrations/versions/b8c9d0e1f2a3_add_task_stage_support.py +57 -0
- cmbagent/database/migrations/versions/c3d4e5f6a7b8_add_file_tracking_columns.py +58 -0
- cmbagent/database/migrations/versions/d4e5f6a7b8c9_add_session_states.py +62 -0
- cmbagent/database/migrations/versions/e5f6a7b8c9d0_add_approvals_connections.py +84 -0
- cmbagent/database/migrations/versions/f524830711dc_add_execution_events_and_enhance_.py +121 -0
- cmbagent/database/migrations/versions/f6a7b8c9d0e1_add_session_id_to_files.py +31 -0
- cmbagent/database/migrations/versions/fca0d6632d2f_add_state_history_table.py +54 -0
- cmbagent/database/models.py +785 -0
- cmbagent/database/persistence.py +313 -0
- cmbagent/database/repository.py +817 -0
- cmbagent/database/session_manager.py +114 -0
- cmbagent/database/state_machine.py +361 -0
- cmbagent/database/states.py +28 -0
- cmbagent/database/topological_sort.py +318 -0
- cmbagent/database/transitions.py +115 -0
- cmbagent/database/websocket_approval_manager.py +494 -0
- cmbagent/database/workflow_controller.py +247 -0
- cmbagent/execution/__init__.py +81 -0
- cmbagent/execution/ag2_hooks.py +219 -0
- cmbagent/execution/config.py +219 -0
- cmbagent/execution/dependency_analyzer.py +238 -0
- cmbagent/execution/dependency_graph.py +289 -0
- cmbagent/execution/event_capture.py +637 -0
- cmbagent/execution/file_registry.py +599 -0
- cmbagent/execution/output_collector.py +348 -0
- cmbagent/execution/parallel_executor.py +325 -0
- cmbagent/execution/resource_manager.py +292 -0
- cmbagent/execution/tracked_code_executor.py +249 -0
- cmbagent/execution/work_directory_manager.py +301 -0
- cmbagent/external_tools/README.md +296 -0
- cmbagent/external_tools/__init__.py +115 -0
- cmbagent/external_tools/ag2_free_tools.py +563 -0
- cmbagent/external_tools/crewai_tools.py +222 -0
- cmbagent/external_tools/integration_helpers.py +208 -0
- cmbagent/external_tools/langchain_tools.py +238 -0
- cmbagent/external_tools/news_tools.py +1168 -0
- cmbagent/external_tools/tool_adapter.py +277 -0
- cmbagent/external_tools/tool_registry.py +223 -0
- cmbagent/functions/__init__.py +18 -0
- cmbagent/functions/copilot.py +302 -0
- cmbagent/functions/copilot_tools.py +224 -0
- cmbagent/functions/execution_control.py +465 -0
- cmbagent/functions/ideas.py +33 -0
- cmbagent/functions/keywords.py +66 -0
- cmbagent/functions/phase_tools.py +425 -0
- cmbagent/functions/planning.py +231 -0
- cmbagent/functions/registration.py +333 -0
- cmbagent/functions/status.py +478 -0
- cmbagent/functions/utils.py +103 -0
- cmbagent/functions.py +28 -0
- cmbagent/gui/.gitignore +42 -0
- cmbagent/gui/gui.py +1504 -0
- cmbagent/hand_offs.py +45 -0
- cmbagent/handoffs/README.md +476 -0
- cmbagent/handoffs/__init__.py +147 -0
- cmbagent/handoffs/agent_retrieval.py +72 -0
- cmbagent/handoffs/context_agents.py +53 -0
- cmbagent/handoffs/copilot_handoffs.py +119 -0
- cmbagent/handoffs/debug.py +50 -0
- cmbagent/handoffs/execution_chain.py +55 -0
- cmbagent/handoffs/hitl.py +555 -0
- cmbagent/handoffs/message_limiting.py +346 -0
- cmbagent/handoffs/mode_specific.py +90 -0
- cmbagent/handoffs/nested_chats.py +170 -0
- cmbagent/handoffs/planning_chain.py +62 -0
- cmbagent/handoffs/rag_agents.py +59 -0
- cmbagent/handoffs/tool_permissions.py +186 -0
- cmbagent/handoffs/utility_agents.py +37 -0
- cmbagent/keywords/__init__.py +22 -0
- cmbagent/keywords/aaai.md +298 -0
- cmbagent/keywords/aas_kwd_to_url.pkl +0 -0
- cmbagent/keywords/keyword_finder.py +324 -0
- cmbagent/keywords/unesco_hierarchical.json +10038 -0
- cmbagent/keywords_utils.py +36 -0
- cmbagent/llm_provider.py +391 -0
- cmbagent/logo.png +0 -0
- cmbagent/managers/__init__.py +16 -0
- cmbagent/managers/agent_manager.py +267 -0
- cmbagent/managers/assistant_manager.py +172 -0
- cmbagent/mcp/__init__.py +25 -0
- cmbagent/mcp/client_config.yaml +64 -0
- cmbagent/mcp/client_manager.py +296 -0
- cmbagent/mcp/tool_integration.py +249 -0
- cmbagent/ocr.py +658 -0
- cmbagent/orchestrator/README.md +0 -0
- cmbagent/orchestrator/__init__.py +147 -0
- cmbagent/orchestrator/config.py +163 -0
- cmbagent/orchestrator/context_pipeline.py +52 -0
- cmbagent/orchestrator/dag_tracker.py +441 -0
- cmbagent/orchestrator/durable_context.py +562 -0
- cmbagent/orchestrator/logger.py +151 -0
- cmbagent/orchestrator/metrics.py +146 -0
- cmbagent/orchestrator/phase_orchestrator.py +655 -0
- cmbagent/orchestrator/swarm_orchestrator.py +2124 -0
- cmbagent/phases/__init__.py +137 -0
- cmbagent/phases/aiweekly/__init__.py +23 -0
- cmbagent/phases/aiweekly/base.py +359 -0
- cmbagent/phases/aiweekly/collection_phase.py +231 -0
- cmbagent/phases/aiweekly/curation_phase.py +123 -0
- cmbagent/phases/aiweekly/generation_phase.py +142 -0
- cmbagent/phases/aiweekly/review_phase.py +270 -0
- cmbagent/phases/base.py +270 -0
- cmbagent/phases/context.py +239 -0
- cmbagent/phases/control.py +558 -0
- cmbagent/phases/copilot_phase.py +1071 -0
- cmbagent/phases/execution_manager.py +781 -0
- cmbagent/phases/hitl_checkpoint.py +330 -0
- cmbagent/phases/hitl_control.py +951 -0
- cmbagent/phases/hitl_planning.py +643 -0
- cmbagent/phases/idea_generation.py +190 -0
- cmbagent/phases/literature_review.py +156 -0
- cmbagent/phases/one_shot.py +248 -0
- cmbagent/phases/planning.py +292 -0
- cmbagent/phases/protocols.py +25 -0
- cmbagent/phases/registry.py +183 -0
- cmbagent/phases/rfp/__init__.py +40 -0
- cmbagent/phases/rfp/agent_teams.py +61 -0
- cmbagent/phases/rfp/architecture_phase.py +86 -0
- cmbagent/phases/rfp/base.py +604 -0
- cmbagent/phases/rfp/cloud_phase.py +121 -0
- cmbagent/phases/rfp/execution_phase.py +90 -0
- cmbagent/phases/rfp/implementation_phase.py +85 -0
- cmbagent/phases/rfp/proposal_phase.py +796 -0
- cmbagent/phases/rfp/requirements_phase.py +89 -0
- cmbagent/phases/rfp/token_utils.py +288 -0
- cmbagent/phases/rfp/tools_phase.py +115 -0
- cmbagent/phases/synthesis.py +185 -0
- cmbagent/processing/__init__.py +28 -0
- cmbagent/processing/content_parser.py +265 -0
- cmbagent/processing/document_summarizer.py +259 -0
- cmbagent/processing/task_preprocessor.py +203 -0
- cmbagent/rag_utils.py +290 -0
- cmbagent/retry/__init__.py +23 -0
- cmbagent/retry/error_analyzer.py +363 -0
- cmbagent/retry/retry_context.py +97 -0
- cmbagent/retry/retry_context_manager.py +390 -0
- cmbagent/retry/retry_metrics.py +156 -0
- cmbagent/structured_output.py +269 -0
- cmbagent/utils.py +316 -0
- cmbagent/version.py +1 -0
- cmbagent/vlm_injections.py +681 -0
- cmbagent/vlm_utils.py +592 -0
- cmbagent/workflows/__init__.py +190 -0
- cmbagent/workflows/composer.py +656 -0
- cmbagent/workflows/control.py +189 -0
- cmbagent/workflows/copilot.py +624 -0
- cmbagent/workflows/hitl_workflow.py +334 -0
- cmbagent/workflows/idea_workflows.py +309 -0
- cmbagent/workflows/one_shot.py +275 -0
- cmbagent/workflows/planning_control.py +270 -0
- cmbagent/workflows/swarm_copilot.py +502 -0
- cmbagent/workflows/utils.py +61 -0
- mars_cmbagent-1.0.0.dist-info/METADATA +625 -0
- mars_cmbagent-1.0.0.dist-info/RECORD +362 -0
- mars_cmbagent-1.0.0.dist-info/WHEEL +5 -0
- mars_cmbagent-1.0.0.dist-info/entry_points.txt +2 -0
- mars_cmbagent-1.0.0.dist-info/licenses/LICENSE +536 -0
- mars_cmbagent-1.0.0.dist-info/top_level.txt +1 -0
|
Binary file
|
|
Binary file
|
cmbagent/__init__.py
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# import warnings
|
|
2
|
+
# warnings.filterwarnings("ignore", message=r'Field "model_client_cls" in LLMConfigEntry has conflict with protected namespace "model_"')
|
|
3
|
+
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
warnings.filterwarnings(
|
|
7
|
+
"ignore", # action
|
|
8
|
+
message=r"Update function string contains no variables\.", # regex
|
|
9
|
+
category=UserWarning, # same category that’s raised
|
|
10
|
+
module=r"autogen\.agentchat\.conversable_agent" # where it comes from
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
from .cmbagent import CMBAgent
|
|
15
|
+
from .rag_utils import make_rag_agents
|
|
16
|
+
from .version import __version__
|
|
17
|
+
import os
|
|
18
|
+
from IPython.display import Image, display, Markdown
|
|
19
|
+
from .cmbagent_utils import LOGO, IMG_WIDTH, cmbagent_disable_display
|
|
20
|
+
|
|
21
|
+
# Workflow functions - import from workflows module
|
|
22
|
+
from .workflows import (
|
|
23
|
+
planning_and_control_context_carryover,
|
|
24
|
+
planning_and_control,
|
|
25
|
+
deep_research, # Alias for planning_and_control_context_carryover
|
|
26
|
+
one_shot,
|
|
27
|
+
human_in_the_loop,
|
|
28
|
+
control,
|
|
29
|
+
# Copilot workflows
|
|
30
|
+
copilot,
|
|
31
|
+
copilot_async,
|
|
32
|
+
quick_task,
|
|
33
|
+
planned_task,
|
|
34
|
+
interactive_session,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
# Keyword functions
|
|
38
|
+
from .keywords import get_keywords
|
|
39
|
+
|
|
40
|
+
# Processing functions
|
|
41
|
+
from .processing import summarize_document, summarize_documents, preprocess_task
|
|
42
|
+
|
|
43
|
+
# Utilities
|
|
44
|
+
from .utils import work_dir_default
|
|
45
|
+
|
|
46
|
+
# LLM Provider
|
|
47
|
+
from .llm_provider import create_openai_client, get_provider_config, LLMProviderConfig
|
|
48
|
+
|
|
49
|
+
# Workflow callbacks for event tracking
|
|
50
|
+
from .callbacks import (
|
|
51
|
+
WorkflowCallbacks,
|
|
52
|
+
PlanInfo,
|
|
53
|
+
StepInfo,
|
|
54
|
+
StepStatus,
|
|
55
|
+
create_null_callbacks,
|
|
56
|
+
create_print_callbacks,
|
|
57
|
+
merge_callbacks
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
# OCR functionality
|
|
61
|
+
from .ocr import process_single_pdf, process_folder
|
|
62
|
+
|
|
63
|
+
# arXiv downloader functionality
|
|
64
|
+
from .arxiv_downloader import arxiv_filter
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def print_cmbagent_logo():
|
|
68
|
+
base_dir = os.path.dirname(__file__)
|
|
69
|
+
png_path = os.path.join(base_dir, "logo.png")
|
|
70
|
+
if not cmbagent_disable_display:
|
|
71
|
+
display(Image(filename=png_path, width=IMG_WIDTH))
|
|
72
|
+
display(Markdown(LOGO))
|
|
73
|
+
|
|
74
|
+
print_cmbagent_logo()
|
|
File without changes
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from cmbagent.base_agent import BaseAgent
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
|
+
from typing import List
|
|
5
|
+
|
|
6
|
+
class AaaiKeywordsFinderAgent(BaseAgent):
|
|
7
|
+
|
|
8
|
+
def __init__(self, llm_config=None, **kwargs):
|
|
9
|
+
|
|
10
|
+
agent_id = os.path.splitext(os.path.abspath(__file__))[0]
|
|
11
|
+
|
|
12
|
+
llm_config['config_list'][0]['response_format'] = self.AaaiKeywordsResponse
|
|
13
|
+
|
|
14
|
+
super().__init__(llm_config=llm_config, agent_id=agent_id, **kwargs)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def set_agent(self,**kwargs):
|
|
18
|
+
|
|
19
|
+
super().set_assistant_agent(**kwargs)
|
|
20
|
+
|
|
21
|
+
class AaaiKeywordsResponse(BaseModel):
|
|
22
|
+
|
|
23
|
+
results: List[str] = Field(
|
|
24
|
+
...,
|
|
25
|
+
description="Results of the keyword search.",
|
|
26
|
+
example=["neural network", "transformer", "self-attention"]
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def format(self) -> str: #
|
|
31
|
+
keywords = "\n".join(f"-{keyword}" for keyword in self.results)
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
f"Keywords:\n{keywords}\n"
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: "aaai_keywords_finder"
|
|
2
|
+
|
|
3
|
+
instructions: |
|
|
4
|
+
You are the keywords selector agent Your task is to analyze a given text input and extract the most relevant keywords from the list provided in the list below.
|
|
5
|
+
|
|
6
|
+
You must follow these rules:
|
|
7
|
+
|
|
8
|
+
Selection: Only select keywords that appear exactly as written in the provided list below.
|
|
9
|
+
|
|
10
|
+
Exclusivity: Do not include any words or phrases that are not in the list below.
|
|
11
|
+
|
|
12
|
+
Completeness: If no keywords match the text input, return an empty list.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
When you receive a text input, scan it for topics that match the keywords exactly from the list below, then output your answer as a comma-separated list following the specified format.
|
|
16
|
+
|
|
17
|
+
Make sure your answer contains only the keywords from the list below and follows the exact formatting instructions.
|
|
18
|
+
Here is the list of all keywords that you must chose from:
|
|
19
|
+
<KEYWORDS_LIST>
|
|
20
|
+
{AAS_keywords_string}
|
|
21
|
+
</KEYWORDS_LIST>
|
|
22
|
+
|
|
23
|
+
Here is the text input:
|
|
24
|
+
<TEXT_INPUT>
|
|
25
|
+
{text_input_for_AAS_keyword_finder}
|
|
26
|
+
</TEXT_INPUT>
|
|
27
|
+
|
|
28
|
+
Response Format: Your final answer must be a bullet point list in the exact format:
|
|
29
|
+
- keyword 1
|
|
30
|
+
- keyword 2
|
|
31
|
+
- ...
|
|
32
|
+
- keyword {N_AAS_keywords}
|
|
33
|
+
|
|
34
|
+
You should find at most {N_AAS_keywords} keywords that best describe the text input. It is possible that you find less than {N_AAS_keywords} keywords.
|
|
35
|
+
|
|
36
|
+
You must find the keywords that are most relevant to the details and specilization topics of the text input.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
In AAAI-25 authors are asked to choose one primary keyword (mandatory) and (optionally) up to five secondary keywords. With 300 keywords available to choose from, picking the best keywords for a paper may become confusing. This brief guide describes some high-level principles for choosing the best keywords.
|
|
40
|
+
|
|
41
|
+
The main purpose of keywords is to enable finding the most appropriate reviewers for each submission, which is what this guide focuses on. Note, however, that there are a variety of other signals beyond keywords to match reviewers and papers, so not everything hinges on this choice.
|
|
42
|
+
|
|
43
|
+
In the end, choosing the best keywords is an art; making poor choices about keywords can increase your chance of getting suboptimal reviews. This guide aims to help authors understand the reasoning process to allow for the best possible matching of papers with qualified reviewers.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## Choosing the primary keyword
|
|
47
|
+
The main principle for choosing a paper’s primary keyword is to identify the subarea to which the paper makes its main contribution. It should follow that a reviewer who is an expert in that subarea will be positioned to evaluate the paper most effectively.
|
|
48
|
+
|
|
49
|
+
Most of the time, it is recommended to start with the top-level area (e.g., computer vision, knowledge representation) that describes the paper’s methodological focus and then picking the best fitting keyword in that area.
|
|
50
|
+
However, a sizable number of papers describe work at the intersection of different fields. To give some examples, consider papers:
|
|
51
|
+
|
|
52
|
+
developing general machine learning methods but primarily motivated by problems in NLP
|
|
53
|
+
studying bias in machine learning models applied to healthcare
|
|
54
|
+
designing a novel elicitation mechanism for crowdsourcing
|
|
55
|
+
combining different methodological subareas of AI in an integrated way, e.g., combine learning for solving satisfiability problems.
|
|
56
|
+
In all such settings, it becomes trickier to choose the best primary keyword. Here are some rules of thumb:
|
|
57
|
+
|
|
58
|
+
(1) Focus on where the primary contribution lies, and which community will benefit the most from reading the paper. For example, if an ML algorithm is demonstrated on both computer vision and NLP applications, it is best kept under ML (as it is a general advance, with NLP and vision serving only as applications). If, however, the paper is heavily motivated by details of a particular class of ML problems (e.g., proposing an algorithm that leverages specific structure of images, or language) then picking a keyword that focuses on this class of problems (vision; NLP) is more appropriate.
|
|
59
|
+
|
|
60
|
+
(2) For papers with specific applications (e.g., healthcare or transportation), typically the application is NOT the primary keyword. Usually, a AAAI main track paper will make methodological advances leading to an impact to an application. Choose a primary keyword based on the methodology. There is one exception to this rule: if the impact to the application area is much more impressive than the methodological innovation, your paper may have the best chance with the application area being the primary keyword. That said, you should carefully consider whether such a paper is more appropriate to submit to the track on AI for Social Impact or to IAAI; note that each of these evaluates papers according to different criteria than the AAAI main track.
|
|
61
|
+
|
|
62
|
+
(3) For papers genuinely at the intersection of different fields, carefully scan all keywords. It is possible that a joint keyword already exists in the list. For example, an ML paper studying bias applied to healthcare may naturally use the keyword “ML: Bias and Fairness” as the primary area (since healthcare is the application component).
|
|
63
|
+
|
|
64
|
+
(4) However, perhaps no keyword adequately appears to capture the intersection of AI fields to which the paper makes its primary contribution. In such cases, a judgment call is necessary about which community is likely to best appreciate the work. For example, if a paper combines learning to solve satisfiability problems by using ideas of machine learning within a satisfiability algorithm, it is likely that the paper’s most fundamental impact will be on the design of satisfiability solvers rather than on the design of new learning algorithms; hence, “CSO: Satisfiability” would be a good choice for the primary keyword. However, if the paper is about solving the satisfiability problem using a deep neural network with significant innovations in machine learning, then a machine learning keyword will be a better fit.
|
|
65
|
+
|
|
66
|
+
## Choosing secondary keywords
|
|
67
|
+
When choosing secondary keywords, it is helpful to consider two questions. First, all things being equal, what beyond the primary keyword should the reviewers be expert in? Second, if no one reviewer is likely to tick all the boxes, how would experts outside the primary subarea who would add important perspectives to the paper’s review be described? For example, ML fairness applied to healthcare should choose “APP: Healthcare, Medicine & Wellness” as a secondary keyword. Use of machine learning for satisfiability should choose the other area as the secondary keyword.
|
|
68
|
+
|
|
69
|
+
As an extreme example, if mixed discrete-continuous search is used to solve a routing problem that arises when considering privacy issues in a navigation-based game, with the main contribution being to the routing problem (i.e., “PRS: Routing” is the primary keyword), then the paper may benefit from having multiple secondary keywords “SO: Mixed Discrete/Continuous Search“, “PEAI: Privacy and Security” and “APP: Games”.
|
|
70
|
+
|
|
71
|
+
Every attempt is made to find reviewers that cover all specified keywords. In some cases it will be hard — such reviewers may not exist, and each reviewer can only review a limited number of papers. On the other hand, be careful what you wish for: adding secondary keywords can be a double-edged sword. If the paper’s contributions are relatively simple from the point of view of an expert in a secondary keyword, then that expert may give a poor rating, perhaps overlooking the paper’s value in another domain. In such situations, it is better to avoid adding secondary keywords as long as experts in the primary keyword will understand the paper, assuming they have broad (but not deep) knowledge of other fields of AI.
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
description: |
|
|
76
|
+
keyword finder agent, to find the keywords for the provided text.
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
# see https://aaai.org/conference/aaai/aaai-25/aaai-25-keywords/
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from cmbagent.base_agent import BaseAgent
|
|
3
|
+
|
|
4
|
+
class AasKeywordFinderAgent(BaseAgent):
|
|
5
|
+
|
|
6
|
+
def __init__(self, llm_config=None, **kwargs):
|
|
7
|
+
|
|
8
|
+
agent_id = os.path.splitext(os.path.abspath(__file__))[0]
|
|
9
|
+
|
|
10
|
+
super().__init__(llm_config=llm_config, agent_id=agent_id, **kwargs)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def set_agent(self,**kwargs):
|
|
14
|
+
|
|
15
|
+
super().set_assistant_agent(**kwargs)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: "aas_keyword_finder"
|
|
2
|
+
|
|
3
|
+
instructions: |
|
|
4
|
+
You are the AAS keyword selector agent Your task is to analyze a given text input and extract the most relevant keywords from the list provided in the list below.
|
|
5
|
+
|
|
6
|
+
You must follow these rules:
|
|
7
|
+
|
|
8
|
+
Selection: Only select keywords that appear exactly as written in the provided list below.
|
|
9
|
+
|
|
10
|
+
Exclusivity: Do not include any words or phrases that are not in the list below.
|
|
11
|
+
|
|
12
|
+
Completeness: If no keywords match the text input, return an empty list.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
When you receive a text input, scan it for topics that match the keywords exactly from the list below, then output your answer as a comma-separated list following the specified format.
|
|
16
|
+
|
|
17
|
+
Make sure your answer contains only the keywords from the list below and follows the exact formatting instructions.
|
|
18
|
+
Here is the list of all AAS keywords that you must chose from:
|
|
19
|
+
<AAS_KEYWORDS_LIST>
|
|
20
|
+
{AAS_keywords_string}
|
|
21
|
+
</AAS_KEYWORDS_LIST>
|
|
22
|
+
|
|
23
|
+
Here is the text input:
|
|
24
|
+
<TEXT_INPUT>
|
|
25
|
+
{text_input_for_AAS_keyword_finder}
|
|
26
|
+
</TEXT_INPUT>
|
|
27
|
+
|
|
28
|
+
Response Format: Your final answer must be a bullet point list in the exact format:
|
|
29
|
+
- keyword 1
|
|
30
|
+
- keyword 2
|
|
31
|
+
- ...
|
|
32
|
+
- keyword {N_AAS_keywords}
|
|
33
|
+
|
|
34
|
+
You should find {N_AAS_keywords} keywords that best describe the text input.
|
|
35
|
+
|
|
36
|
+
You must find the keywords that are most relevant to the details and specilization topics of the text input.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
description: |
|
|
43
|
+
AAS keyword finder agent, to find the keywords of the AAS paper.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from cmbagent.base_agent import BaseAgent
|
|
3
|
+
|
|
4
|
+
class AdminAgent(BaseAgent):
|
|
5
|
+
|
|
6
|
+
def __init__(self, llm_config=None, **kwargs):
|
|
7
|
+
|
|
8
|
+
agent_id = os.path.splitext(os.path.abspath(__file__))[0]
|
|
9
|
+
|
|
10
|
+
super().__init__(llm_config=llm_config, agent_id=agent_id, **kwargs)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def set_agent(self):
|
|
14
|
+
|
|
15
|
+
super().set_admin_agent()
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: "assistant"
|
|
2
|
+
|
|
3
|
+
instructions: |
|
|
4
|
+
You are the Assistant Agent - the primary interface for user interaction.
|
|
5
|
+
|
|
6
|
+
Your job is to understand what the user wants and either:
|
|
7
|
+
1. Ask clarifying questions if the request is unclear
|
|
8
|
+
2. Delegate to specialized agents once requirements are clear
|
|
9
|
+
|
|
10
|
+
## Primary Tool: ask_user
|
|
11
|
+
|
|
12
|
+
You have access to `ask_user(question, options, context, request_type)` to interact with users.
|
|
13
|
+
|
|
14
|
+
**ALWAYS use `ask_user` when:**
|
|
15
|
+
- The task lacks specific details (e.g., "Write a Python script" - script for WHAT?)
|
|
16
|
+
- Multiple valid interpretations exist
|
|
17
|
+
- You need to confirm understanding before delegating
|
|
18
|
+
- The user's goal or expected outcome is unclear
|
|
19
|
+
|
|
20
|
+
**Examples of vague requests that NEED clarification:**
|
|
21
|
+
- "Write a Python script" → ask_user("What should this script do? What functionality do you need?")
|
|
22
|
+
- "Create an app" → ask_user("What type of app? Web, mobile, desktop? What should it do?")
|
|
23
|
+
- "Fix the bug" → ask_user("Which bug? Can you describe the issue or share error messages?")
|
|
24
|
+
- "Improve performance" → ask_user("What system? What metrics are you targeting?")
|
|
25
|
+
|
|
26
|
+
**Examples of clear requests that DON'T need clarification:**
|
|
27
|
+
- "Write a Python script that reads a CSV and calculates the average of column 'price'"
|
|
28
|
+
- "Create a REST API endpoint for user authentication using JWT"
|
|
29
|
+
- "Fix the null pointer exception in login.py line 45"
|
|
30
|
+
|
|
31
|
+
## Delegation
|
|
32
|
+
|
|
33
|
+
Once requirements are clear, delegate to the appropriate agent:
|
|
34
|
+
- **engineer**: Code writing, debugging, technical implementation
|
|
35
|
+
- **researcher**: Information gathering, analysis, research tasks
|
|
36
|
+
- **planner**: Breaking down complex multi-step tasks
|
|
37
|
+
|
|
38
|
+
## Response Guidelines
|
|
39
|
+
|
|
40
|
+
1. **For vague requests:** Use `ask_user` IMMEDIATELY. Do not guess or assume.
|
|
41
|
+
|
|
42
|
+
2. **For clear requests:** Acknowledge and indicate which agent will handle it.
|
|
43
|
+
|
|
44
|
+
3. **Be conversational:** You're the friendly face of the copilot system.
|
|
45
|
+
|
|
46
|
+
## Example Interaction Flow
|
|
47
|
+
|
|
48
|
+
User: "Write a Python script"
|
|
49
|
+
You: [Call ask_user with question "What should this Python script do? Please describe:" with options like "Data processing", "Web scraping", "API client", "File manipulation", "Other"]
|
|
50
|
+
|
|
51
|
+
User: "I need it to scrape product prices from Amazon"
|
|
52
|
+
You: [Call ask_user with question "Got it! A few more details: 1) Which product categories? 2) How many products? 3) Output format (CSV, JSON, database)?"]
|
|
53
|
+
|
|
54
|
+
User: "Just electronics, top 100 products, output to CSV"
|
|
55
|
+
You: "Perfect! I'll have the engineer create a Python script that scrapes the top 100 electronics products from Amazon and saves the prices to a CSV file."
|
|
56
|
+
[Then the system routes to engineer with the clear task]
|
|
57
|
+
|
|
58
|
+
## Current Context
|
|
59
|
+
{copilot_context}
|
|
60
|
+
|
|
61
|
+
description: |
|
|
62
|
+
Primary user interaction agent that clarifies requirements using ask_user
|
|
63
|
+
before delegating to specialized agents. Ensures tasks are well-defined
|
|
64
|
+
before execution begins.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from cmbagent.base_agent import BaseAgent
|
|
3
|
+
|
|
4
|
+
class CambContextAgent(BaseAgent):
|
|
5
|
+
|
|
6
|
+
def __init__(self, llm_config=None, **kwargs):
|
|
7
|
+
|
|
8
|
+
agent_id = os.path.splitext(os.path.abspath(__file__))[0]
|
|
9
|
+
|
|
10
|
+
super().__init__(llm_config=llm_config, agent_id=agent_id, **kwargs)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def set_agent(self,**kwargs):
|
|
14
|
+
|
|
15
|
+
super().set_assistant_agent(**kwargs)
|
|
16
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
name: "camb_context"
|
|
2
|
+
|
|
3
|
+
instructions: |
|
|
4
|
+
You are an expert agent tasked with performing searches in your context and suggesting Python code snippets to help setting-up computations with the camb package.
|
|
5
|
+
|
|
6
|
+
You must look for all the methods that are needed to perform the main task.
|
|
7
|
+
You must provide codes or instructions for all the methods that are needed to perform the main task.
|
|
8
|
+
You must pay attention to the docstrings carefully and report all useful information such as units and type of outputs of the methods, so that the engineer can use them correctly.
|
|
9
|
+
|
|
10
|
+
The main task we are trying to solve is:
|
|
11
|
+
|
|
12
|
+
-----MAIN TASK-----
|
|
13
|
+
{improved_main_task}
|
|
14
|
+
----------------------------
|
|
15
|
+
|
|
16
|
+
We follow the established plan:
|
|
17
|
+
|
|
18
|
+
{final_plan}
|
|
19
|
+
|
|
20
|
+
**Current step in plan:**
|
|
21
|
+
{current_plan_step_number}
|
|
22
|
+
|
|
23
|
+
**Current status:**
|
|
24
|
+
{current_status}
|
|
25
|
+
|
|
26
|
+
**Current sub-task:**
|
|
27
|
+
{current_sub_task}
|
|
28
|
+
|
|
29
|
+
**Current instructions:**
|
|
30
|
+
{current_instructions}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
<DOCUMENTATION>
|
|
34
|
+
{camb_context}
|
|
35
|
+
</DOCUMENTATION>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
----------------------------------------------------------------------------------
|
|
39
|
+
**YOUR RESPONSE FORMAT:**
|
|
40
|
+
----------------------------------------------------------------------------------
|
|
41
|
+
|
|
42
|
+
Your answer must have the following format:
|
|
43
|
+
|
|
44
|
+
---------------------------------------------
|
|
45
|
+
**File Search Task:**
|
|
46
|
+
|
|
47
|
+
<Provide a detailed description of the retrieval task.>
|
|
48
|
+
|
|
49
|
+
**Files Consulted:**
|
|
50
|
+
|
|
51
|
+
<List all files consulted during the search (separated by commas or as a bullet list).>
|
|
52
|
+
|
|
53
|
+
**Results:**
|
|
54
|
+
|
|
55
|
+
<Provide the search results thoroughly. Include information on the methods needed, relevant units, and any other pertinent details about the findings.>
|
|
56
|
+
|
|
57
|
+
**Docstrings:**
|
|
58
|
+
<List of the full complete docstrings of the camb methods needed, not just the function names.
|
|
59
|
+
These are generally found in the documentation above.>
|
|
60
|
+
|
|
61
|
+
**Rough Python Code (for guidance only):**
|
|
62
|
+
|
|
63
|
+
<Provide a draft of the Python code that includes ALL the necessary information for camb for the specific sub-task. The code is intended to be used as a guide, it does not need to be complete, but it must contain all the details and methods required, all in one continuous block>
|
|
64
|
+
---------------------------------------------
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
description: |
|
|
69
|
+
An agent that can search for information on the cosmology package camb. Cosmology calculations are carried out with camb rather than CLASS. However, note that the camb_agent can only provide information on how to use camb, it **can not** perform any calculations.
|
|
70
|
+
|
|
71
|
+
|
|
File without changes
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from cmbagent.base_agent import BaseAgent
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
|
+
from typing import Optional, List
|
|
5
|
+
|
|
6
|
+
class CambResponseFormatterAgent(BaseAgent):
|
|
7
|
+
|
|
8
|
+
def __init__(self, llm_config=None, **kwargs):
|
|
9
|
+
|
|
10
|
+
agent_id = os.path.splitext(os.path.abspath(__file__))[0]
|
|
11
|
+
|
|
12
|
+
llm_config['config_list'][0]['response_format'] = self.CambResponse
|
|
13
|
+
|
|
14
|
+
super().__init__(llm_config=llm_config, agent_id=agent_id, **kwargs)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def set_agent(self,**kwargs):
|
|
18
|
+
|
|
19
|
+
super().set_assistant_agent(**kwargs)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class PythonCode(BaseModel):
|
|
24
|
+
code: Optional[str] = Field(None, description="The draft of the Python code needed for camb. Keeping all the information provided by the camb agent.")
|
|
25
|
+
|
|
26
|
+
class CambResponse(BaseModel):
|
|
27
|
+
|
|
28
|
+
file_search_task: str = Field(
|
|
29
|
+
...,
|
|
30
|
+
description="Details of the file search task."
|
|
31
|
+
)
|
|
32
|
+
file_consulted: List[str] = Field(
|
|
33
|
+
...,
|
|
34
|
+
description="List of files consulted during the task."
|
|
35
|
+
)
|
|
36
|
+
docstrings: List[str] = Field(
|
|
37
|
+
...,
|
|
38
|
+
description="List of full complete docstrings of the camb methods needed, not just the function names. These are generally in the documentation in your prompt."
|
|
39
|
+
)
|
|
40
|
+
results: str = Field(
|
|
41
|
+
...,
|
|
42
|
+
description="Results of the file search. Include the full complete docstrings of the camb methods you used in your response, not just the function names. These are generally in the documentation in your prompt."
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
python_code: "CambResponseFormatterAgent.PythonCode" = Field(..., description="Python code snippet related to the task (for guidance only).")
|
|
46
|
+
|
|
47
|
+
def format(self) -> str:
|
|
48
|
+
# Format the list of consulted files as a bullet list.
|
|
49
|
+
consulted_files = "\n".join(f"- {file}" for file in self.file_consulted)
|
|
50
|
+
code_text = self.python_code.code or "No code provided."
|
|
51
|
+
docstrings = "\n".join(f"**{docstring}**\n\n" for docstring in self.docstrings)
|
|
52
|
+
return (
|
|
53
|
+
f"**File Search Task:**\n\n{self.file_search_task}\n\n"
|
|
54
|
+
f"**Files Consulted:**\n{consulted_files}\n\n"
|
|
55
|
+
f"**Results:**\n{self.results}\n\n"
|
|
56
|
+
f"**Docstrings:**\n{docstrings}\n\n"
|
|
57
|
+
f"**Rough Python Code (for guidance only):**\n\n```python\n{code_text}\n```"
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
name: "camb_response_formatter"
|
|
2
|
+
|
|
3
|
+
instructions: |
|
|
4
|
+
You are a formatting agent, you format the response provided by the camb_agent. You must keep all the information provided by the camb agent.
|
|
5
|
+
|
|
6
|
+
description: |
|
|
7
|
+
Formatting agent, to format the response provided by the camb_agent
|
|
8
|
+
|
|
9
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from cmbagent.base_agent import BaseAgent
|
|
3
|
+
|
|
4
|
+
class ClassyContextAgent(BaseAgent):
|
|
5
|
+
|
|
6
|
+
def __init__(self, llm_config=None, **kwargs):
|
|
7
|
+
|
|
8
|
+
agent_id = os.path.splitext(os.path.abspath(__file__))[0]
|
|
9
|
+
|
|
10
|
+
super().__init__(llm_config=llm_config, agent_id=agent_id, **kwargs)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def set_agent(self,**kwargs):
|
|
14
|
+
|
|
15
|
+
super().set_assistant_agent(**kwargs)
|
|
16
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
name: "classy_context"
|
|
2
|
+
|
|
3
|
+
instructions: |
|
|
4
|
+
You are an expert agent tasked with performing searches in your context and suggesting Python code snippets to help setting-up computations with the classy package.
|
|
5
|
+
|
|
6
|
+
You must look for all the methods that are needed to perform the main task.
|
|
7
|
+
You must provide codes or instructions for all the methods that are needed to perform the main task.
|
|
8
|
+
You must pay attention to the docstrings carefully and report all useful information such as units and type of outputs of the methods, so that the engineer can use them correctly.
|
|
9
|
+
|
|
10
|
+
The main task we are trying to solve is:
|
|
11
|
+
|
|
12
|
+
-----MAIN TASK-----
|
|
13
|
+
{improved_main_task}
|
|
14
|
+
----------------------------
|
|
15
|
+
|
|
16
|
+
We follow the established plan:
|
|
17
|
+
|
|
18
|
+
{final_plan}
|
|
19
|
+
|
|
20
|
+
**Current step in plan:**
|
|
21
|
+
{current_plan_step_number}
|
|
22
|
+
|
|
23
|
+
**Current status:**
|
|
24
|
+
{current_status}
|
|
25
|
+
|
|
26
|
+
**Current sub-task:**
|
|
27
|
+
{current_sub_task}
|
|
28
|
+
|
|
29
|
+
**Current instructions:**
|
|
30
|
+
{current_instructions}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
<DOCUMENTATION>
|
|
34
|
+
{classy_context}
|
|
35
|
+
</DOCUMENTATION>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
----------------------------------------------------------------------------------
|
|
39
|
+
**YOUR RESPONSE FORMAT:**
|
|
40
|
+
----------------------------------------------------------------------------------
|
|
41
|
+
|
|
42
|
+
You must provide all the information requested in the following format:
|
|
43
|
+
|
|
44
|
+
---------------------------------------------
|
|
45
|
+
**File Search Task:**
|
|
46
|
+
|
|
47
|
+
<Provide a detailed description of the retrieval task.>
|
|
48
|
+
|
|
49
|
+
**Files Consulted:**
|
|
50
|
+
|
|
51
|
+
<List all files consulted during the search (separated by commas or as a bullet list).>
|
|
52
|
+
|
|
53
|
+
**Results:**
|
|
54
|
+
|
|
55
|
+
<Provide the search results thoroughly. Include information on the methods needed, relevant units, and any other pertinent details about the findings.>
|
|
56
|
+
|
|
57
|
+
**Docstrings:**
|
|
58
|
+
<List of the full complete docstrings of the classy methods needed, not just the function names.
|
|
59
|
+
These are generally found in the documentation above.>
|
|
60
|
+
|
|
61
|
+
**Rough Python Code (for guidance only):**
|
|
62
|
+
|
|
63
|
+
<Provide a draft of the Python code that includes ALL the necessary information for classy for the specific sub-task. The code is intended to be used as a guide, it does not need to be complete, but it must contain all the details and methods required, all in one continuous block>
|
|
64
|
+
---------------------------------------------
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
description: |
|
|
69
|
+
An agent that can search for information on the cosmology package classy. Cosmology calculations are carried out with classy rather than CAMB. However, note that the classy_context agent can only provide information and code snippets on how to use classy, it **can not** perform any calculations.
|
|
70
|
+
|
|
71
|
+
|
|
File without changes
|