fast-agent-mcp 0.2.21__tar.gz → 0.2.22__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.
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/.gitignore +5 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/PKG-INFO +9 -7
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/README.md +6 -5
- fast_agent_mcp-0.2.22/examples/tensorzero/README.md +55 -0
- fast_agent_mcp-0.2.22/examples/tensorzero/agent.py +36 -0
- fast_agent_mcp-0.2.22/examples/tensorzero/docker-compose.yml +104 -0
- fast_agent_mcp-0.2.22/examples/tensorzero/fastagent.config.yaml +18 -0
- fast_agent_mcp-0.2.22/examples/tensorzero/image_demo.py +67 -0
- fast_agent_mcp-0.2.22/examples/tensorzero/mcp_server/mcp_server.py +31 -0
- fast_agent_mcp-0.2.22/examples/tensorzero/simple_agent.py +25 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/pyproject.toml +4 -2
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/cli/commands/go.py +49 -11
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/config.py +13 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/core/request_params.py +6 -1
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/event_progress.py +1 -1
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/augmented_llm.py +3 -9
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/model_factory.py +8 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/provider_types.py +1 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/providers/augmented_llm_anthropic.py +1 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/providers/augmented_llm_openai.py +14 -1
- fast_agent_mcp-0.2.22/src/mcp_agent/llm/providers/augmented_llm_tensorzero.py +442 -0
- fast_agent_mcp-0.2.22/src/mcp_agent/llm/providers/multipart_converter_tensorzero.py +200 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/mcp_connection_manager.py +46 -4
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/LICENSE +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/data-analysis/analysis-campaign.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/data-analysis/analysis.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/data-analysis/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/data-analysis/mount-point/WA_Fn-UseC_-HR-Employee-Attrition.csv +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/mcp/state-transfer/agent_one.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/mcp/state-transfer/agent_two.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/mcp/state-transfer/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/mcp/vision-examples/example1.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/mcp/vision-examples/example2.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/mcp/vision-examples/example3.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/mcp/vision-examples/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/otel/agent.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/otel/agent2.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/otel/docker-compose.yaml +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/otel/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/researcher/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/researcher/researcher-eval.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/researcher/researcher-imp.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/researcher/researcher.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/workflows/chaining.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/workflows/evaluator.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/workflows/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/workflows/graded_report.md +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/workflows/human_input.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/workflows/orchestrator.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/workflows/parallel.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/workflows/router.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/workflows/short_story.md +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/examples/workflows/short_story.txt +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/__init__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/agents/__init__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/agents/agent.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/agents/base_agent.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/agents/workflow/__init__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/agents/workflow/chain_agent.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/agents/workflow/evaluator_optimizer.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/agents/workflow/orchestrator_agent.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/agents/workflow/orchestrator_models.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/agents/workflow/orchestrator_prompts.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/agents/workflow/parallel_agent.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/agents/workflow/router_agent.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/app.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/cli/__init__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/cli/__main__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/cli/commands/check_config.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/cli/commands/quickstart.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/cli/commands/setup.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/cli/main.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/cli/terminal.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/console.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/context.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/context_dependent.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/core/__init__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/core/agent_app.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/core/agent_types.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/core/direct_decorators.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/core/direct_factory.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/core/enhanced_prompt.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/core/error_handling.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/core/exceptions.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/core/fastagent.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/core/interactive_prompt.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/core/mcp_content.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/core/prompt.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/core/validation.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/executor/__init__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/executor/executor.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/executor/task_registry.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/executor/workflow_signal.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/human_input/__init__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/human_input/handler.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/human_input/types.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/__init__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/augmented_llm_passthrough.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/augmented_llm_playback.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/memory.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/prompt_utils.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/provider_key_manager.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/providers/__init__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/providers/anthropic_utils.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/providers/augmented_llm_deepseek.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/providers/augmented_llm_generic.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/providers/augmented_llm_google.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/providers/augmented_llm_openrouter.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/providers/multipart_converter_anthropic.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/providers/multipart_converter_openai.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/providers/openai_multipart.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/providers/openai_utils.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/providers/sampling_converter_anthropic.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/providers/sampling_converter_openai.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/sampling_converter.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/llm/sampling_format_converter.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/logging/__init__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/logging/events.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/logging/json_serializer.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/logging/listeners.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/logging/logger.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/logging/rich_progress.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/logging/transport.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/__init__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/gen_client.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/helpers/__init__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/helpers/content_helpers.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/interfaces.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/logger_textio.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/mcp_agent_client_session.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/mcp_aggregator.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/mime_utils.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/prompt_message_multipart.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/prompt_render.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/prompt_serialization.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/prompts/__init__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/prompts/__main__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/prompts/prompt_constants.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/prompts/prompt_helpers.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/prompts/prompt_load.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/prompts/prompt_server.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/prompts/prompt_template.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/resource_utils.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp/sampling.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp_server/__init__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp_server/agent_server.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/mcp_server_registry.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/progress_display.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/data-analysis/analysis-campaign.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/data-analysis/analysis.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/data-analysis/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/data-analysis/mount-point/WA_Fn-UseC_-HR-Employee-Attrition.csv +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/in_dev/agent_build.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/in_dev/css-LICENSE.txt +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/in_dev/slides.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/internal/agent.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/internal/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/internal/history_transfer.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/internal/job.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/internal/prompt_category.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/internal/prompt_sizing.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/internal/simple.txt +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/internal/sizer.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/internal/social.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/mcp/state-transfer/agent_one.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/mcp/state-transfer/agent_two.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/mcp/state-transfer/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/mcp/state-transfer/fastagent.secrets.yaml.example +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/prompting/__init__.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/prompting/agent.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/prompting/delimited_prompt.txt +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/prompting/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/prompting/image_server.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/prompting/prompt1.txt +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/prompting/work_with_image.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/researcher/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/researcher/researcher-eval.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/researcher/researcher-imp.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/researcher/researcher.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/workflows/chaining.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/workflows/evaluator.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/workflows/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/workflows/human_input.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/workflows/orchestrator.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/workflows/parallel.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/workflows/router.py +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/resources/examples/workflows/short_story.txt +0 -0
- {fast_agent_mcp-0.2.21 → fast_agent_mcp-0.2.22}/src/mcp_agent/ui/console_display.py +0 -0
@@ -182,6 +182,7 @@ fastagent.secrets.yaml
|
|
182
182
|
CLAUDE.md
|
183
183
|
example-outputs/
|
184
184
|
|
185
|
+
tests/integration/api/weather_location.txt
|
185
186
|
tests/integration/prompt-state/simple.txt
|
186
187
|
tests/integration/workflow/router/fastagent.jsonl
|
187
188
|
tests/e2e/smoke/weather_location.txt
|
@@ -195,3 +196,7 @@ tests/integration/prompt-state/multipart.json
|
|
195
196
|
tests/integration/prompt-state/history.json
|
196
197
|
!tests/integration/api/fastagent.secrets.yaml
|
197
198
|
fastagent.jsonl
|
199
|
+
|
200
|
+
# JetBrains IDEs
|
201
|
+
.idea/
|
202
|
+
tests/e2e/smoke/base/weather_location.txt
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fast-agent-mcp
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.22
|
4
4
|
Summary: Define, Prompt and Test MCP enabled Agents and Workflows
|
5
5
|
Author-email: Shaun Smith <fastagent@llmindset.co.uk>, Sarmad Qadri <sarmad@lastmileai.dev>
|
6
6
|
License: Apache License
|
@@ -213,7 +213,7 @@ Requires-Dist: a2a-types>=0.1.0
|
|
213
213
|
Requires-Dist: aiohttp>=3.11.13
|
214
214
|
Requires-Dist: anthropic>=0.49.0
|
215
215
|
Requires-Dist: fastapi>=0.115.6
|
216
|
-
Requires-Dist: mcp
|
216
|
+
Requires-Dist: mcp>=1.8.0
|
217
217
|
Requires-Dist: openai>=1.63.2
|
218
218
|
Requires-Dist: opentelemetry-distro>=0.50b0
|
219
219
|
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.29.0
|
@@ -224,6 +224,7 @@ Requires-Dist: pydantic-settings>=2.7.0
|
|
224
224
|
Requires-Dist: pydantic>=2.10.4
|
225
225
|
Requires-Dist: pyyaml>=6.0.2
|
226
226
|
Requires-Dist: rich>=13.9.4
|
227
|
+
Requires-Dist: tensorzero>=2025.4.7
|
227
228
|
Requires-Dist: typer>=0.15.1
|
228
229
|
Provides-Extra: dev
|
229
230
|
Requires-Dist: anthropic>=0.42.0; extra == 'dev'
|
@@ -260,6 +261,7 @@ The simple declarative syntax lets you concentrate on composing your Prompts and
|
|
260
261
|
`fast-agent` is multi-modal, supporting Images and PDFs for both Anthropic and OpenAI endpoints via Prompts, Resources and MCP Tool Call results. The inclusion of passthrough and playback LLMs enable rapid development and test of Python glue-code for your applications.
|
261
262
|
|
262
263
|
> [!IMPORTANT]
|
264
|
+
>
|
263
265
|
> `fast-agent` The fast-agent documentation repo is here: https://github.com/evalstate/fast-agent-docs. Please feel free to submit PRs for documentation, experience reports or other content you think others may find helpful. All help and feedback warmly received.
|
264
266
|
|
265
267
|
### Agent Application Development
|
@@ -277,12 +279,12 @@ Simple model selection makes testing Model <-> MCP Server interaction painless.
|
|
277
279
|
Start by installing the [uv package manager](https://docs.astral.sh/uv/) for Python. Then:
|
278
280
|
|
279
281
|
```bash
|
280
|
-
uv pip install fast-agent-mcp
|
282
|
+
uv pip install fast-agent-mcp # install fast-agent!
|
281
283
|
|
282
|
-
fast-agent setup
|
283
|
-
uv run agent.py
|
284
|
-
uv run agent.py --model=o3-mini.low
|
285
|
-
fast-agent quickstart workflow
|
284
|
+
uv run fast-agent setup # create an example agent and config files
|
285
|
+
uv run agent.py # run your first agent
|
286
|
+
uv run agent.py --model=o3-mini.low # specify a model
|
287
|
+
uv run fast-agent quickstart workflow # create "building effective agents" examples
|
286
288
|
```
|
287
289
|
|
288
290
|
Other quickstart examples include a Researcher Agent (with Evaluator-Optimizer workflow) and Data Analysis Agent (similar to the ChatGPT experience), demonstrating MCP Roots support.
|
@@ -19,6 +19,7 @@ The simple declarative syntax lets you concentrate on composing your Prompts and
|
|
19
19
|
`fast-agent` is multi-modal, supporting Images and PDFs for both Anthropic and OpenAI endpoints via Prompts, Resources and MCP Tool Call results. The inclusion of passthrough and playback LLMs enable rapid development and test of Python glue-code for your applications.
|
20
20
|
|
21
21
|
> [!IMPORTANT]
|
22
|
+
>
|
22
23
|
> `fast-agent` The fast-agent documentation repo is here: https://github.com/evalstate/fast-agent-docs. Please feel free to submit PRs for documentation, experience reports or other content you think others may find helpful. All help and feedback warmly received.
|
23
24
|
|
24
25
|
### Agent Application Development
|
@@ -36,12 +37,12 @@ Simple model selection makes testing Model <-> MCP Server interaction painless.
|
|
36
37
|
Start by installing the [uv package manager](https://docs.astral.sh/uv/) for Python. Then:
|
37
38
|
|
38
39
|
```bash
|
39
|
-
uv pip install fast-agent-mcp
|
40
|
+
uv pip install fast-agent-mcp # install fast-agent!
|
40
41
|
|
41
|
-
fast-agent setup
|
42
|
-
uv run agent.py
|
43
|
-
uv run agent.py --model=o3-mini.low
|
44
|
-
fast-agent quickstart workflow
|
42
|
+
uv run fast-agent setup # create an example agent and config files
|
43
|
+
uv run agent.py # run your first agent
|
44
|
+
uv run agent.py --model=o3-mini.low # specify a model
|
45
|
+
uv run fast-agent quickstart workflow # create "building effective agents" examples
|
45
46
|
```
|
46
47
|
|
47
48
|
Other quickstart examples include a Researcher Agent (with Evaluator-Optimizer workflow) and Data Analysis Agent (similar to the ChatGPT experience), demonstrating MCP Roots support.
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# About the tensorzero / fast-agent integration
|
2
|
+
|
3
|
+
[TensorZero](https://www.tensorzero.com/) is an open source project designed to help LLM application developers rapidly improve their inference calls. Its core features include:
|
4
|
+
|
5
|
+
- A uniform inference interface to all leading LLM platforms.
|
6
|
+
- The ability to dynamic route to different platforms and program failovers.
|
7
|
+
- Automated parameter tuning and training
|
8
|
+
- Advance templating features for your system prompts
|
9
|
+
- Organization of LLM inference data into a Clickhouse DB allowing for sophisticated downstream analytics
|
10
|
+
- A bunch of other good stuff is always in development
|
11
|
+
|
12
|
+
`tensorzero` is powerful heavy, so we provide here a quickstart example that combines the basic components of `fast-agent`, an MCP server, `tensorzero`, and other supporting services into a cohesive whole.
|
13
|
+
|
14
|
+
## Quickstart guide
|
15
|
+
|
16
|
+
- Build and activate the `uv` `fast-agent` environment
|
17
|
+
- Ensure that ports `3000`, `4000`, `8000`, `9000`, and `9001` are unallocated before running this demo.
|
18
|
+
- Run `cp .env.sample .env` and then drop in at least one of `OPENAI_API_KEY` or `ANTHROPIC_API_KEY`. Make sure the accounts are funded.
|
19
|
+
- `make up`
|
20
|
+
- `make agent`
|
21
|
+
|
22
|
+
The demo test's our implementation's ability to:
|
23
|
+
|
24
|
+
- Implement the T0 model gateway as an inference backend
|
25
|
+
- Implement T0's dynamic templating feature
|
26
|
+
- Have in-conversation memory
|
27
|
+
- Describe and execute tool calls
|
28
|
+
- Remember previous tool calls
|
29
|
+
|
30
|
+
A version of a conversation to test all of this could be:
|
31
|
+
|
32
|
+
```
|
33
|
+
Hi.
|
34
|
+
|
35
|
+
Tell me a poem.
|
36
|
+
|
37
|
+
Do you have any tools that you can use?
|
38
|
+
|
39
|
+
Please demonstrate the use of that tool on your last response.
|
40
|
+
|
41
|
+
Please summarize the conversation so far.
|
42
|
+
|
43
|
+
What tool calls have you executed in this session, and what were their results?
|
44
|
+
```
|
45
|
+
|
46
|
+
## Multimodal support
|
47
|
+
|
48
|
+
Run `make image-test` to test the gateway's ability to handle base64-encoded image data
|
49
|
+
|
50
|
+
## Development notes:
|
51
|
+
|
52
|
+
- `make stop` will stop the MCP server and the tensorzero server
|
53
|
+
- `make tenzorzero-logs` will tail the tensorzero server logs
|
54
|
+
- `make mcp-logs` will tail the MCP server logs
|
55
|
+
- Generic `make logs` dumps all log output from all services to terminal
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import asyncio
|
2
|
+
|
3
|
+
from mcp_agent.core.fastagent import FastAgent
|
4
|
+
from mcp_agent.core.request_params import RequestParams
|
5
|
+
|
6
|
+
# Explicitly provide the path to the config file in the current directory
|
7
|
+
CONFIG_FILE = "fastagent.config.yaml"
|
8
|
+
fast = FastAgent("fast-agent example", config_path=CONFIG_FILE, ignore_unknown_args=True)
|
9
|
+
|
10
|
+
# Define T0 system variables here
|
11
|
+
my_t0_system_vars = {
|
12
|
+
"TEST_VARIABLE_1": "Roses are red",
|
13
|
+
"TEST_VARIABLE_2": "Violets are blue",
|
14
|
+
"TEST_VARIABLE_3": "Sugar is sweet",
|
15
|
+
"TEST_VARIABLE_4": "Vibe code responsibly 👍",
|
16
|
+
}
|
17
|
+
|
18
|
+
|
19
|
+
@fast.agent(
|
20
|
+
name="default",
|
21
|
+
instruction="""
|
22
|
+
You are an agent dedicated to helping developers understand the relationship between TensoZero and fast-agent. If the user makes a request
|
23
|
+
that requires you to invoke the test tools, please do so. When you use the tool, describe your rationale for doing so.
|
24
|
+
""",
|
25
|
+
servers=["tester"],
|
26
|
+
request_params=RequestParams(template_vars=my_t0_system_vars),
|
27
|
+
)
|
28
|
+
async def main():
|
29
|
+
async with fast.run() as agent_app: # Get the AgentApp wrapper
|
30
|
+
agent_name = "default"
|
31
|
+
print("\nStarting interactive session with template_vars set via decorator...")
|
32
|
+
await agent_app.interactive(agent=agent_name)
|
33
|
+
|
34
|
+
|
35
|
+
if __name__ == "__main__":
|
36
|
+
asyncio.run(main()) # type: ignore
|
@@ -0,0 +1,104 @@
|
|
1
|
+
# This is a simplified example for learning purposes. Do not use this in production.
|
2
|
+
# For production-ready deployments, see: https://www.tensorzero.com/docs/gateway/deployment
|
3
|
+
|
4
|
+
# Top-level volumes definition
|
5
|
+
volumes:
|
6
|
+
minio_data: {}
|
7
|
+
|
8
|
+
services:
|
9
|
+
clickhouse:
|
10
|
+
image: clickhouse/clickhouse-server:24.12-alpine
|
11
|
+
environment:
|
12
|
+
CLICKHOUSE_USER: chuser
|
13
|
+
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
|
14
|
+
CLICKHOUSE_PASSWORD: chpassword
|
15
|
+
ports:
|
16
|
+
- "8123:8123"
|
17
|
+
healthcheck:
|
18
|
+
test: wget --spider --tries 1 http://chuser:chpassword@clickhouse:8123/ping
|
19
|
+
start_period: 30s
|
20
|
+
start_interval: 1s
|
21
|
+
timeout: 1s
|
22
|
+
|
23
|
+
gateway:
|
24
|
+
image: tensorzero/gateway
|
25
|
+
volumes:
|
26
|
+
- ./tensorzero_config:/app/config:ro
|
27
|
+
env_file:
|
28
|
+
- ./.env
|
29
|
+
command: --config-file /app/config/tensorzero.toml
|
30
|
+
environment: # WARNING: Insecure default credentials for local testing ONLY. Don't send this to production.
|
31
|
+
TENSORZERO_CLICKHOUSE_URL: http://chuser:chpassword@clickhouse:8123/tensorzero
|
32
|
+
S3_ACCESS_KEY_ID: user
|
33
|
+
S3_SECRET_ACCESS_KEY: password
|
34
|
+
ports:
|
35
|
+
- "3000:3000"
|
36
|
+
extra_hosts:
|
37
|
+
- "host.docker.internal:host-gateway"
|
38
|
+
depends_on:
|
39
|
+
clickhouse:
|
40
|
+
condition: service_healthy
|
41
|
+
minio:
|
42
|
+
condition: service_healthy
|
43
|
+
mcp-server:
|
44
|
+
condition: service_healthy
|
45
|
+
|
46
|
+
gateway-ui:
|
47
|
+
image: tensorzero/ui
|
48
|
+
volumes:
|
49
|
+
- ./tensorzero_config:/app/config:ro
|
50
|
+
env_file:
|
51
|
+
- ./.env
|
52
|
+
command: --config-file /app/config/tensorzero.toml
|
53
|
+
environment:
|
54
|
+
TENSORZERO_CLICKHOUSE_URL: http://chuser:chpassword@clickhouse:8123/tensorzero
|
55
|
+
TENSORZERO_GATEWAY_URL: http://gateway:3000
|
56
|
+
S3_ACCESS_KEY_ID: user
|
57
|
+
S3_SECRET_ACCESS_KEY: password
|
58
|
+
ports:
|
59
|
+
- "4000:4000"
|
60
|
+
depends_on:
|
61
|
+
clickhouse:
|
62
|
+
condition: service_healthy
|
63
|
+
|
64
|
+
mcp-server:
|
65
|
+
build:
|
66
|
+
context: ../..
|
67
|
+
dockerfile: examples/tensorzero/mcp_server/Dockerfile
|
68
|
+
volumes:
|
69
|
+
- ./mcp_server:/app
|
70
|
+
ports:
|
71
|
+
- "8000:8000"
|
72
|
+
depends_on:
|
73
|
+
minio:
|
74
|
+
condition: service_healthy
|
75
|
+
healthcheck:
|
76
|
+
test:
|
77
|
+
[
|
78
|
+
"CMD",
|
79
|
+
"wget",
|
80
|
+
"--spider",
|
81
|
+
"--tries=1",
|
82
|
+
"http://localhost:8000/t0-example-server/sse",
|
83
|
+
]
|
84
|
+
interval: 10s
|
85
|
+
timeout: 5s
|
86
|
+
retries: 12
|
87
|
+
start_period: 20s
|
88
|
+
|
89
|
+
minio:
|
90
|
+
image: minio/minio:latest
|
91
|
+
ports:
|
92
|
+
- "9000:9000" # API port
|
93
|
+
- "9001:9001" # Console port
|
94
|
+
volumes:
|
95
|
+
- minio_data:/data
|
96
|
+
environment: # WARNING: Insecure default credentials for local testing ONLY.
|
97
|
+
MINIO_ROOT_USER: user
|
98
|
+
MINIO_ROOT_PASSWORD: password
|
99
|
+
command: server /data --console-address :9001
|
100
|
+
healthcheck:
|
101
|
+
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
102
|
+
interval: 30s
|
103
|
+
timeout: 20s
|
104
|
+
retries: 3
|
@@ -0,0 +1,18 @@
|
|
1
|
+
default_model: haiku
|
2
|
+
|
3
|
+
tensorzero:
|
4
|
+
base_url: http://localhost:3000
|
5
|
+
|
6
|
+
logger:
|
7
|
+
level: "info"
|
8
|
+
progress_display: true
|
9
|
+
show_chat: true
|
10
|
+
show_tools: true
|
11
|
+
truncate_tools: true
|
12
|
+
|
13
|
+
mcp:
|
14
|
+
servers:
|
15
|
+
tester:
|
16
|
+
transport: "sse"
|
17
|
+
url: "http://localhost:8000/t0-example-server/sse"
|
18
|
+
read_transport_sse_timeout_seconds: 300
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import asyncio
|
2
|
+
import base64
|
3
|
+
import mimetypes
|
4
|
+
from pathlib import Path
|
5
|
+
from typing import List, Union
|
6
|
+
|
7
|
+
from mcp.types import ImageContent, TextContent
|
8
|
+
|
9
|
+
from mcp_agent.core.fastagent import FastAgent
|
10
|
+
from mcp_agent.core.prompt import Prompt
|
11
|
+
from mcp_agent.core.request_params import RequestParams
|
12
|
+
|
13
|
+
AGENT_NAME = "tensorzero_image_tester"
|
14
|
+
TENSORZERO_MODEL = "tensorzero.test_chat"
|
15
|
+
TEXT_PROMPT = (
|
16
|
+
"Provide a description of the similarities and differences between these three images."
|
17
|
+
)
|
18
|
+
LOCAL_IMAGE_FILES = [
|
19
|
+
Path("./demo_images/clam.jpg"),
|
20
|
+
Path("./demo_images/shrimp.png"),
|
21
|
+
Path("./demo_images/crab.png"),
|
22
|
+
]
|
23
|
+
|
24
|
+
MY_T0_SYSTEM_VARS = {
|
25
|
+
"TEST_VARIABLE_1": "Roses are red",
|
26
|
+
"TEST_VARIABLE_2": "Violets are blue",
|
27
|
+
"TEST_VARIABLE_3": "Sugar is sweet",
|
28
|
+
"TEST_VARIABLE_4": "Vibe code responsibly 👍",
|
29
|
+
}
|
30
|
+
|
31
|
+
fast = FastAgent("TensorZero Image Demo - Base64 Only")
|
32
|
+
|
33
|
+
|
34
|
+
@fast.agent(
|
35
|
+
name=AGENT_NAME,
|
36
|
+
model=TENSORZERO_MODEL,
|
37
|
+
request_params=RequestParams(template_vars=MY_T0_SYSTEM_VARS),
|
38
|
+
)
|
39
|
+
async def main():
|
40
|
+
content_parts: List[Union[TextContent, ImageContent]] = []
|
41
|
+
content_parts.append(TextContent(type="text", text=TEXT_PROMPT))
|
42
|
+
|
43
|
+
for file_path in LOCAL_IMAGE_FILES:
|
44
|
+
mime_type, _ = mimetypes.guess_type(file_path)
|
45
|
+
if not mime_type or not mime_type.startswith("image/"):
|
46
|
+
ext = file_path.suffix.lower()
|
47
|
+
if ext == ".jpg" or ext == ".jpeg":
|
48
|
+
mime_type = "image/jpeg"
|
49
|
+
elif ext == ".png":
|
50
|
+
mime_type = "image/png"
|
51
|
+
if mime_type is None:
|
52
|
+
mime_type = "image/png" # Default fallback if still None
|
53
|
+
|
54
|
+
with open(file_path, "rb") as image_file:
|
55
|
+
image_bytes = image_file.read()
|
56
|
+
|
57
|
+
encoded_data = base64.b64encode(image_bytes).decode("utf-8")
|
58
|
+
content_parts.append(ImageContent(type="image", mimeType=mime_type, data=encoded_data))
|
59
|
+
|
60
|
+
message = Prompt.user(*content_parts)
|
61
|
+
async with fast.run() as agent_app:
|
62
|
+
agent = getattr(agent_app, AGENT_NAME)
|
63
|
+
await agent.send(message)
|
64
|
+
|
65
|
+
|
66
|
+
if __name__ == "__main__":
|
67
|
+
asyncio.run(main()) # type: ignore
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import uvicorn
|
2
|
+
from mcp.server.fastmcp.server import FastMCP
|
3
|
+
from starlette.applications import Starlette
|
4
|
+
from starlette.routing import Mount
|
5
|
+
|
6
|
+
SERVER_PATH = "t0-example-server"
|
7
|
+
|
8
|
+
|
9
|
+
mcp_instance = FastMCP(name="t0-example-server")
|
10
|
+
mcp_instance.settings.message_path = f"/{SERVER_PATH}/messages/"
|
11
|
+
mcp_instance.settings.sse_path = f"/{SERVER_PATH}/sse"
|
12
|
+
|
13
|
+
|
14
|
+
@mcp_instance.tool()
|
15
|
+
def example_tool(input_text: str) -> str:
|
16
|
+
"""Example tool that reverses the text of a given string."""
|
17
|
+
reversed_text = input_text[::-1]
|
18
|
+
return reversed_text
|
19
|
+
|
20
|
+
|
21
|
+
app = Starlette(
|
22
|
+
routes=[
|
23
|
+
Mount("/", app=mcp_instance.sse_app()),
|
24
|
+
]
|
25
|
+
)
|
26
|
+
|
27
|
+
if __name__ == "__main__":
|
28
|
+
print(f"Starting minimal MCP server ({mcp_instance.name}) on http://127.0.0.1:8000")
|
29
|
+
print(f" -> SSE endpoint: {mcp_instance.settings.sse_path}")
|
30
|
+
print(f" -> Message endpoint: {mcp_instance.settings.message_path}")
|
31
|
+
uvicorn.run(app, host="127.0.0.1", port=8000)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import asyncio
|
2
|
+
|
3
|
+
from mcp_agent.core.fastagent import FastAgent
|
4
|
+
|
5
|
+
CONFIG_FILE = "fastagent.config.yaml"
|
6
|
+
fast = FastAgent("fast-agent example", config_path=CONFIG_FILE, ignore_unknown_args=True)
|
7
|
+
|
8
|
+
|
9
|
+
@fast.agent(
|
10
|
+
name="default",
|
11
|
+
instruction="""
|
12
|
+
You are an agent dedicated to helping developers understand the relationship between TensoZero and fast-agent. If the user makes a request
|
13
|
+
that requires you to invoke the test tools, please do so. When you use the tool, describe your rationale for doing so.
|
14
|
+
""",
|
15
|
+
servers=["tester"],
|
16
|
+
)
|
17
|
+
async def main():
|
18
|
+
async with fast.run() as agent_app:
|
19
|
+
agent_name = "default"
|
20
|
+
print("\nStarting interactive session with template_vars set via decorator...")
|
21
|
+
await agent_app.interactive(agent=agent_name)
|
22
|
+
|
23
|
+
|
24
|
+
if __name__ == "__main__":
|
25
|
+
asyncio.run(main()) # type: ignore
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "fast-agent-mcp"
|
3
|
-
version = "0.2.
|
3
|
+
version = "0.2.22"
|
4
4
|
description = "Define, Prompt and Test MCP enabled Agents and Workflows"
|
5
5
|
readme = "README.md"
|
6
6
|
license = { file = "LICENSE" }
|
@@ -16,7 +16,7 @@ classifiers = [
|
|
16
16
|
requires-python = ">=3.10"
|
17
17
|
dependencies = [
|
18
18
|
"fastapi>=0.115.6",
|
19
|
-
"mcp
|
19
|
+
"mcp>=1.8.0",
|
20
20
|
"opentelemetry-distro>=0.50b0",
|
21
21
|
"opentelemetry-exporter-otlp-proto-http>=1.29.0",
|
22
22
|
"pydantic-settings>=2.7.0",
|
@@ -31,6 +31,7 @@ dependencies = [
|
|
31
31
|
"a2a-types>=0.1.0",
|
32
32
|
"opentelemetry-instrumentation-openai>=0.39.3",
|
33
33
|
"opentelemetry-instrumentation-anthropic>=0.39.3",
|
34
|
+
"tensorzero>=2025.4.7",
|
34
35
|
]
|
35
36
|
|
36
37
|
[project.optional-dependencies]
|
@@ -100,6 +101,7 @@ dev = [
|
|
100
101
|
"pytest>=7.4.0",
|
101
102
|
"pytest-asyncio>=0.21.1",
|
102
103
|
"pytest-cov>=6.1.1",
|
104
|
+
"ipdb>=0.13.13",
|
103
105
|
]
|
104
106
|
|
105
107
|
[project.scripts]
|
@@ -18,8 +18,13 @@ async def _run_agent(
|
|
18
18
|
config_path: Optional[str] = None,
|
19
19
|
server_list: Optional[List[str]] = None,
|
20
20
|
model: Optional[str] = None,
|
21
|
+
message: Optional[str] = None,
|
22
|
+
prompt_file: Optional[str] = None
|
21
23
|
) -> None:
|
22
24
|
"""Async implementation to run an interactive agent."""
|
25
|
+
from pathlib import Path
|
26
|
+
|
27
|
+
from mcp_agent.mcp.prompts.prompt_load import load_prompt_multipart
|
23
28
|
|
24
29
|
# Create the FastAgent instance with CLI arg parsing enabled
|
25
30
|
# It will automatically parse args like --model, --quiet, etc.
|
@@ -27,6 +32,7 @@ async def _run_agent(
|
|
27
32
|
"name": name,
|
28
33
|
"config_path": config_path,
|
29
34
|
"ignore_unknown_args": True,
|
35
|
+
"parse_cli_args": False, # Don't parse CLI args, we're handling it ourselves
|
30
36
|
}
|
31
37
|
|
32
38
|
fast = FastAgent(**fast_kwargs)
|
@@ -38,10 +44,26 @@ async def _run_agent(
|
|
38
44
|
if model:
|
39
45
|
agent_kwargs["model"] = model
|
40
46
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
47
|
+
# Handle prompt file and message options
|
48
|
+
if message or prompt_file:
|
49
|
+
@fast.agent(**agent_kwargs)
|
50
|
+
async def cli_agent():
|
51
|
+
async with fast.run() as agent:
|
52
|
+
if message:
|
53
|
+
response = await agent.send(message)
|
54
|
+
# Print the response and exit
|
55
|
+
print(response)
|
56
|
+
elif prompt_file:
|
57
|
+
prompt = load_prompt_multipart(Path(prompt_file))
|
58
|
+
response = await agent.generate(prompt)
|
59
|
+
# Print the response text and exit
|
60
|
+
print(response.last_text())
|
61
|
+
else:
|
62
|
+
# Standard interactive mode
|
63
|
+
@fast.agent(**agent_kwargs)
|
64
|
+
async def cli_agent():
|
65
|
+
async with fast.run() as agent:
|
66
|
+
await agent.interactive()
|
45
67
|
|
46
68
|
# Run the agent
|
47
69
|
await cli_agent()
|
@@ -51,7 +73,9 @@ def run_async_agent(
|
|
51
73
|
instruction: str,
|
52
74
|
config_path: Optional[str] = None,
|
53
75
|
servers: Optional[str] = None,
|
54
|
-
model: Optional[str] = None
|
76
|
+
model: Optional[str] = None,
|
77
|
+
message: Optional[str] = None,
|
78
|
+
prompt_file: Optional[str] = None
|
55
79
|
):
|
56
80
|
"""Run the async agent function with proper loop handling."""
|
57
81
|
server_list = servers.split(',') if servers else None
|
@@ -75,7 +99,9 @@ def run_async_agent(
|
|
75
99
|
instruction=instruction,
|
76
100
|
config_path=config_path,
|
77
101
|
server_list=server_list,
|
78
|
-
model=model
|
102
|
+
model=model,
|
103
|
+
message=message,
|
104
|
+
prompt_file=prompt_file
|
79
105
|
))
|
80
106
|
finally:
|
81
107
|
try:
|
@@ -108,26 +134,38 @@ def go(
|
|
108
134
|
model: Optional[str] = typer.Option(
|
109
135
|
None, "--model", help="Override the default model (e.g., haiku, sonnet, gpt-4)"
|
110
136
|
),
|
137
|
+
message: Optional[str] = typer.Option(
|
138
|
+
None, "--message", "-m", help="Message to send to the agent (skips interactive mode)"
|
139
|
+
),
|
140
|
+
prompt_file: Optional[str] = typer.Option(
|
141
|
+
None, "--prompt-file", "-p", help="Path to a prompt file to use (either text or JSON)"
|
142
|
+
),
|
111
143
|
) -> None:
|
112
144
|
"""
|
113
145
|
Run an interactive agent directly from the command line.
|
114
146
|
|
115
|
-
|
147
|
+
Examples:
|
116
148
|
fast-agent go --model=haiku --instruction="You are a coding assistant" --servers=fetch,filesystem
|
149
|
+
fast-agent go --message="What is the weather today?" --model=haiku
|
150
|
+
fast-agent go --prompt-file=my-prompt.txt --model=haiku
|
117
151
|
|
118
152
|
This will start an interactive session with the agent, using the specified model
|
119
153
|
and instruction. It will use the default configuration from fastagent.config.yaml
|
120
154
|
unless --config-path is specified.
|
121
155
|
|
122
156
|
Common options:
|
123
|
-
--model
|
124
|
-
--quiet
|
125
|
-
--servers
|
157
|
+
--model Override the default model (e.g., --model=haiku)
|
158
|
+
--quiet Disable progress display and logging
|
159
|
+
--servers Comma-separated list of server names to enable from config
|
160
|
+
--message, -m Send a single message and exit
|
161
|
+
--prompt-file, -p Use a prompt file instead of interactive mode
|
126
162
|
"""
|
127
163
|
run_async_agent(
|
128
164
|
name=name,
|
129
165
|
instruction=instruction,
|
130
166
|
config_path=config_path,
|
131
167
|
servers=servers,
|
132
|
-
model=model
|
168
|
+
model=model,
|
169
|
+
message=message,
|
170
|
+
prompt_file=prompt_file
|
133
171
|
)
|
@@ -198,6 +198,16 @@ class OpenTelemetrySettings(BaseModel):
|
|
198
198
|
"""Sample rate for tracing (1.0 = sample everything)"""
|
199
199
|
|
200
200
|
|
201
|
+
class TensorZeroSettings(BaseModel):
|
202
|
+
"""
|
203
|
+
Settings for using TensorZero via its OpenAI-compatible API.
|
204
|
+
"""
|
205
|
+
|
206
|
+
base_url: Optional[str] = None
|
207
|
+
api_key: Optional[str] = None
|
208
|
+
model_config = ConfigDict(extra="allow", arbitrary_types_allowed=True)
|
209
|
+
|
210
|
+
|
201
211
|
class LoggerSettings(BaseModel):
|
202
212
|
"""
|
203
213
|
Logger settings for the fast-agent application.
|
@@ -287,6 +297,9 @@ class Settings(BaseSettings):
|
|
287
297
|
generic: GenericSettings | None = None
|
288
298
|
"""Settings for using Generic models in the fast-agent application"""
|
289
299
|
|
300
|
+
tensorzero: Optional[TensorZeroSettings] = None
|
301
|
+
"""Settings for using TensorZero inference gateway"""
|
302
|
+
|
290
303
|
logger: LoggerSettings | None = LoggerSettings()
|
291
304
|
"""Logger settings for the fast-agent application"""
|
292
305
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
Request parameters definitions for LLM interactions.
|
3
3
|
"""
|
4
4
|
|
5
|
-
from typing import Any, List
|
5
|
+
from typing import Any, Dict, List
|
6
6
|
|
7
7
|
from mcp import SamplingMessage
|
8
8
|
from mcp.types import CreateMessageRequestParams
|
@@ -48,3 +48,8 @@ class RequestParams(CreateMessageRequestParams):
|
|
48
48
|
"""
|
49
49
|
Override response format for structured calls. Prefer sending pydantic model - only use in exceptional circumstances
|
50
50
|
"""
|
51
|
+
|
52
|
+
template_vars: Dict[str, Any] = Field(default_factory=dict)
|
53
|
+
"""
|
54
|
+
Optional dictionary of template variables for dynamic templates. Currently only works for TensorZero inference backend
|
55
|
+
"""
|
@@ -76,20 +76,14 @@ def deep_merge(dict1: Dict[Any, Any], dict2: Dict[Any, Any]) -> Dict[Any, Any]:
|
|
76
76
|
Dict: The updated `dict1`.
|
77
77
|
"""
|
78
78
|
for key in dict2:
|
79
|
-
if (
|
80
|
-
key in dict1
|
81
|
-
and isinstance(dict1[key], dict)
|
82
|
-
and isinstance(dict2[key], dict)
|
83
|
-
):
|
79
|
+
if key in dict1 and isinstance(dict1[key], dict) and isinstance(dict2[key], dict):
|
84
80
|
deep_merge(dict1[key], dict2[key])
|
85
81
|
else:
|
86
82
|
dict1[key] = dict2[key]
|
87
83
|
return dict1
|
88
84
|
|
89
85
|
|
90
|
-
class AugmentedLLM(
|
91
|
-
ContextDependent, AugmentedLLMProtocol, Generic[MessageParamT, MessageT]
|
92
|
-
):
|
86
|
+
class AugmentedLLM(ContextDependent, AugmentedLLMProtocol, Generic[MessageParamT, MessageT]):
|
93
87
|
# Common parameter names used across providers
|
94
88
|
PARAM_MESSAGES = "messages"
|
95
89
|
PARAM_MODEL = "model"
|
@@ -100,7 +94,7 @@ class AugmentedLLM(
|
|
100
94
|
PARAM_METADATA = "metadata"
|
101
95
|
PARAM_USE_HISTORY = "use_history"
|
102
96
|
PARAM_MAX_ITERATIONS = "max_iterations"
|
103
|
-
|
97
|
+
PARAM_TEMPLATE_VARS = "template_vars"
|
104
98
|
# Base set of fields that should always be excluded
|
105
99
|
BASE_EXCLUDE_FIELDS = {PARAM_METADATA}
|
106
100
|
|