fast-agent-mcp 0.3.2__tar.gz → 0.3.3__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.3.2 → fast_agent_mcp-0.3.3}/PKG-INFO +1 -1
- fast_agent_mcp-0.3.3/examples/fastapi/fastapi-advanced.py +51 -0
- fast_agent_mcp-0.3.3/examples/fastapi/fastapi-simple.py +43 -0
- fast_agent_mcp-0.3.3/examples/fastapi/pyproject.toml +17 -0
- fast_agent_mcp-0.3.3/examples/fastapi/readme.md +6 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/pyproject.toml +1 -1
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/agents/llm_decorator.py +2 -1
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/agents/tool_agent.py +4 -1
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/agents/workflow/orchestrator_models.py +1 -1
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/cli/commands/url_parser.py +3 -3
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/cli/main.py +7 -1
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/config.py +2 -0
- fast_agent_mcp-0.3.3/src/fast_agent/core/__init__.py +91 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/direct_decorators.py +85 -103
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/error_handling.py +1 -1
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/fastagent.py +153 -34
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/logging/events.py +4 -9
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/prompt_utils.py +10 -4
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/anthropic/llm_anthropic.py +16 -5
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/bedrock/llm_bedrock.py +13 -5
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/google/llm_google_native.py +13 -2
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/openai/llm_openai.py +22 -13
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/ui/rich_progress.py +8 -6
- fast_agent_mcp-0.3.2/src/fast_agent/core/__init__.py +0 -52
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/.gitignore +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/LICENSE +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/README.md +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/azure-openai/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/bedrock/fast-agent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/custom-agents/agent.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/custom-agents/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/data-analysis/analysis-campaign.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/data-analysis/analysis.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/data-analysis/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/data-analysis/mount-point/WA_Fn-UseC_-HR-Employee-Attrition.csv +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/elicitations/elicitation_account_server.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/elicitations/elicitation_forms_server.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/elicitations/elicitation_game_server.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/elicitations/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/elicitations/fastagent.secrets.yaml.example +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/elicitations/forms_demo.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/elicitations/game_character.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/elicitations/game_character_handler.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/elicitations/tool_call.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/mcp-filtering/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/mcp-filtering/fastagent.secrets.yaml.example +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/mcp-filtering/mcp_server.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/mcp-filtering/test_mcp_filtering.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/state-transfer/agent_one.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/state-transfer/agent_two.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/state-transfer/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/state-transfer/fastagent.secrets.yaml.example +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/vision-examples/cat.png +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/vision-examples/example1.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/vision-examples/example2.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/vision-examples/example3.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/mcp/vision-examples/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/new-api/display_check.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/new-api/simple_llm.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/new-api/simple_llm_advanced.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/new-api/simple_mcp.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/otel/agent.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/otel/agent2.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/otel/docker-compose.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/otel/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/researcher/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/researcher/researcher-eval.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/researcher/researcher-imp.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/researcher/researcher.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/setup/.gitignore +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/setup/agent.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/setup/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/setup/fastagent.secrets.yaml.example +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/setup/pyproject.toml.tmpl +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/.env.sample +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/Makefile +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/README.md +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/agent.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/demo_images/clam.jpg +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/demo_images/crab.png +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/demo_images/shrimp.png +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/docker-compose.yml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/image_demo.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/mcp_server/Dockerfile +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/mcp_server/entrypoint.sh +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/mcp_server/mcp_server.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/mcp_server/pyproject.toml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/simple_agent.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/tensorzero_config/system_schema.json +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/tensorzero_config/system_template.minijinja +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/tensorzero/tensorzero_config/tensorzero.toml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/workflows/chaining.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/workflows/evaluator.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/workflows/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/workflows/graded_report.md +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/workflows/human_input.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/workflows/orchestrator.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/workflows/parallel.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/workflows/router.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/workflows/short_story.md +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/examples/workflows/short_story.txt +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/hatch_build.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/__init__.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/agents/__init__.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/agents/agent_types.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/agents/llm_agent.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/agents/mcp_agent.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/agents/workflow/chain_agent.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/agents/workflow/evaluator_optimizer.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/agents/workflow/iterative_planner.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/agents/workflow/orchestrator_prompts.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/agents/workflow/parallel_agent.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/agents/workflow/router_agent.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/cli/__init__.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/cli/__main__.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/cli/commands/check_config.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/cli/commands/go.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/cli/commands/quickstart.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/cli/commands/server_helpers.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/cli/commands/setup.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/cli/constants.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/cli/terminal.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/constants.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/context.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/context_dependent.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/agent_app.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/core_app.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/direct_factory.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/exceptions.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/executor/__init__.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/executor/executor.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/executor/task_registry.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/executor/workflow_signal.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/logging/__init__.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/logging/json_serializer.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/logging/listeners.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/logging/logger.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/logging/transport.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/prompt.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/core/validation.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/event_progress.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/history/history_exporter.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/human_input/__init__.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/human_input/elicitation_handler.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/human_input/elicitation_state.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/human_input/form_fields.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/human_input/simple_form.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/human_input/types.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/interfaces.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/__init__.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/fastagent_llm.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/internal/passthrough.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/internal/playback.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/internal/silent.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/internal/slow.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/memory.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/model_database.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/model_factory.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/model_info.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/anthropic/anthropic_utils.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/anthropic/multipart_converter_anthropic.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/bedrock/bedrock_utils.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/google/google_converter.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/openai/llm_aliyun.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/openai/llm_azure.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/openai/llm_deepseek.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/openai/llm_generic.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/openai/llm_google_oai.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/openai/llm_groq.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/openai/llm_openrouter.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/openai/llm_tensorzero_openai.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/openai/llm_xai.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/openai/multipart_converter_openai.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/openai/openai_multipart.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider/openai/openai_utils.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider_key_manager.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/provider_types.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/request_params.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/sampling_converter.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/llm/usage_tracking.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/__init__.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/common.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/elicitation_factory.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/elicitation_handlers.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/gen_client.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/helpers/__init__.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/helpers/content_helpers.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/helpers/server_config_helpers.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/hf_auth.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/interfaces.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/logger_textio.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/mcp_agent_client_session.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/mcp_aggregator.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/mcp_connection_manager.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/mcp_content.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/mime_utils.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/prompt.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/prompt_message_extended.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/prompt_render.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/prompt_serialization.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/prompts/__init__.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/prompts/__main__.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/prompts/prompt_constants.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/prompts/prompt_helpers.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/prompts/prompt_load.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/prompts/prompt_server.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/prompts/prompt_template.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/resource_utils.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/sampling.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/server/__init__.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/server/agent_server.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/ui_agent.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp/ui_mixin.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/mcp_server_registry.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/py.typed +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/data-analysis/analysis-campaign.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/data-analysis/analysis.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/data-analysis/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/data-analysis/mount-point/WA_Fn-UseC_-HR-Employee-Attrition.csv +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/mcp/elicitations/elicitation_account_server.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/mcp/elicitations/elicitation_forms_server.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/mcp/elicitations/elicitation_game_server.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/mcp/elicitations/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/mcp/elicitations/fastagent.secrets.yaml.example +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/mcp/elicitations/forms_demo.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/mcp/elicitations/game_character.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/mcp/elicitations/game_character_handler.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/mcp/elicitations/tool_call.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/mcp/state-transfer/agent_one.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/mcp/state-transfer/agent_two.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/mcp/state-transfer/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/mcp/state-transfer/fastagent.secrets.yaml.example +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/researcher/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/researcher/researcher-eval.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/researcher/researcher-imp.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/researcher/researcher.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/.env.sample +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/Makefile +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/README.md +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/agent.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/demo_images/clam.jpg +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/demo_images/crab.png +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/demo_images/shrimp.png +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/docker-compose.yml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/image_demo.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/mcp_server/.python-version +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/mcp_server/Dockerfile +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/mcp_server/entrypoint.sh +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/mcp_server/mcp_server.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/mcp_server/pyproject.toml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/simple_agent.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/tensorzero_config/system_schema.json +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/tensorzero_config/system_template.minijinja +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/tensorzero/tensorzero_config/tensorzero.toml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/workflows/chaining.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/workflows/evaluator.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/workflows/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/workflows/graded_report.md +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/workflows/human_input.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/workflows/orchestrator.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/workflows/parallel.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/workflows/router.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/workflows/short_story.md +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/examples/workflows/short_story.txt +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/setup/.gitignore +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/setup/agent.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/setup/fastagent.config.yaml +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/setup/fastagent.secrets.yaml.example +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/resources/setup/pyproject.toml.tmpl +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/tools/elicitation.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/types/__init__.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/types/llm_stop_reason.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/ui/__init__.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/ui/console.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/ui/console_display.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/ui/elicitation_form.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/ui/elicitation_style.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/ui/enhanced_prompt.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/ui/interactive_prompt.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/ui/mcp_ui_utils.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/ui/mermaid_utils.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/ui/progress_display.py +0 -0
- {fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/ui/usage_display.py +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from contextlib import asynccontextmanager
|
|
2
|
+
|
|
3
|
+
from fastapi import Body, FastAPI, HTTPException
|
|
4
|
+
|
|
5
|
+
from fast_agent.agents.agent_types import AgentConfig
|
|
6
|
+
from fast_agent.agents.mcp_agent import McpAgent
|
|
7
|
+
from fast_agent.core import Core
|
|
8
|
+
from fast_agent.core.direct_factory import get_model_factory
|
|
9
|
+
from fast_agent.mcp import PromptMessageExtended
|
|
10
|
+
|
|
11
|
+
core = Core(name="fast-agent core")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@asynccontextmanager
|
|
15
|
+
async def lifespan(app: FastAPI):
|
|
16
|
+
# Manual lifecycle control: initialize Core and Agent explicitly
|
|
17
|
+
await core.initialize()
|
|
18
|
+
|
|
19
|
+
cfg = AgentConfig(
|
|
20
|
+
name="core_agent",
|
|
21
|
+
instruction="You are a helpful AI Agent.",
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
agent = McpAgent(config=cfg, context=core.context)
|
|
25
|
+
await agent.initialize()
|
|
26
|
+
|
|
27
|
+
llm_factory = get_model_factory(core.context, model=cfg.model)
|
|
28
|
+
await agent.attach_llm(llm_factory)
|
|
29
|
+
|
|
30
|
+
app.state.agent = agent
|
|
31
|
+
try:
|
|
32
|
+
yield
|
|
33
|
+
finally:
|
|
34
|
+
# Manual shutdown/cleanup
|
|
35
|
+
try:
|
|
36
|
+
await agent.shutdown()
|
|
37
|
+
finally:
|
|
38
|
+
await core.cleanup()
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
app = FastAPI(lifespan=lifespan)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@app.post("/ask", response_model=PromptMessageExtended)
|
|
45
|
+
async def ask(body: str = Body(..., media_type="text/plain")) -> PromptMessageExtended:
|
|
46
|
+
try:
|
|
47
|
+
# Call generate() to return the full multipart message (BaseModel)
|
|
48
|
+
result = await app.state.agent.generate(body)
|
|
49
|
+
return result
|
|
50
|
+
except Exception as e:
|
|
51
|
+
raise HTTPException(status_code=500, detail=str(e))
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from contextlib import asynccontextmanager
|
|
2
|
+
|
|
3
|
+
from fastapi import FastAPI, HTTPException
|
|
4
|
+
from pydantic import BaseModel
|
|
5
|
+
|
|
6
|
+
from fast_agent.core.fastagent import FastAgent
|
|
7
|
+
|
|
8
|
+
# Create FastAgent without parsing CLI args (plays nice with uvicorn)
|
|
9
|
+
fast = FastAgent("fast-agent demo", parse_cli_args=False, quiet=True)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# Register a simple default agent via decorator
|
|
13
|
+
@fast.agent(name="helper", instruction="You are a helpful AI Agent.", default=True)
|
|
14
|
+
async def decorator():
|
|
15
|
+
pass
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# Keep FastAgent running for the app lifetime
|
|
19
|
+
@asynccontextmanager
|
|
20
|
+
async def lifespan(app: FastAPI):
|
|
21
|
+
async with fast.run() as agents:
|
|
22
|
+
app.state.agents = agents
|
|
23
|
+
yield
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
app = FastAPI(lifespan=lifespan)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class AskRequest(BaseModel):
|
|
30
|
+
message: str
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class AskResponse(BaseModel):
|
|
34
|
+
response: str
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@app.post("/ask", response_model=AskResponse)
|
|
38
|
+
async def ask(req: AskRequest) -> AskResponse:
|
|
39
|
+
try:
|
|
40
|
+
result = await app.state.agents.send(req.message)
|
|
41
|
+
return AskResponse(response=result)
|
|
42
|
+
except Exception as e:
|
|
43
|
+
raise HTTPException(status_code=500, detail=str(e))
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "fast-agent-app"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "a simple fast-agent application"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.13.7"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"fast-agent-mcp",
|
|
9
|
+
"fastapi>=0.116.1",
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
[tool.uv]
|
|
13
|
+
package = true
|
|
14
|
+
|
|
15
|
+
# Optional convenience entry point if you later package this app:
|
|
16
|
+
[project.scripts]
|
|
17
|
+
fast-agent-app = "agent:main"
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# fastapi demo applications
|
|
2
|
+
|
|
3
|
+
Be sure to `uv pip install fastapi[standard]` to run these examples.
|
|
4
|
+
|
|
5
|
+
- fastapi-simply.py -- uses simple `fast-agent` decorators to integrate with fastapi. run with `fastapi dev fastapi-simple.py`.
|
|
6
|
+
- fastapi-advanced.py -- uses `fast-agent` core library for developer managed lifecycle. run with `fastapi dev fastapi-advanced.py`.
|
|
@@ -189,6 +189,7 @@ class LlmDecorator(AgentProtocol):
|
|
|
189
189
|
Sequence[Union[str, PromptMessage, PromptMessageExtended]],
|
|
190
190
|
],
|
|
191
191
|
request_params: RequestParams | None = None,
|
|
192
|
+
tools: List[Tool] | None = None,
|
|
192
193
|
) -> PromptMessageExtended:
|
|
193
194
|
"""
|
|
194
195
|
Create a completion with the LLM using the provided messages.
|
|
@@ -212,7 +213,7 @@ class LlmDecorator(AgentProtocol):
|
|
|
212
213
|
multipart_messages = normalize_to_extended_list(messages)
|
|
213
214
|
|
|
214
215
|
with self._tracer.start_as_current_span(f"Agent: '{self._name}' generate"):
|
|
215
|
-
return await self.generate_impl(multipart_messages, request_params,
|
|
216
|
+
return await self.generate_impl(multipart_messages, request_params, tools)
|
|
216
217
|
|
|
217
218
|
async def generate_impl(
|
|
218
219
|
self,
|
|
@@ -97,7 +97,10 @@ class ToolAgent(LlmAgent):
|
|
|
97
97
|
)
|
|
98
98
|
|
|
99
99
|
if LlmStopReason.TOOL_USE == result.stop_reason:
|
|
100
|
-
|
|
100
|
+
if self.config.use_history:
|
|
101
|
+
messages = [await self.run_tools(result)]
|
|
102
|
+
else:
|
|
103
|
+
messages.extend([result, await self.run_tools(result)])
|
|
101
104
|
else:
|
|
102
105
|
break
|
|
103
106
|
|
{fast_agent_mcp-0.3.2 → fast_agent_mcp-0.3.3}/src/fast_agent/agents/workflow/orchestrator_models.py
RENAMED
|
@@ -72,7 +72,7 @@ class TaskWithResult(Task):
|
|
|
72
72
|
class StepResult(BaseModel):
|
|
73
73
|
"""Result of executing a step"""
|
|
74
74
|
|
|
75
|
-
step: Step = Field(description="The step that was executed"
|
|
75
|
+
step: Step = Field(description="The step that was executed")
|
|
76
76
|
task_results: List[TaskWithResult] = Field(
|
|
77
77
|
description="Results of executing each task", default_factory=list
|
|
78
78
|
)
|
|
@@ -104,7 +104,7 @@ def generate_server_name(url: str) -> str:
|
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
def parse_server_urls(
|
|
107
|
-
urls_param: str, auth_token: str = None
|
|
107
|
+
urls_param: str, auth_token: str | None = None
|
|
108
108
|
) -> List[Tuple[str, Literal["http", "sse"], str, Dict[str, str] | None]]:
|
|
109
109
|
"""
|
|
110
110
|
Parse a comma-separated list of URLs into server configurations.
|
|
@@ -155,7 +155,7 @@ def generate_server_configs(
|
|
|
155
155
|
Returns:
|
|
156
156
|
Dictionary of server configurations
|
|
157
157
|
"""
|
|
158
|
-
server_configs = {}
|
|
158
|
+
server_configs: Dict[str, Dict[str, str | Dict[str, str]]] = {}
|
|
159
159
|
# Keep track of server name occurrences to handle collisions
|
|
160
160
|
name_counts = {}
|
|
161
161
|
|
|
@@ -178,7 +178,7 @@ def generate_server_configs(
|
|
|
178
178
|
final_name = f"{server_name}_{suffix}"
|
|
179
179
|
name_counts[server_name] += 1
|
|
180
180
|
|
|
181
|
-
config = {
|
|
181
|
+
config: Dict[str, str | Dict[str, str]] = {
|
|
182
182
|
"transport": transport_type,
|
|
183
183
|
"url": url,
|
|
184
184
|
}
|
|
@@ -85,7 +85,13 @@ def main(
|
|
|
85
85
|
Use --help with any command for detailed usage information.
|
|
86
86
|
"""
|
|
87
87
|
application.verbosity = 1 if verbose else 0 if not quiet else -1
|
|
88
|
-
|
|
88
|
+
if not color:
|
|
89
|
+
# Recreate consoles without color when --no-color is provided
|
|
90
|
+
from fast_agent.ui.console import console as base_console
|
|
91
|
+
from fast_agent.ui.console import error_console as base_error_console
|
|
92
|
+
|
|
93
|
+
application.console = base_console.__class__(color_system=None)
|
|
94
|
+
application.error_console = base_error_console.__class__(color_system=None, stderr=True)
|
|
89
95
|
|
|
90
96
|
# Handle version flag
|
|
91
97
|
if version:
|
|
@@ -547,6 +547,8 @@ def get_settings(config_path: str | None = None) -> Settings:
|
|
|
547
547
|
return _settings
|
|
548
548
|
|
|
549
549
|
# Handle config path - convert string to Path if needed
|
|
550
|
+
config_file: Path | None
|
|
551
|
+
secrets_file: Path | None
|
|
550
552
|
if config_path:
|
|
551
553
|
config_file = Path(config_path)
|
|
552
554
|
# If it's a relative path and doesn't exist, try finding it
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Core interfaces and decorators for fast-agent.
|
|
3
|
+
|
|
4
|
+
Public API:
|
|
5
|
+
- `Core`: The core application container (eagerly exported)
|
|
6
|
+
- `FastAgent`: High-level, decorator-driven application class (lazy-loaded)
|
|
7
|
+
- Decorators: `agent`, `custom`, `orchestrator`, `iterative_planner`,
|
|
8
|
+
`router`, `chain`, `parallel`, `evaluator_optimizer` (lazy-loaded)
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from typing import TYPE_CHECKING as _TYPE_CHECKING
|
|
12
|
+
|
|
13
|
+
from .core_app import Core # Eager export for external applications
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
"Core",
|
|
17
|
+
"AgentApp",
|
|
18
|
+
"FastAgent",
|
|
19
|
+
# Decorators
|
|
20
|
+
"agent",
|
|
21
|
+
"custom",
|
|
22
|
+
"orchestrator",
|
|
23
|
+
"iterative_planner",
|
|
24
|
+
"router",
|
|
25
|
+
"chain",
|
|
26
|
+
"parallel",
|
|
27
|
+
"evaluator_optimizer",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def __getattr__(name: str):
|
|
32
|
+
# Lazy imports to avoid heavy dependencies and circular imports at init time
|
|
33
|
+
if name == "FastAgent":
|
|
34
|
+
from .fastagent import FastAgent
|
|
35
|
+
|
|
36
|
+
return FastAgent
|
|
37
|
+
if name == "AgentApp":
|
|
38
|
+
from .agent_app import AgentApp
|
|
39
|
+
|
|
40
|
+
return AgentApp
|
|
41
|
+
|
|
42
|
+
# Decorators from direct_decorators
|
|
43
|
+
if name in {
|
|
44
|
+
"agent",
|
|
45
|
+
"custom",
|
|
46
|
+
"orchestrator",
|
|
47
|
+
"iterative_planner",
|
|
48
|
+
"router",
|
|
49
|
+
"chain",
|
|
50
|
+
"parallel",
|
|
51
|
+
"evaluator_optimizer",
|
|
52
|
+
}:
|
|
53
|
+
from . import direct_decorators as _dd
|
|
54
|
+
|
|
55
|
+
return getattr(_dd, name)
|
|
56
|
+
|
|
57
|
+
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# Help static analyzers/IDEs resolve symbols and signatures without importing at runtime.
|
|
61
|
+
if _TYPE_CHECKING: # pragma: no cover - typing aid only
|
|
62
|
+
from .agent_app import AgentApp as AgentApp # noqa: F401
|
|
63
|
+
from .direct_decorators import (
|
|
64
|
+
agent as agent,
|
|
65
|
+
) # noqa: F401
|
|
66
|
+
from .direct_decorators import (
|
|
67
|
+
chain as chain,
|
|
68
|
+
)
|
|
69
|
+
from .direct_decorators import (
|
|
70
|
+
custom as custom,
|
|
71
|
+
)
|
|
72
|
+
from .direct_decorators import (
|
|
73
|
+
evaluator_optimizer as evaluator_optimizer,
|
|
74
|
+
)
|
|
75
|
+
from .direct_decorators import (
|
|
76
|
+
iterative_planner as iterative_planner,
|
|
77
|
+
)
|
|
78
|
+
from .direct_decorators import (
|
|
79
|
+
orchestrator as orchestrator,
|
|
80
|
+
)
|
|
81
|
+
from .direct_decorators import (
|
|
82
|
+
parallel as parallel,
|
|
83
|
+
)
|
|
84
|
+
from .direct_decorators import (
|
|
85
|
+
router as router,
|
|
86
|
+
)
|
|
87
|
+
from .fastagent import FastAgent as FastAgent # noqa: F401
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def __dir__(): # pragma: no cover - developer experience aid
|
|
91
|
+
return sorted(__all__)
|
|
@@ -186,7 +186,7 @@ def _decorator_impl(
|
|
|
186
186
|
resources: Optional[Dict[str, List[str]]] = None,
|
|
187
187
|
prompts: Optional[Dict[str, List[str]]] = None,
|
|
188
188
|
**extra_kwargs,
|
|
189
|
-
) -> Callable[[AgentCallable[P, R]],
|
|
189
|
+
) -> Callable[[AgentCallable[P, R]], AgentCallable[P, R]]:
|
|
190
190
|
"""
|
|
191
191
|
Core implementation for agent decorators with common behavior and type safety.
|
|
192
192
|
|
|
@@ -203,7 +203,7 @@ def _decorator_impl(
|
|
|
203
203
|
**extra_kwargs: Additional agent/workflow-specific parameters
|
|
204
204
|
"""
|
|
205
205
|
|
|
206
|
-
def decorator(func: AgentCallable[P, R]) ->
|
|
206
|
+
def decorator(func: AgentCallable[P, R]) -> AgentCallable[P, R]:
|
|
207
207
|
@wraps(func)
|
|
208
208
|
def wrapper(*args: P.args, **kwargs: P.kwargs) -> Awaitable[R]:
|
|
209
209
|
# Call the original function
|
|
@@ -249,7 +249,7 @@ def _decorator_impl(
|
|
|
249
249
|
for key, value in extra_kwargs.items():
|
|
250
250
|
setattr(wrapper, f"_{key}", value)
|
|
251
251
|
|
|
252
|
-
return cast("
|
|
252
|
+
return cast("AgentCallable[P, R]", wrapper)
|
|
253
253
|
|
|
254
254
|
return decorator
|
|
255
255
|
|
|
@@ -271,7 +271,7 @@ def agent(
|
|
|
271
271
|
default: bool = False,
|
|
272
272
|
elicitation_handler: Optional[ElicitationFnT] = None,
|
|
273
273
|
api_key: str | None = None,
|
|
274
|
-
) -> Callable[[AgentCallable[P, R]],
|
|
274
|
+
) -> Callable[[AgentCallable[P, R]], AgentCallable[P, R]]:
|
|
275
275
|
"""
|
|
276
276
|
Decorator to create and register a standard agent with type-safe signature.
|
|
277
277
|
|
|
@@ -336,7 +336,7 @@ def custom(
|
|
|
336
336
|
default: bool = False,
|
|
337
337
|
elicitation_handler: Optional[ElicitationFnT] = None,
|
|
338
338
|
api_key: str | None = None,
|
|
339
|
-
) -> Callable[[AgentCallable[P, R]],
|
|
339
|
+
) -> Callable[[AgentCallable[P, R]], AgentCallable[P, R]]:
|
|
340
340
|
"""
|
|
341
341
|
Decorator to create and register a standard agent with type-safe signature.
|
|
342
342
|
|
|
@@ -400,7 +400,7 @@ def orchestrator(
|
|
|
400
400
|
plan_iterations: int = 5,
|
|
401
401
|
default: bool = False,
|
|
402
402
|
api_key: str | None = None,
|
|
403
|
-
) -> Callable[[AgentCallable[P, R]],
|
|
403
|
+
) -> Callable[[AgentCallable[P, R]], AgentCallable[P, R]]:
|
|
404
404
|
"""
|
|
405
405
|
Decorator to create and register an orchestrator agent with type-safe signature.
|
|
406
406
|
|
|
@@ -423,24 +423,21 @@ def orchestrator(
|
|
|
423
423
|
# Create final request params with plan_iterations
|
|
424
424
|
resolved_instruction = _resolve_instruction(instruction)
|
|
425
425
|
|
|
426
|
-
return
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
default=default,
|
|
442
|
-
api_key=api_key,
|
|
443
|
-
),
|
|
426
|
+
return _decorator_impl(
|
|
427
|
+
self,
|
|
428
|
+
AgentType.ORCHESTRATOR,
|
|
429
|
+
name=name,
|
|
430
|
+
instruction=resolved_instruction,
|
|
431
|
+
servers=[], # Orchestrators don't connect to servers directly
|
|
432
|
+
model=model,
|
|
433
|
+
use_history=use_history,
|
|
434
|
+
request_params=request_params,
|
|
435
|
+
human_input=human_input,
|
|
436
|
+
child_agents=agents,
|
|
437
|
+
plan_type=plan_type,
|
|
438
|
+
plan_iterations=plan_iterations,
|
|
439
|
+
default=default,
|
|
440
|
+
api_key=api_key,
|
|
444
441
|
)
|
|
445
442
|
|
|
446
443
|
|
|
@@ -455,7 +452,7 @@ def iterative_planner(
|
|
|
455
452
|
plan_iterations: int = -1,
|
|
456
453
|
default: bool = False,
|
|
457
454
|
api_key: str | None = None,
|
|
458
|
-
) -> Callable[[AgentCallable[P, R]],
|
|
455
|
+
) -> Callable[[AgentCallable[P, R]], AgentCallable[P, R]]:
|
|
459
456
|
"""
|
|
460
457
|
Decorator to create and register an orchestrator agent with type-safe signature.
|
|
461
458
|
|
|
@@ -478,22 +475,19 @@ def iterative_planner(
|
|
|
478
475
|
# Create final request params with plan_iterations
|
|
479
476
|
resolved_instruction = _resolve_instruction(instruction)
|
|
480
477
|
|
|
481
|
-
return
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
default=default,
|
|
495
|
-
api_key=api_key,
|
|
496
|
-
),
|
|
478
|
+
return _decorator_impl(
|
|
479
|
+
self,
|
|
480
|
+
AgentType.ITERATIVE_PLANNER,
|
|
481
|
+
name=name,
|
|
482
|
+
instruction=resolved_instruction,
|
|
483
|
+
servers=[], # Orchestrators don't connect to servers directly
|
|
484
|
+
model=model,
|
|
485
|
+
use_history=False,
|
|
486
|
+
request_params=request_params,
|
|
487
|
+
child_agents=agents,
|
|
488
|
+
plan_iterations=plan_iterations,
|
|
489
|
+
default=default,
|
|
490
|
+
api_key=api_key,
|
|
497
491
|
)
|
|
498
492
|
|
|
499
493
|
|
|
@@ -516,7 +510,7 @@ def router(
|
|
|
516
510
|
ElicitationFnT
|
|
517
511
|
] = None, ## exclude from docs, decide whether allowable
|
|
518
512
|
api_key: str | None = None,
|
|
519
|
-
) -> Callable[[AgentCallable[P, R]],
|
|
513
|
+
) -> Callable[[AgentCallable[P, R]], AgentCallable[P, R]]:
|
|
520
514
|
"""
|
|
521
515
|
Decorator to create and register a router agent with type-safe signature.
|
|
522
516
|
|
|
@@ -536,26 +530,23 @@ def router(
|
|
|
536
530
|
"""
|
|
537
531
|
resolved_instruction = _resolve_instruction(instruction or ROUTING_SYSTEM_INSTRUCTION)
|
|
538
532
|
|
|
539
|
-
return
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
prompts=prompts,
|
|
557
|
-
resources=resources,
|
|
558
|
-
),
|
|
533
|
+
return _decorator_impl(
|
|
534
|
+
self,
|
|
535
|
+
AgentType.ROUTER,
|
|
536
|
+
name=name,
|
|
537
|
+
instruction=resolved_instruction,
|
|
538
|
+
servers=servers,
|
|
539
|
+
model=model,
|
|
540
|
+
use_history=use_history,
|
|
541
|
+
request_params=request_params,
|
|
542
|
+
human_input=human_input,
|
|
543
|
+
default=default,
|
|
544
|
+
router_agents=agents,
|
|
545
|
+
elicitation_handler=elicitation_handler,
|
|
546
|
+
api_key=api_key,
|
|
547
|
+
tools=tools,
|
|
548
|
+
prompts=prompts,
|
|
549
|
+
resources=resources,
|
|
559
550
|
)
|
|
560
551
|
|
|
561
552
|
|
|
@@ -567,7 +558,7 @@ def chain(
|
|
|
567
558
|
instruction: Optional[str | Path | AnyUrl] = None,
|
|
568
559
|
cumulative: bool = False,
|
|
569
560
|
default: bool = False,
|
|
570
|
-
) -> Callable[[AgentCallable[P, R]],
|
|
561
|
+
) -> Callable[[AgentCallable[P, R]], AgentCallable[P, R]]:
|
|
571
562
|
"""
|
|
572
563
|
Decorator to create and register a chain agent with type-safe signature.
|
|
573
564
|
|
|
@@ -593,17 +584,14 @@ def chain(
|
|
|
593
584
|
"""
|
|
594
585
|
resolved_instruction = _resolve_instruction(instruction or default_instruction)
|
|
595
586
|
|
|
596
|
-
return
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
cumulative=cumulative,
|
|
605
|
-
default=default,
|
|
606
|
-
),
|
|
587
|
+
return _decorator_impl(
|
|
588
|
+
self,
|
|
589
|
+
AgentType.CHAIN,
|
|
590
|
+
name=name,
|
|
591
|
+
instruction=resolved_instruction,
|
|
592
|
+
sequence=sequence,
|
|
593
|
+
cumulative=cumulative,
|
|
594
|
+
default=default,
|
|
607
595
|
)
|
|
608
596
|
|
|
609
597
|
|
|
@@ -616,7 +604,7 @@ def parallel(
|
|
|
616
604
|
instruction: Optional[str | Path | AnyUrl] = None,
|
|
617
605
|
include_request: bool = True,
|
|
618
606
|
default: bool = False,
|
|
619
|
-
) -> Callable[[AgentCallable[P, R]],
|
|
607
|
+
) -> Callable[[AgentCallable[P, R]], AgentCallable[P, R]]:
|
|
620
608
|
"""
|
|
621
609
|
Decorator to create and register a parallel agent with type-safe signature.
|
|
622
610
|
|
|
@@ -637,19 +625,16 @@ def parallel(
|
|
|
637
625
|
"""
|
|
638
626
|
resolved_instruction = _resolve_instruction(instruction or default_instruction)
|
|
639
627
|
|
|
640
|
-
return
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
include_request=include_request,
|
|
651
|
-
default=default,
|
|
652
|
-
),
|
|
628
|
+
return _decorator_impl(
|
|
629
|
+
self,
|
|
630
|
+
AgentType.PARALLEL,
|
|
631
|
+
name=name,
|
|
632
|
+
instruction=resolved_instruction,
|
|
633
|
+
servers=[], # Parallel agents don't connect to servers directly
|
|
634
|
+
fan_in=fan_in,
|
|
635
|
+
fan_out=fan_out,
|
|
636
|
+
include_request=include_request,
|
|
637
|
+
default=default,
|
|
653
638
|
)
|
|
654
639
|
|
|
655
640
|
|
|
@@ -663,7 +648,7 @@ def evaluator_optimizer(
|
|
|
663
648
|
min_rating: str = "GOOD",
|
|
664
649
|
max_refinements: int = 3,
|
|
665
650
|
default: bool = False,
|
|
666
|
-
) -> Callable[[AgentCallable[P, R]],
|
|
651
|
+
) -> Callable[[AgentCallable[P, R]], AgentCallable[P, R]]:
|
|
667
652
|
"""
|
|
668
653
|
Decorator to create and register an evaluator-optimizer agent with type-safe signature.
|
|
669
654
|
|
|
@@ -686,18 +671,15 @@ def evaluator_optimizer(
|
|
|
686
671
|
"""
|
|
687
672
|
resolved_instruction = _resolve_instruction(instruction or default_instruction)
|
|
688
673
|
|
|
689
|
-
return
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
max_refinements=max_refinements,
|
|
701
|
-
default=default,
|
|
702
|
-
),
|
|
674
|
+
return _decorator_impl(
|
|
675
|
+
self,
|
|
676
|
+
AgentType.EVALUATOR_OPTIMIZER,
|
|
677
|
+
name=name,
|
|
678
|
+
instruction=resolved_instruction,
|
|
679
|
+
servers=[], # Evaluator-optimizer doesn't connect to servers directly
|
|
680
|
+
generator=generator,
|
|
681
|
+
evaluator=evaluator,
|
|
682
|
+
min_rating=min_rating,
|
|
683
|
+
max_refinements=max_refinements,
|
|
684
|
+
default=default,
|
|
703
685
|
)
|
|
@@ -5,7 +5,7 @@ Error handling utilities for agent operations.
|
|
|
5
5
|
from rich import print
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
def handle_error(e: Exception, error_type: str, suggestion: str = None) -> None:
|
|
8
|
+
def handle_error(e: Exception, error_type: str, suggestion: str | None = None) -> None:
|
|
9
9
|
"""
|
|
10
10
|
Handle errors with consistent formatting and messaging.
|
|
11
11
|
|