fast-agent-mcp 0.2.45__tar.gz → 0.2.46__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.
Potentially problematic release.
This version of fast-agent-mcp might be problematic. Click here for more details.
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/PKG-INFO +2 -2
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/pyproject.toml +3 -2
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/__init__.py +40 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/cli/commands/go.py +25 -4
- fast_agent_mcp-0.2.46/src/mcp_agent/core/__init__.py +26 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/core/direct_decorators.py +114 -16
- fast_agent_mcp-0.2.46/src/mcp_agent/human_input/__init__.py +50 -0
- fast_agent_mcp-0.2.46/src/mcp_agent/human_input/form_fields.py +252 -0
- fast_agent_mcp-0.2.46/src/mcp_agent/human_input/simple_form.py +111 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/augmented_llm.py +11 -2
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/augmented_llm_playback.py +5 -3
- fast_agent_mcp-0.2.46/src/mcp_agent/mcp/__init__.py +50 -0
- fast_agent_mcp-0.2.46/src/mcp_agent/mcp/helpers/__init__.py +25 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/interfaces.py +13 -2
- fast_agent_mcp-0.2.45/src/mcp_agent/mcp/__init__.py +0 -0
- fast_agent_mcp-0.2.45/src/mcp_agent/mcp/helpers/__init__.py +0 -3
- fast_agent_mcp-0.2.45/src/mcp_agent/mcp/prompts/__init__.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/.gitignore +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/LICENSE +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/README.md +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/azure-openai/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/bedrock/fast-agent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/custom-agents/agent.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/custom-agents/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/data-analysis/analysis-campaign.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/data-analysis/analysis.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/data-analysis/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/data-analysis/mount-point/WA_Fn-UseC_-HR-Employee-Attrition.csv +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/elicitations/elicitation_account_server.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/elicitations/elicitation_forms_server.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/elicitations/elicitation_game_server.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/elicitations/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/elicitations/fastagent.secrets.yaml.example +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/elicitations/forms_demo.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/elicitations/game_character.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/elicitations/game_character_handler.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/elicitations/tool_call.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/mcp-filtering/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/mcp-filtering/fastagent.secrets.yaml.example +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/mcp-filtering/mcp_server.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/mcp-filtering/test_mcp_filtering.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/state-transfer/agent_one.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/state-transfer/agent_two.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/state-transfer/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/state-transfer/fastagent.secrets.yaml.example +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/vision-examples/cat.png +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/vision-examples/example1.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/vision-examples/example2.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/vision-examples/example3.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/mcp/vision-examples/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/otel/agent.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/otel/agent2.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/otel/docker-compose.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/otel/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/researcher/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/researcher/researcher-eval.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/researcher/researcher-imp.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/researcher/researcher.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/.env.sample +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/Makefile +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/README.md +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/agent.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/demo_images/clam.jpg +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/demo_images/crab.png +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/demo_images/shrimp.png +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/docker-compose.yml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/image_demo.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/mcp_server/Dockerfile +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/mcp_server/entrypoint.sh +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/mcp_server/mcp_server.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/simple_agent.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/tensorzero_config/system_schema.json +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/tensorzero_config/system_template.minijinja +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/tensorzero/tensorzero_config/tensorzero.toml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/workflows/chaining.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/workflows/evaluator.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/workflows/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/workflows/graded_report.md +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/workflows/human_input.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/workflows/orchestrator.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/workflows/parallel.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/workflows/router.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/workflows/short_story.md +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/examples/workflows/short_story.txt +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/hatch_build.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/agents/__init__.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/agents/agent.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/agents/base_agent.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/agents/workflow/__init__.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/agents/workflow/chain_agent.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/agents/workflow/evaluator_optimizer.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/agents/workflow/orchestrator_agent.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/agents/workflow/orchestrator_models.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/agents/workflow/orchestrator_prompts.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/agents/workflow/parallel_agent.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/agents/workflow/router_agent.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/app.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/cli/__init__.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/cli/__main__.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/cli/commands/check_config.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/cli/commands/quickstart.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/cli/commands/server_helpers.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/cli/commands/setup.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/cli/commands/url_parser.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/cli/constants.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/cli/main.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/cli/terminal.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/config.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/console.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/context.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/context_dependent.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/core/agent_app.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/core/agent_types.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/core/direct_factory.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/core/enhanced_prompt.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/core/error_handling.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/core/exceptions.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/core/fastagent.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/core/interactive_prompt.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/core/mcp_content.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/core/prompt.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/core/request_params.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/core/usage_display.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/core/validation.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/event_progress.py +0 -0
- {fast_agent_mcp-0.2.45/src/mcp_agent/core → fast_agent_mcp-0.2.46/src/mcp_agent/executor}/__init__.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/executor/executor.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/executor/task_registry.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/executor/workflow_signal.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/human_input/elicitation_form.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/human_input/elicitation_forms.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/human_input/elicitation_handler.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/human_input/elicitation_state.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/human_input/handler.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/human_input/types.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/__init__.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/augmented_llm_passthrough.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/augmented_llm_silent.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/augmented_llm_slow.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/memory.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/model_database.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/model_factory.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/prompt_utils.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/provider_key_manager.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/provider_types.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/__init__.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/anthropic_utils.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/augmented_llm_aliyun.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/augmented_llm_anthropic.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/augmented_llm_azure.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/augmented_llm_bedrock.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/augmented_llm_deepseek.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/augmented_llm_generic.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/augmented_llm_google_native.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/augmented_llm_google_oai.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/augmented_llm_openai.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/augmented_llm_openrouter.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/augmented_llm_tensorzero.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/augmented_llm_xai.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/google_converter.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/multipart_converter_anthropic.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/multipart_converter_openai.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/multipart_converter_tensorzero.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/openai_multipart.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/openai_utils.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/sampling_converter_anthropic.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/providers/sampling_converter_openai.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/sampling_converter.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/sampling_format_converter.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/llm/usage_tracking.py +0 -0
- {fast_agent_mcp-0.2.45/src/mcp_agent/executor → fast_agent_mcp-0.2.46/src/mcp_agent/logging}/__init__.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/logging/events.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/logging/json_serializer.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/logging/listeners.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/logging/logger.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/logging/rich_progress.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/logging/transport.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/common.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/elicitation_factory.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/elicitation_handlers.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/gen_client.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/helpers/content_helpers.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/helpers/server_config_helpers.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/hf_auth.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/logger_textio.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/mcp_agent_client_session.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/mcp_aggregator.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/mcp_connection_manager.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/mime_utils.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/prompt_message_multipart.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/prompt_render.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/prompt_serialization.py +0 -0
- {fast_agent_mcp-0.2.45/src/mcp_agent/human_input → fast_agent_mcp-0.2.46/src/mcp_agent/mcp/prompts}/__init__.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/prompts/__main__.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/prompts/prompt_constants.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/prompts/prompt_helpers.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/prompts/prompt_load.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/prompts/prompt_server.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/prompts/prompt_template.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/resource_utils.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp/sampling.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp_server/__init__.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp_server/agent_server.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/mcp_server_registry.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/progress_display.py +0 -0
- /fast_agent_mcp-0.2.45/src/mcp_agent/logging/__init__.py → /fast_agent_mcp-0.2.46/src/mcp_agent/py.typed +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/data-analysis/analysis-campaign.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/data-analysis/analysis.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/data-analysis/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/data-analysis/mount-point/WA_Fn-UseC_-HR-Employee-Attrition.csv +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/mcp/elicitations/elicitation_account_server.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/mcp/elicitations/elicitation_forms_server.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/mcp/elicitations/elicitation_game_server.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/mcp/elicitations/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/mcp/elicitations/fastagent.secrets.yaml.example +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/mcp/elicitations/forms_demo.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/mcp/elicitations/game_character.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/mcp/elicitations/game_character_handler.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/mcp/elicitations/tool_call.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/mcp/state-transfer/agent_one.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/mcp/state-transfer/agent_two.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/mcp/state-transfer/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/mcp/state-transfer/fastagent.secrets.yaml.example +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/researcher/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/researcher/researcher-eval.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/researcher/researcher-imp.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/researcher/researcher.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/workflows/chaining.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/workflows/evaluator.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/workflows/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/workflows/graded_report.md +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/workflows/human_input.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/workflows/orchestrator.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/workflows/parallel.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/workflows/router.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/workflows/short_story.md +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/resources/examples/workflows/short_story.txt +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/tools/tool_definition.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/ui/console_display.py +0 -0
- {fast_agent_mcp-0.2.45 → fast_agent_mcp-0.2.46}/src/mcp_agent/ui/console_display_legacy.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fast-agent-mcp
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.46
|
|
4
4
|
Summary: Define, Prompt and Test MCP enabled Agents and Workflows
|
|
5
5
|
Author-email: Shaun Smith <fastagent@llmindset.co.uk>
|
|
6
6
|
License: Apache License
|
|
@@ -218,7 +218,7 @@ Requires-Dist: deprecated>=1.2.18
|
|
|
218
218
|
Requires-Dist: email-validator>=2.2.0
|
|
219
219
|
Requires-Dist: fastapi>=0.115.6
|
|
220
220
|
Requires-Dist: google-genai
|
|
221
|
-
Requires-Dist: mcp==1.12.
|
|
221
|
+
Requires-Dist: mcp==1.12.1
|
|
222
222
|
Requires-Dist: openai>=1.93.0
|
|
223
223
|
Requires-Dist: opentelemetry-distro>=0.50b0
|
|
224
224
|
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.29.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "fast-agent-mcp"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.46"
|
|
4
4
|
description = "Define, Prompt and Test MCP enabled Agents and Workflows"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = { file = "LICENSE" }
|
|
@@ -15,7 +15,7 @@ classifiers = [
|
|
|
15
15
|
requires-python = ">=3.12"
|
|
16
16
|
dependencies = [
|
|
17
17
|
"fastapi>=0.115.6",
|
|
18
|
-
"mcp==1.12.
|
|
18
|
+
"mcp==1.12.1",
|
|
19
19
|
"opentelemetry-distro>=0.50b0",
|
|
20
20
|
"opentelemetry-exporter-otlp-proto-http>=1.29.0",
|
|
21
21
|
"pydantic-settings>=2.7.0",
|
|
@@ -75,6 +75,7 @@ include = [
|
|
|
75
75
|
"src/mcp_agent/**/*.csv",
|
|
76
76
|
"src/mcp_agent/**/*.txt",
|
|
77
77
|
"src/mcp_agent/**/*.example",
|
|
78
|
+
"src/mcp_agent/py.typed",
|
|
78
79
|
"examples/**/*",
|
|
79
80
|
]
|
|
80
81
|
|
|
@@ -31,9 +31,32 @@ from mcp_agent.core.direct_decorators import (
|
|
|
31
31
|
# FastAgent components
|
|
32
32
|
from mcp_agent.core.fastagent import FastAgent
|
|
33
33
|
|
|
34
|
+
# MCP content creation utilities
|
|
35
|
+
from mcp_agent.core.mcp_content import (
|
|
36
|
+
Assistant,
|
|
37
|
+
MCPFile,
|
|
38
|
+
MCPImage,
|
|
39
|
+
MCPPrompt,
|
|
40
|
+
MCPText,
|
|
41
|
+
User,
|
|
42
|
+
create_message,
|
|
43
|
+
)
|
|
44
|
+
|
|
34
45
|
# Request configuration
|
|
35
46
|
from mcp_agent.core.request_params import RequestParams
|
|
36
47
|
|
|
48
|
+
# MCP content helpers
|
|
49
|
+
from mcp_agent.mcp.helpers import (
|
|
50
|
+
get_image_data,
|
|
51
|
+
get_resource_text,
|
|
52
|
+
get_resource_uri,
|
|
53
|
+
get_text,
|
|
54
|
+
is_image_content,
|
|
55
|
+
is_resource_content,
|
|
56
|
+
is_resource_link,
|
|
57
|
+
is_text_content,
|
|
58
|
+
)
|
|
59
|
+
|
|
37
60
|
# Core protocol interfaces
|
|
38
61
|
from mcp_agent.mcp.interfaces import AgentProtocol, AugmentedLLMProtocol
|
|
39
62
|
from mcp_agent.mcp.mcp_aggregator import MCPAggregator
|
|
@@ -71,4 +94,21 @@ __all__ = [
|
|
|
71
94
|
"evaluator_optimizer",
|
|
72
95
|
# Request configuration
|
|
73
96
|
"RequestParams",
|
|
97
|
+
# MCP content helpers
|
|
98
|
+
"get_text",
|
|
99
|
+
"get_image_data",
|
|
100
|
+
"get_resource_uri",
|
|
101
|
+
"is_text_content",
|
|
102
|
+
"is_image_content",
|
|
103
|
+
"is_resource_content",
|
|
104
|
+
"is_resource_link",
|
|
105
|
+
"get_resource_text",
|
|
106
|
+
# MCP content creation utilities
|
|
107
|
+
"MCPText",
|
|
108
|
+
"MCPImage",
|
|
109
|
+
"MCPFile",
|
|
110
|
+
"MCPPrompt",
|
|
111
|
+
"User",
|
|
112
|
+
"Assistant",
|
|
113
|
+
"create_message",
|
|
74
114
|
]
|
|
@@ -259,8 +259,8 @@ def run_async_agent(
|
|
|
259
259
|
def go(
|
|
260
260
|
ctx: typer.Context,
|
|
261
261
|
name: str = typer.Option("FastAgent CLI", "--name", help="Name for the agent"),
|
|
262
|
-
instruction: str = typer.Option(
|
|
263
|
-
|
|
262
|
+
instruction: Optional[str] = typer.Option(
|
|
263
|
+
None, "--instruction", "-i", help="Path to file or URL containing instruction for the agent"
|
|
264
264
|
),
|
|
265
265
|
config_path: Optional[str] = typer.Option(
|
|
266
266
|
None, "--config-path", "-c", help="Path to config file"
|
|
@@ -297,7 +297,8 @@ def go(
|
|
|
297
297
|
Run an interactive agent directly from the command line.
|
|
298
298
|
|
|
299
299
|
Examples:
|
|
300
|
-
fast-agent go --model=haiku --instruction
|
|
300
|
+
fast-agent go --model=haiku --instruction=./instruction.md --servers=fetch,filesystem
|
|
301
|
+
fast-agent go --instruction=https://raw.githubusercontent.com/user/repo/prompt.md
|
|
301
302
|
fast-agent go --message="What is the weather today?" --model=haiku
|
|
302
303
|
fast-agent go --prompt-file=my-prompt.txt --model=haiku
|
|
303
304
|
fast-agent go --url=http://localhost:8001/mcp,http://api.example.com/sse
|
|
@@ -335,9 +336,29 @@ def go(
|
|
|
335
336
|
if stdio:
|
|
336
337
|
stdio_commands.append(stdio)
|
|
337
338
|
|
|
339
|
+
# Resolve instruction from file/URL or use default
|
|
340
|
+
resolved_instruction = "You are a helpful AI Agent." # Default
|
|
341
|
+
if instruction:
|
|
342
|
+
try:
|
|
343
|
+
from pathlib import Path
|
|
344
|
+
|
|
345
|
+
from pydantic import AnyUrl
|
|
346
|
+
|
|
347
|
+
from mcp_agent.core.direct_decorators import _resolve_instruction
|
|
348
|
+
|
|
349
|
+
# Check if it's a URL
|
|
350
|
+
if instruction.startswith(("http://", "https://")):
|
|
351
|
+
resolved_instruction = _resolve_instruction(AnyUrl(instruction))
|
|
352
|
+
else:
|
|
353
|
+
# Treat as file path
|
|
354
|
+
resolved_instruction = _resolve_instruction(Path(instruction))
|
|
355
|
+
except Exception as e:
|
|
356
|
+
typer.echo(f"Error loading instruction from {instruction}: {e}", err=True)
|
|
357
|
+
raise typer.Exit(1)
|
|
358
|
+
|
|
338
359
|
run_async_agent(
|
|
339
360
|
name=name,
|
|
340
|
-
instruction=
|
|
361
|
+
instruction=resolved_instruction,
|
|
341
362
|
config_path=config_path,
|
|
342
363
|
servers=servers,
|
|
343
364
|
urls=urls,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Core components and utilities for MCP Agent.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from .mcp_content import (
|
|
6
|
+
Assistant,
|
|
7
|
+
MCPContentType,
|
|
8
|
+
MCPFile,
|
|
9
|
+
MCPImage,
|
|
10
|
+
MCPPrompt,
|
|
11
|
+
MCPText,
|
|
12
|
+
User,
|
|
13
|
+
create_message,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
# MCP content creation functions
|
|
18
|
+
"MCPText",
|
|
19
|
+
"MCPImage",
|
|
20
|
+
"MCPFile",
|
|
21
|
+
"MCPPrompt",
|
|
22
|
+
"User",
|
|
23
|
+
"Assistant",
|
|
24
|
+
"create_message",
|
|
25
|
+
"MCPContentType",
|
|
26
|
+
]
|
|
@@ -6,6 +6,7 @@ for creating agents in the DirectFastAgent framework.
|
|
|
6
6
|
|
|
7
7
|
import inspect
|
|
8
8
|
from functools import wraps
|
|
9
|
+
from pathlib import Path
|
|
9
10
|
from typing import (
|
|
10
11
|
Awaitable,
|
|
11
12
|
Callable,
|
|
@@ -21,6 +22,7 @@ from typing import (
|
|
|
21
22
|
)
|
|
22
23
|
|
|
23
24
|
from mcp.client.session import ElicitationFnT
|
|
25
|
+
from pydantic import AnyUrl
|
|
24
26
|
|
|
25
27
|
from mcp_agent.agents.agent import AgentConfig
|
|
26
28
|
from mcp_agent.agents.workflow.router_agent import (
|
|
@@ -85,6 +87,91 @@ class DecoratedEvaluatorOptimizerProtocol(DecoratedAgentProtocol[P, R], Protocol
|
|
|
85
87
|
_evaluator: str
|
|
86
88
|
|
|
87
89
|
|
|
90
|
+
def _fetch_url_content(url: str) -> str:
|
|
91
|
+
"""
|
|
92
|
+
Fetch content from a URL.
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
url: The URL to fetch content from
|
|
96
|
+
|
|
97
|
+
Returns:
|
|
98
|
+
The text content from the URL
|
|
99
|
+
|
|
100
|
+
Raises:
|
|
101
|
+
requests.RequestException: If the URL cannot be fetched
|
|
102
|
+
UnicodeDecodeError: If the content cannot be decoded as UTF-8
|
|
103
|
+
"""
|
|
104
|
+
import requests
|
|
105
|
+
|
|
106
|
+
response = requests.get(url, timeout=10)
|
|
107
|
+
response.raise_for_status() # Raise exception for HTTP errors
|
|
108
|
+
return response.text
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def _apply_templates(text: str) -> str:
|
|
112
|
+
"""
|
|
113
|
+
Apply template substitutions to instruction text.
|
|
114
|
+
|
|
115
|
+
Supported templates:
|
|
116
|
+
{{currentDate}} - Current date in format "24 July 2025"
|
|
117
|
+
{{url:https://...}} - Content fetched from the specified URL
|
|
118
|
+
|
|
119
|
+
Args:
|
|
120
|
+
text: The text to process
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
Text with template substitutions applied
|
|
124
|
+
|
|
125
|
+
Raises:
|
|
126
|
+
requests.RequestException: If a URL in {{url:...}} cannot be fetched
|
|
127
|
+
UnicodeDecodeError: If URL content cannot be decoded as UTF-8
|
|
128
|
+
"""
|
|
129
|
+
import re
|
|
130
|
+
from datetime import datetime
|
|
131
|
+
|
|
132
|
+
# Apply {{currentDate}} template
|
|
133
|
+
current_date = datetime.now().strftime("%d %B %Y")
|
|
134
|
+
text = text.replace("{{currentDate}}", current_date)
|
|
135
|
+
|
|
136
|
+
# Apply {{url:...}} templates
|
|
137
|
+
url_pattern = re.compile(r"\{\{url:(https?://[^}]+)\}\}")
|
|
138
|
+
|
|
139
|
+
def replace_url(match):
|
|
140
|
+
url = match.group(1)
|
|
141
|
+
return _fetch_url_content(url)
|
|
142
|
+
|
|
143
|
+
text = url_pattern.sub(replace_url, text)
|
|
144
|
+
|
|
145
|
+
return text
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def _resolve_instruction(instruction: str | Path | AnyUrl) -> str:
|
|
149
|
+
"""
|
|
150
|
+
Resolve instruction from either a string, Path, or URL with template support.
|
|
151
|
+
|
|
152
|
+
Args:
|
|
153
|
+
instruction: Either a string instruction, Path to a file, or URL containing the instruction
|
|
154
|
+
|
|
155
|
+
Returns:
|
|
156
|
+
The resolved instruction string with templates applied
|
|
157
|
+
|
|
158
|
+
Raises:
|
|
159
|
+
FileNotFoundError: If the Path doesn't exist
|
|
160
|
+
PermissionError: If the Path can't be read
|
|
161
|
+
UnicodeDecodeError: If the file/URL content can't be decoded as UTF-8
|
|
162
|
+
requests.RequestException: If the URL cannot be fetched
|
|
163
|
+
"""
|
|
164
|
+
if isinstance(instruction, Path):
|
|
165
|
+
text = instruction.read_text(encoding="utf-8")
|
|
166
|
+
elif isinstance(instruction, AnyUrl):
|
|
167
|
+
text = _fetch_url_content(str(instruction))
|
|
168
|
+
else:
|
|
169
|
+
text = instruction
|
|
170
|
+
|
|
171
|
+
# Apply template substitutions
|
|
172
|
+
return _apply_templates(text)
|
|
173
|
+
|
|
174
|
+
|
|
88
175
|
def _decorator_impl(
|
|
89
176
|
self,
|
|
90
177
|
agent_type: AgentType,
|
|
@@ -183,9 +270,9 @@ def _decorator_impl(
|
|
|
183
270
|
def agent(
|
|
184
271
|
self,
|
|
185
272
|
name: str = "default",
|
|
186
|
-
instruction_or_kwarg: Optional[str] = None,
|
|
273
|
+
instruction_or_kwarg: Optional[str | Path | AnyUrl] = None,
|
|
187
274
|
*,
|
|
188
|
-
instruction: str = "You are a helpful agent.",
|
|
275
|
+
instruction: str | Path | AnyUrl = "You are a helpful agent.",
|
|
189
276
|
servers: List[str] = [],
|
|
190
277
|
tools: Optional[Dict[str, List[str]]] = None,
|
|
191
278
|
resources: Optional[Dict[str, List[str]]] = None,
|
|
@@ -220,7 +307,10 @@ def agent(
|
|
|
220
307
|
Returns:
|
|
221
308
|
A decorator that registers the agent with proper type annotations
|
|
222
309
|
"""
|
|
223
|
-
|
|
310
|
+
final_instruction_raw = (
|
|
311
|
+
instruction_or_kwarg if instruction_or_kwarg is not None else instruction
|
|
312
|
+
)
|
|
313
|
+
final_instruction = _resolve_instruction(final_instruction_raw)
|
|
224
314
|
|
|
225
315
|
return _decorator_impl(
|
|
226
316
|
self,
|
|
@@ -245,9 +335,9 @@ def custom(
|
|
|
245
335
|
self,
|
|
246
336
|
cls,
|
|
247
337
|
name: str = "default",
|
|
248
|
-
instruction_or_kwarg: Optional[str] = None,
|
|
338
|
+
instruction_or_kwarg: Optional[str | Path | AnyUrl] = None,
|
|
249
339
|
*,
|
|
250
|
-
instruction: str = "You are a helpful agent.",
|
|
340
|
+
instruction: str | Path | AnyUrl = "You are a helpful agent.",
|
|
251
341
|
servers: List[str] = [],
|
|
252
342
|
tools: Optional[Dict[str, List[str]]] = None,
|
|
253
343
|
resources: Optional[Dict[str, List[str]]] = None,
|
|
@@ -277,7 +367,10 @@ def custom(
|
|
|
277
367
|
Returns:
|
|
278
368
|
A decorator that registers the agent with proper type annotations
|
|
279
369
|
"""
|
|
280
|
-
|
|
370
|
+
final_instruction_raw = (
|
|
371
|
+
instruction_or_kwarg if instruction_or_kwarg is not None else instruction
|
|
372
|
+
)
|
|
373
|
+
final_instruction = _resolve_instruction(final_instruction_raw)
|
|
281
374
|
|
|
282
375
|
return _decorator_impl(
|
|
283
376
|
self,
|
|
@@ -311,7 +404,7 @@ def orchestrator(
|
|
|
311
404
|
name: str,
|
|
312
405
|
*,
|
|
313
406
|
agents: List[str],
|
|
314
|
-
instruction: str = DEFAULT_INSTRUCTION_ORCHESTRATOR,
|
|
407
|
+
instruction: str | Path | AnyUrl = DEFAULT_INSTRUCTION_ORCHESTRATOR,
|
|
315
408
|
model: Optional[str] = None,
|
|
316
409
|
request_params: RequestParams | None = None,
|
|
317
410
|
use_history: bool = False,
|
|
@@ -341,6 +434,7 @@ def orchestrator(
|
|
|
341
434
|
"""
|
|
342
435
|
|
|
343
436
|
# Create final request params with plan_iterations
|
|
437
|
+
resolved_instruction = _resolve_instruction(instruction)
|
|
344
438
|
|
|
345
439
|
return cast(
|
|
346
440
|
"Callable[[AgentCallable[P, R]], DecoratedOrchestratorProtocol[P, R]]",
|
|
@@ -348,7 +442,7 @@ def orchestrator(
|
|
|
348
442
|
self,
|
|
349
443
|
AgentType.ORCHESTRATOR,
|
|
350
444
|
name=name,
|
|
351
|
-
instruction=
|
|
445
|
+
instruction=resolved_instruction,
|
|
352
446
|
servers=[], # Orchestrators don't connect to servers directly
|
|
353
447
|
model=model,
|
|
354
448
|
use_history=use_history,
|
|
@@ -368,7 +462,7 @@ def router(
|
|
|
368
462
|
name: str,
|
|
369
463
|
*,
|
|
370
464
|
agents: List[str],
|
|
371
|
-
instruction: Optional[str] = None,
|
|
465
|
+
instruction: Optional[str | Path | AnyUrl] = None,
|
|
372
466
|
servers: List[str] = [],
|
|
373
467
|
tools: Optional[Dict[str, List[str]]] = None,
|
|
374
468
|
resources: Optional[Dict[str, List[str]]] = None,
|
|
@@ -400,6 +494,7 @@ def router(
|
|
|
400
494
|
Returns:
|
|
401
495
|
A decorator that registers the router with proper type annotations
|
|
402
496
|
"""
|
|
497
|
+
resolved_instruction = _resolve_instruction(instruction or ROUTING_SYSTEM_INSTRUCTION)
|
|
403
498
|
|
|
404
499
|
return cast(
|
|
405
500
|
"Callable[[AgentCallable[P, R]], DecoratedRouterProtocol[P, R]]",
|
|
@@ -407,7 +502,7 @@ def router(
|
|
|
407
502
|
self,
|
|
408
503
|
AgentType.ROUTER,
|
|
409
504
|
name=name,
|
|
410
|
-
instruction=
|
|
505
|
+
instruction=resolved_instruction,
|
|
411
506
|
servers=servers,
|
|
412
507
|
model=model,
|
|
413
508
|
use_history=use_history,
|
|
@@ -429,7 +524,7 @@ def chain(
|
|
|
429
524
|
name: str,
|
|
430
525
|
*,
|
|
431
526
|
sequence: List[str],
|
|
432
|
-
instruction: Optional[str] = None,
|
|
527
|
+
instruction: Optional[str | Path | AnyUrl] = None,
|
|
433
528
|
cumulative: bool = False,
|
|
434
529
|
default: bool = False,
|
|
435
530
|
) -> Callable[[AgentCallable[P, R]], DecoratedChainProtocol[P, R]]:
|
|
@@ -456,6 +551,7 @@ def chain(
|
|
|
456
551
|
You are a chain that processes requests through a series of specialized agents in sequence.
|
|
457
552
|
Pass the output of each agent to the next agent in the chain.
|
|
458
553
|
"""
|
|
554
|
+
resolved_instruction = _resolve_instruction(instruction or default_instruction)
|
|
459
555
|
|
|
460
556
|
return cast(
|
|
461
557
|
"Callable[[AgentCallable[P, R]], DecoratedChainProtocol[P, R]]",
|
|
@@ -463,7 +559,7 @@ def chain(
|
|
|
463
559
|
self,
|
|
464
560
|
AgentType.CHAIN,
|
|
465
561
|
name=name,
|
|
466
|
-
instruction=
|
|
562
|
+
instruction=resolved_instruction,
|
|
467
563
|
sequence=sequence,
|
|
468
564
|
cumulative=cumulative,
|
|
469
565
|
default=default,
|
|
@@ -477,7 +573,7 @@ def parallel(
|
|
|
477
573
|
*,
|
|
478
574
|
fan_out: List[str],
|
|
479
575
|
fan_in: str | None = None,
|
|
480
|
-
instruction: Optional[str] = None,
|
|
576
|
+
instruction: Optional[str | Path | AnyUrl] = None,
|
|
481
577
|
include_request: bool = True,
|
|
482
578
|
default: bool = False,
|
|
483
579
|
) -> Callable[[AgentCallable[P, R]], DecoratedParallelProtocol[P, R]]:
|
|
@@ -499,6 +595,7 @@ def parallel(
|
|
|
499
595
|
You are a parallel processor that executes multiple agents simultaneously
|
|
500
596
|
and aggregates their results.
|
|
501
597
|
"""
|
|
598
|
+
resolved_instruction = _resolve_instruction(instruction or default_instruction)
|
|
502
599
|
|
|
503
600
|
return cast(
|
|
504
601
|
"Callable[[AgentCallable[P, R]], DecoratedParallelProtocol[P, R]]",
|
|
@@ -506,7 +603,7 @@ def parallel(
|
|
|
506
603
|
self,
|
|
507
604
|
AgentType.PARALLEL,
|
|
508
605
|
name=name,
|
|
509
|
-
instruction=
|
|
606
|
+
instruction=resolved_instruction,
|
|
510
607
|
servers=[], # Parallel agents don't connect to servers directly
|
|
511
608
|
fan_in=fan_in,
|
|
512
609
|
fan_out=fan_out,
|
|
@@ -522,7 +619,7 @@ def evaluator_optimizer(
|
|
|
522
619
|
*,
|
|
523
620
|
generator: str,
|
|
524
621
|
evaluator: str,
|
|
525
|
-
instruction: Optional[str] = None,
|
|
622
|
+
instruction: Optional[str | Path | AnyUrl] = None,
|
|
526
623
|
min_rating: str = "GOOD",
|
|
527
624
|
max_refinements: int = 3,
|
|
528
625
|
default: bool = False,
|
|
@@ -547,6 +644,7 @@ def evaluator_optimizer(
|
|
|
547
644
|
evaluated for quality, and then refined based on specific feedback until
|
|
548
645
|
it reaches an acceptable quality standard.
|
|
549
646
|
"""
|
|
647
|
+
resolved_instruction = _resolve_instruction(instruction or default_instruction)
|
|
550
648
|
|
|
551
649
|
return cast(
|
|
552
650
|
"Callable[[AgentCallable[P, R]], DecoratedEvaluatorOptimizerProtocol[P, R]]",
|
|
@@ -554,7 +652,7 @@ def evaluator_optimizer(
|
|
|
554
652
|
self,
|
|
555
653
|
AgentType.EVALUATOR_OPTIMIZER,
|
|
556
654
|
name=name,
|
|
557
|
-
instruction=
|
|
655
|
+
instruction=resolved_instruction,
|
|
558
656
|
servers=[], # Evaluator-optimizer doesn't connect to servers directly
|
|
559
657
|
generator=generator,
|
|
560
658
|
evaluator=evaluator,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""Human input modules for forms and elicitation."""
|
|
2
|
+
|
|
3
|
+
# Export the simple form API
|
|
4
|
+
# Export field types and schema builder
|
|
5
|
+
from mcp_agent.human_input.form_fields import (
|
|
6
|
+
BooleanField,
|
|
7
|
+
EnumField,
|
|
8
|
+
FormSchema,
|
|
9
|
+
IntegerField,
|
|
10
|
+
NumberField,
|
|
11
|
+
# Field classes
|
|
12
|
+
StringField,
|
|
13
|
+
boolean,
|
|
14
|
+
choice,
|
|
15
|
+
date,
|
|
16
|
+
datetime,
|
|
17
|
+
email,
|
|
18
|
+
integer,
|
|
19
|
+
number,
|
|
20
|
+
# Convenience functions
|
|
21
|
+
string,
|
|
22
|
+
url,
|
|
23
|
+
)
|
|
24
|
+
from mcp_agent.human_input.simple_form import ask, ask_sync, form, form_sync
|
|
25
|
+
|
|
26
|
+
__all__ = [
|
|
27
|
+
# Form functions
|
|
28
|
+
"form",
|
|
29
|
+
"form_sync",
|
|
30
|
+
"ask",
|
|
31
|
+
"ask_sync",
|
|
32
|
+
# Schema builder
|
|
33
|
+
"FormSchema",
|
|
34
|
+
# Field classes
|
|
35
|
+
"StringField",
|
|
36
|
+
"IntegerField",
|
|
37
|
+
"NumberField",
|
|
38
|
+
"BooleanField",
|
|
39
|
+
"EnumField",
|
|
40
|
+
# Field convenience functions
|
|
41
|
+
"string",
|
|
42
|
+
"email",
|
|
43
|
+
"url",
|
|
44
|
+
"date",
|
|
45
|
+
"datetime",
|
|
46
|
+
"integer",
|
|
47
|
+
"number",
|
|
48
|
+
"boolean",
|
|
49
|
+
"choice",
|
|
50
|
+
]
|