agentbyte 0.51.0__tar.gz → 0.52.0__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.
- {agentbyte-0.51.0 → agentbyte-0.52.0}/CHANGELOG.md +34 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/PKG-INFO +10 -2
- {agentbyte-0.51.0 → agentbyte-0.52.0}/README.md +3 -1
- {agentbyte-0.51.0 → agentbyte-0.52.0}/pyproject.toml +11 -1
- agentbyte-0.52.0/src/agentbyte/__about__.py +2 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/__init__.py +47 -4
- agentbyte-0.52.0/src/agentbyte/llm/anthropic/__init__.py +10 -0
- agentbyte-0.52.0/src/agentbyte/llm/anthropic/_conversion.py +439 -0
- agentbyte-0.52.0/src/agentbyte/llm/anthropic/chat.py +160 -0
- agentbyte-0.52.0/src/agentbyte/llm/anthropic/settings.py +22 -0
- agentbyte-0.52.0/src/agentbyte/llm/bedrock/__init__.py +58 -0
- agentbyte-0.52.0/src/agentbyte/llm/bedrock/_client.py +24 -0
- agentbyte-0.52.0/src/agentbyte/llm/bedrock/anthropic_chat.py +170 -0
- agentbyte-0.52.0/src/agentbyte/llm/bedrock/cohere_embedding.py +136 -0
- agentbyte-0.52.0/src/agentbyte/llm/bedrock/settings.py +16 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/pricing.py +111 -1
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/clients.py +26 -4
- agentbyte-0.52.0/tests/llm/test_anthropic_bedrock_client.py +153 -0
- agentbyte-0.52.0/tests/llm/test_anthropic_client.py +388 -0
- agentbyte-0.52.0/tests/llm/test_cohere_bedrock_embedding_client.py +237 -0
- agentbyte-0.51.0/src/agentbyte/__about__.py +0 -2
- {agentbyte-0.51.0 → agentbyte-0.52.0}/.gitignore +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/LICENSE +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/_optional.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/a2a/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/a2a/app.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/a2a/distributed_context.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/a2a/executor.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/a2a/tool.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/agents/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/agents/agent.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/agents/agent_as_tool.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/agents/base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/agents/embedding_agent.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/agents/types.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/cancellation_token.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/catalog.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/cli/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/cli/__main__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/cli/eval_commands.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/cli/history_args.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/cli/loading.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/cli/main.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/cli/optim_commands.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/cli/report_output.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/cli/serve_commands.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/compaction/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/compaction/counters.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/compaction/errors.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/compaction/grouping.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/compaction/strategies.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/component.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/context.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/context_providers/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/context_providers/base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/context_providers/skill_tools.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/context_providers/skills.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/dataset/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/dataset/_aiosqlite.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/dataset/base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/dataset/config.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/dataset/importer.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/dataset/json.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/dataset/loader.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/dataset/publish.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/dataset/publish_config.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/dataset/publishers.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/dataset/s3.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/dataset/sources.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/dataset/sqlite.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/dataset/sqlite_db.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/dataset/write_config.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/dataset/writers.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/entity.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/checks/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/checks/decorator.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/checks/keyword.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/checks/local.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/checks/process.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/checks/tool.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/checks/types.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/comparison.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/eval_dataset.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/history/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/history/_writer_lock.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/history/config.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/history/conformance.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/history/errors.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/history/models.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/history/recorder.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/history/sql.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/history/sqlite.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/history/store.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/history/transitions.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/judges/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/judges/base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/judges/composite.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/judges/llm.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/judges/pairwise.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/judges/reference.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/judges/trajectory.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/judges/validation.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/pairwise.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/report.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/runner.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/splitting.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/targets/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/targets/agent.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/targets/model.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/targets/multi_turn.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/targets/orchestrator.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/targets/runtime.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/targets/workflow.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/types.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/workbench/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/workbench/benchmark.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/workbench/compare.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/workbench/coordinator.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/workbench/jobs.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/workbench/smoke.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/workbench/smoke_tasks.json +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/workbench/suite.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/eval/workbench/verdict.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/execution_trace/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/execution_trace/collector.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/execution_trace/models.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/_retry_observability.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/auth.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/azure/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/azure/auth.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/azure/chat.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/azure/embedding.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/azure/settings.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/azure_openai.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/azure_openai_embedding.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/embeddings_base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/openai/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/openai/chat.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/openai/embedding.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/openai/settings.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/openai_embedding.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/retry_policy.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/settings.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/llm/types.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/logger.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/memory/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/memory/base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/messages.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/middleware/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/middleware/base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/middleware/otel.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/middleware/retry.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/middleware/sql_usage.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/middleware/usage_logger.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/notebook.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/optim/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/optim/base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/optim/binding.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/optim/config.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/optim/gepa.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/optim/job.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/optim/mipro.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/optim/pareto.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/optim/reflective.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/optim/report.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/optim/spec.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/optim/trace.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/orchestration/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/orchestration/ai.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/orchestration/base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/orchestration/handoff.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/orchestration/plan.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/orchestration/policies.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/orchestration/round_robin.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/agents.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/benchmark.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/capitals.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/instruction_registry.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/instructions/orchestrator.yaml +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/instructions/query_rewriter.yaml +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/instructions/researcher.yaml +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/instructions/reviewer.yaml +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/instructions/writer.yaml +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/orchestration.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/skills/capitals-format/SKILL.md +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/skills/contracts-analyst/SKILL.md +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/skills/hr-analyst/SKILL.md +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/skills/hr-analyst/resources/departments.md +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/skills/hr-analyst/resources/employees.md +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/skills/hr-analyst/resources/payroll.md +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/streaming.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/presets/workflow.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/session_store.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/skills/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/skills/base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/skills/resources.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/skills/scripts.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/skills/sources.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/skills/validation.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/termination/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/termination/base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/termination/cancellation.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/termination/composite.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/termination/consecutive_agent.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/termination/external.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/termination/function_call.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/termination/handoff.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/termination/max_message.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/termination/predicate.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/termination/source.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/termination/text_mention.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/termination/timeout.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/termination/token_usage.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/tools/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/tools/base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/tools/coding_tools.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/tools/core_tools.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/tools/decorator.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/tools/mcp/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/tools/mcp/client.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/tools/mcp/config.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/tools/mcp/errors.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/tools/mcp/tool.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/tools/mcp/transports.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/tools/memory_tool.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/tools/research_tools.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/types.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/discovery.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/eval_routes.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/execution.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/mcp/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/mcp/servers/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/mcp/servers/apps_server.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/mcp/servers/auth_server.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/mcp/servers/basic_server.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/mcp/servers/mrtr_server.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/mcp/servers/notify_server.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/mcp_playground.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/mcp_routes.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/models.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/registry.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/server.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/session_store.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/sessions.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/ui/assets/index-BreogZut.js +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/ui/assets/index-ptxe7GHs.css +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/ui/index.html +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/webui/ui/vite.svg +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/agent.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/core/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/core/_structure_hash.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/core/checkpoint.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/core/models.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/core/runner.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/core/workflow.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/defaults.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/errors.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/loader.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/schema.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/schema_utils.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/sqlite_checkpoint.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/steps/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/steps/agent.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/steps/echo.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/steps/function.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/steps/http.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/steps/step.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/steps/subworkflow.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/steps/transform.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/src/agentbyte/workflow/visualizer.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/a2a/a2a_helpers.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/a2a/test_a2a_adapters.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/a2a/test_distributed_context.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/agents/test_agent_as_tool.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/agents/test_agent_basic.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/agents/test_agent_context_providers.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/agents/test_agent_error_response.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/agents/test_agent_event_types.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/agents/test_agent_memory_integration.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/agents/test_agent_middleware_integration.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/agents/test_agent_response_accessors.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/agents/test_agent_retry_middleware.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/agents/test_agent_stop_at_tools.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/agents/test_agent_stream_events.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/agents/test_embedding_agent.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/agents/test_tool_approval.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/agents/test_tool_batch_resolution.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/agents/test_tool_metadata.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/cli/test_eval_benchmark_commands.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/cli/test_loading.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/cli/test_registry_check.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/cli/test_report_output.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/cli/test_serve_command.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/compaction/test_compaction.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/conftest.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/context_providers/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/context_providers/test_skill_tools.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/context_providers/test_skills_provider.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/dataset/fake_s3.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/dataset/test_dataset_exit.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/dataset/test_loader.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/dataset/test_multi_table.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/dataset/test_publish.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/dataset/test_sqlite_db.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_dimension_scores.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_eval_benchmarks.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_eval_dataset.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_eval_history.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_eval_history_backends.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_eval_jobs.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_eval_workbench.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_execution_trajectories.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_history_config.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_multi_turn.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_pairwise.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_phase1_runner_and_targets.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_phase2_checks_and_reports.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_run_comparison.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_score_integrity.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_splitting.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/eval/test_types_and_judges.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/llm/test_azure_client.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/llm/test_azure_embedding_client.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/llm/test_llm_types.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/llm/test_openai_client.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/llm/test_openai_embedding_client.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/llm/test_pricing.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/llm/test_retry_observability.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/llm/test_retry_policy_api.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/llm/test_retryable_error_substrings.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/memory/test_memory.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/middleware/test_context_compaction.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/middleware/test_deduplicate_tool_result.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/middleware/test_middleware_chain.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/middleware/test_otel.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/middleware/test_retry_middleware.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/middleware/test_sql_usage.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/middleware/test_usage_logger.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/optim/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/optim/fakes.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/optim/test_base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/optim/test_base_integration.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/optim/test_binding.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/optim/test_config.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/optim/test_description_tunable.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/optim/test_gepa.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/optim/test_mipro.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/optim/test_orchestrator_optim.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/optim/test_pareto.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/optim/test_reflective.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/optim/test_report.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/optim/test_score_integrity.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/optim/test_spec.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/optim/test_trace.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/orchestration/test_ai_orchestrator.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/orchestration/test_base_orchestrator.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/orchestration/test_handoff_orchestrator.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/orchestration/test_history_tool_call_pairing.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/orchestration/test_orchestration_usage_breakdown.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/orchestration/test_orchestrator_agent_contract.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/orchestration/test_orchestrator_finalization.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/orchestration/test_orchestrator_member_events.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/orchestration/test_orchestrator_otel.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/orchestration/test_orchestrator_synthesis.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/orchestration/test_plan_orchestrator.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/orchestration/test_round_robin.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/presets/test_agents.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/presets/test_benchmark.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/presets/test_capitals.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/presets/test_clients.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/presets/test_instruction_registry.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/presets/test_orchestration.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/presets/test_streaming.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/presets/test_workflow.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/skills/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/skills/test_base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/skills/test_resources.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/skills/test_scripts.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/skills/test_sources.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/termination/test_base.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/termination/test_cancellation.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/termination/test_composite.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/termination/test_consecutive_agent.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/termination/test_external.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/termination/test_function_call.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/termination/test_handoff.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/termination/test_max_message.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/termination/test_predicate.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/termination/test_source.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/termination/test_text_mention.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/termination/test_timeout.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/termination/test_token_usage.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/test_cancellation_token.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/test_context.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/test_logger.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/test_messages.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/test_option_enums.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/test_optional_extras.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/test_package_api.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/test_session_store.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/test_types.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/tools/fixtures/mcp_stdio_server.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/tools/test_coding_tools.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/tools/test_mcp_tools.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/tools/test_memory_tool.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/tools/test_research_tools.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/tools/test_tools.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/webui/__init__.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/webui/helpers.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/webui/test_eval_routes.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/webui/test_execution.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/webui/test_mcp_routes.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/webui/test_package_api.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/webui/test_registry.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/webui/test_server.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/webui/test_sessions.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/webui/test_workflow_streaming.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/workflow/recovery_worker.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/workflow/test_agent_step_imports.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/workflow/test_checkpoint.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/workflow/test_subworkflow_step.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/workflow/test_workflow_agent.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/workflow/test_workflow_class.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/workflow/test_workflow_models.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/workflow/test_workflow_reliability.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/workflow/test_workflow_runner.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/workflow/test_workflow_schema.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/workflow/test_workflow_steps.py +0 -0
- {agentbyte-0.51.0 → agentbyte-0.52.0}/tests/workflow/test_workflow_visualizer.py +0 -0
|
@@ -6,6 +6,40 @@ The format follows Keep a Changelog principles and semantic versioning.
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.52.0] - 2026-10-10
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `AnthropicChatCompletionClient`: direct Anthropic Claude chat client (`agentbyte[anthropic]`),
|
|
14
|
+
matching the existing `OpenAIChatCompletionClient` construction/DI/retry/pricing/error-mapping
|
|
15
|
+
contract (`from_api_key()`, `_to_config`/`_from_config` without persisting secrets, tool-use,
|
|
16
|
+
streaming).
|
|
17
|
+
- `AnthropicBedrockChatCompletionClient`: the same Claude Messages API client transported through
|
|
18
|
+
AWS Bedrock (`agentbyte[bedrock]`) via `AsyncAnthropicBedrock` (SigV4, boto3 credential chain),
|
|
19
|
+
constructed with `from_region()`. Shares conversion/parsing logic with the direct client through
|
|
20
|
+
`AnthropicConversionMixin`.
|
|
21
|
+
- `CohereBedrockEmbeddingClient`: Cohere Embed v3 (English/Multilingual) and v4 embeddings via AWS
|
|
22
|
+
Bedrock Runtime (`agentbyte[aws]`, `aioboto3`), with `CohereInputType`/`CohereTruncate` options
|
|
23
|
+
and the same injected-or-fresh-client pattern as `dataset/s3.py`'s `s3_client()`.
|
|
24
|
+
- `build_chat_client` auto-detects `anthropic` (`ANTHROPIC_API_KEY`) and `anthropic-bedrock`
|
|
25
|
+
(`AWS_REGION` + `ANTHROPIC_BEDROCK_MODEL`) alongside the existing OpenAI/Azure detection.
|
|
26
|
+
- Pricing for Claude 5.5 (`claude-opus-5-5`, `claude-haiku-5-5`), Cohere Embed v3 (English/
|
|
27
|
+
Multilingual, estimate), and Cohere Embed v4 (verified against AWS Bedrock's own pricing page).
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- `AnthropicBedrockChatCompletionClient` was built on `AsyncAnthropicBedrockMantle`, a Bedrock
|
|
32
|
+
access path authenticated by a bearer token (`AWS_BEARER_TOKEN_BEDROCK`), not AWS IAM
|
|
33
|
+
credentials — every call 404'd with a misleading "model does not exist" error against a real
|
|
34
|
+
account. Caught by live smoke-testing against real Bedrock, invisible to the mocked unit tests.
|
|
35
|
+
Swapped to `AsyncAnthropicBedrock`, the real SigV4/boto3-credential-chain transport.
|
|
36
|
+
- The Bedrock Claude pricing normalizer didn't strip cross-region inference-profile prefixes
|
|
37
|
+
(`eu.`/`global.`, required for on-demand invoke on most accounts), silently falling back to
|
|
38
|
+
default pricing for real Bedrock calls.
|
|
39
|
+
- `CohereBedrockEmbeddingClient` read billed tokens from a response-body field that doesn't exist
|
|
40
|
+
on real Bedrock responses, so `tokens_input`/`cost_estimate` were silently always zero despite
|
|
41
|
+
successful calls. Now reads the real `x-amzn-bedrock-input-token-count` response header.
|
|
42
|
+
|
|
9
43
|
## [0.51.0] - 2026-10-09
|
|
10
44
|
|
|
11
45
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: agentbyte
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.52.0
|
|
4
4
|
Summary: A toolkit for designing multiagent systems
|
|
5
5
|
Author-email: MrDataPsycho <mr.data.psycho@gmail.com>
|
|
6
6
|
License-Expression: LicenseRef-Proprietary
|
|
@@ -17,6 +17,8 @@ Requires-Dist: uvicorn[standard]>=0.44.0; extra == 'a2a'
|
|
|
17
17
|
Provides-Extra: all
|
|
18
18
|
Requires-Dist: aioboto3>=15.5.0; extra == 'all'
|
|
19
19
|
Requires-Dist: aiosqlite>=0.22.1; extra == 'all'
|
|
20
|
+
Requires-Dist: anthropic>=1.13.0; extra == 'all'
|
|
21
|
+
Requires-Dist: anthropic[bedrock]>=1.13.0; extra == 'all'
|
|
20
22
|
Requires-Dist: arxiv>=2.1; extra == 'all'
|
|
21
23
|
Requires-Dist: asyncpg>=0.31.0; extra == 'all'
|
|
22
24
|
Requires-Dist: azure-identity>=1.25.1; extra == 'all'
|
|
@@ -35,11 +37,15 @@ Requires-Dist: sqlmodel>=0.0.38; extra == 'all'
|
|
|
35
37
|
Requires-Dist: tiktoken>=0.9.0; extra == 'all'
|
|
36
38
|
Requires-Dist: uvicorn[standard]>=0.44.0; extra == 'all'
|
|
37
39
|
Requires-Dist: youtube-transcript-api>=0.6; extra == 'all'
|
|
40
|
+
Provides-Extra: anthropic
|
|
41
|
+
Requires-Dist: anthropic>=1.13.0; extra == 'anthropic'
|
|
38
42
|
Provides-Extra: aws
|
|
39
43
|
Requires-Dist: aioboto3>=15.5.0; extra == 'aws'
|
|
40
44
|
Provides-Extra: azureopenai
|
|
41
45
|
Requires-Dist: azure-identity>=1.25.1; extra == 'azureopenai'
|
|
42
46
|
Requires-Dist: openai>=1.107.1; extra == 'azureopenai'
|
|
47
|
+
Provides-Extra: bedrock
|
|
48
|
+
Requires-Dist: anthropic[bedrock]>=1.13.0; extra == 'bedrock'
|
|
43
49
|
Provides-Extra: gunicorn
|
|
44
50
|
Requires-Dist: fastapi>=0.135.2; extra == 'gunicorn'
|
|
45
51
|
Requires-Dist: gunicorn>=23.0.0; extra == 'gunicorn'
|
|
@@ -333,7 +339,9 @@ uv add "agentbyte[openai,sqlite]"
|
|
|
333
339
|
| --- | --- | --- |
|
|
334
340
|
| `openai` | `openai` | `OpenAIChatCompletionClient`, `OpenAIEmbeddingClient` |
|
|
335
341
|
| `azureopenai` | `openai`, `azure-identity` | Azure OpenAI clients and Entra ID credentials |
|
|
336
|
-
| `
|
|
342
|
+
| `anthropic` | `anthropic` | Direct Anthropic Claude chat client |
|
|
343
|
+
| `bedrock` | `anthropic[bedrock]` | Anthropic Claude chat through AWS Bedrock |
|
|
344
|
+
| `aws` | `aioboto3` | S3 dataset I/O and Cohere Bedrock embedding client |
|
|
337
345
|
| `otel` | OpenTelemetry API, SDK, OTLP exporter | OpenTelemetry tracing and metrics |
|
|
338
346
|
| `webui` | `fastapi`, `uvicorn` | `agentbyte webui` |
|
|
339
347
|
| `gunicorn` | `webui` + `gunicorn` | Production single-worker serving (`gunicorn -k uvicorn.workers.UvicornWorker -w 1`) |
|
|
@@ -251,7 +251,9 @@ uv add "agentbyte[openai,sqlite]"
|
|
|
251
251
|
| --- | --- | --- |
|
|
252
252
|
| `openai` | `openai` | `OpenAIChatCompletionClient`, `OpenAIEmbeddingClient` |
|
|
253
253
|
| `azureopenai` | `openai`, `azure-identity` | Azure OpenAI clients and Entra ID credentials |
|
|
254
|
-
| `
|
|
254
|
+
| `anthropic` | `anthropic` | Direct Anthropic Claude chat client |
|
|
255
|
+
| `bedrock` | `anthropic[bedrock]` | Anthropic Claude chat through AWS Bedrock |
|
|
256
|
+
| `aws` | `aioboto3` | S3 dataset I/O and Cohere Bedrock embedding client |
|
|
255
257
|
| `otel` | OpenTelemetry API, SDK, OTLP exporter | OpenTelemetry tracing and metrics |
|
|
256
258
|
| `webui` | `fastapi`, `uvicorn` | `agentbyte webui` |
|
|
257
259
|
| `gunicorn` | `webui` + `gunicorn` | Production single-worker serving (`gunicorn -k uvicorn.workers.UvicornWorker -w 1`) |
|
|
@@ -24,6 +24,16 @@ azureopenai = [
|
|
|
24
24
|
"openai>=1.107.1",
|
|
25
25
|
"azure-identity>=1.25.1",
|
|
26
26
|
]
|
|
27
|
+
anthropic = [
|
|
28
|
+
"anthropic>=1.13.0",
|
|
29
|
+
]
|
|
30
|
+
# anthropic[bedrock] does its own AWS SigV4 signing via AnthropicBedrock*; deliberately
|
|
31
|
+
# not named "aws" (that extra is aioboto3, which this one does not need).
|
|
32
|
+
bedrock = [
|
|
33
|
+
"anthropic[bedrock]>=1.13.0",
|
|
34
|
+
]
|
|
35
|
+
# aioboto3 for AWS I/O: S3 dataset access (dataset/s3.py) and Bedrock Runtime
|
|
36
|
+
# (llm/bedrock/, e.g. CohereBedrockEmbeddingClient).
|
|
27
37
|
aws = [
|
|
28
38
|
"aioboto3>=15.5.0",
|
|
29
39
|
]
|
|
@@ -76,7 +86,7 @@ a2a = [
|
|
|
76
86
|
"agentbyte[webui]",
|
|
77
87
|
]
|
|
78
88
|
all = [
|
|
79
|
-
"agentbyte[openai,azureopenai,aws,otel,webui,gunicorn,sql,tiktoken,optim,viz,research]",
|
|
89
|
+
"agentbyte[openai,azureopenai,anthropic,bedrock,aws,otel,webui,gunicorn,sql,tiktoken,optim,viz,research]",
|
|
80
90
|
]
|
|
81
91
|
|
|
82
92
|
|
|
@@ -69,6 +69,8 @@ __all__ = [
|
|
|
69
69
|
"AzureOpenAIChatCompletionClientConfig",
|
|
70
70
|
"AzureOpenAIEmbeddingClient",
|
|
71
71
|
"AzureOpenAIEmbeddingClientConfig",
|
|
72
|
+
"AnthropicChatCompletionClient",
|
|
73
|
+
"AnthropicChatCompletionClientConfig",
|
|
72
74
|
# Authentication utilities
|
|
73
75
|
"get_default_token_provider",
|
|
74
76
|
"get_certificate_token_provider",
|
|
@@ -77,6 +79,12 @@ __all__ = [
|
|
|
77
79
|
"OpenAISettings",
|
|
78
80
|
"AzureOpenAISettings",
|
|
79
81
|
"AzureServicePrincipalSettings",
|
|
82
|
+
"AnthropicSettings",
|
|
83
|
+
"AnthropicBedrockChatCompletionClient",
|
|
84
|
+
"AnthropicBedrockChatCompletionClientConfig",
|
|
85
|
+
"CohereBedrockEmbeddingClient",
|
|
86
|
+
"CohereBedrockEmbeddingClientConfig",
|
|
87
|
+
"BedrockSettings",
|
|
80
88
|
# Retry policy
|
|
81
89
|
"RetryPolicy",
|
|
82
90
|
# Exception types
|
|
@@ -123,9 +131,22 @@ if TYPE_CHECKING: # editors and type checkers see the provider classes eagerly
|
|
|
123
131
|
OpenAIEmbeddingClientConfig,
|
|
124
132
|
OpenAISettings,
|
|
125
133
|
)
|
|
134
|
+
from .anthropic import (
|
|
135
|
+
AnthropicChatCompletionClient,
|
|
136
|
+
AnthropicChatCompletionClientConfig,
|
|
137
|
+
AnthropicSettings,
|
|
138
|
+
)
|
|
139
|
+
from .bedrock import (
|
|
140
|
+
AnthropicBedrockChatCompletionClient,
|
|
141
|
+
AnthropicBedrockChatCompletionClientConfig,
|
|
142
|
+
BedrockSettings,
|
|
143
|
+
CohereBedrockEmbeddingClient,
|
|
144
|
+
CohereBedrockEmbeddingClientConfig,
|
|
145
|
+
)
|
|
126
146
|
|
|
127
|
-
# Provider clients need optional extras (``openai``, ``azureopenai``);
|
|
128
|
-
# imported on first access so ``import agentbyte`` works with core
|
|
147
|
+
# Provider clients need optional extras (``openai``, ``azureopenai``, ``anthropic``);
|
|
148
|
+
# they are imported on first access so ``import agentbyte`` works with core
|
|
149
|
+
# dependencies only.
|
|
129
150
|
_PROVIDER_EXPORTS = {
|
|
130
151
|
"OpenAIChatCompletionClient": ".openai",
|
|
131
152
|
"OpenAIChatCompletionClientConfig": ".openai",
|
|
@@ -141,6 +162,25 @@ _PROVIDER_EXPORTS = {
|
|
|
141
162
|
"create_token_provider_from_string": ".azure",
|
|
142
163
|
"AzureOpenAISettings": ".azure",
|
|
143
164
|
"AzureServicePrincipalSettings": ".azure",
|
|
165
|
+
"AnthropicChatCompletionClient": ".anthropic",
|
|
166
|
+
"AnthropicChatCompletionClientConfig": ".anthropic",
|
|
167
|
+
"AnthropicSettings": ".anthropic",
|
|
168
|
+
"AnthropicBedrockChatCompletionClient": ".bedrock",
|
|
169
|
+
"AnthropicBedrockChatCompletionClientConfig": ".bedrock",
|
|
170
|
+
"CohereBedrockEmbeddingClient": ".bedrock",
|
|
171
|
+
"CohereBedrockEmbeddingClientConfig": ".bedrock",
|
|
172
|
+
"BedrockSettings": ".bedrock",
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
_PROVIDER_EXTRAS = {
|
|
176
|
+
".openai": ("openai", "openai"),
|
|
177
|
+
".azure": ("openai", "azureopenai"),
|
|
178
|
+
".anthropic": ("anthropic", "anthropic"),
|
|
179
|
+
# `.bedrock` is intentionally absent: its two clients need different extras
|
|
180
|
+
# (`anthropic[bedrock]` vs. `aioboto3`/`aws`), so `llm/bedrock/__init__.py`
|
|
181
|
+
# does its own fine-grained, per-symbol `require()` check instead -- a
|
|
182
|
+
# single module-level check here would wrongly demand both extras for
|
|
183
|
+
# either client.
|
|
144
184
|
}
|
|
145
185
|
|
|
146
186
|
|
|
@@ -150,9 +190,12 @@ def __getattr__(name: str):
|
|
|
150
190
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
151
191
|
from importlib import import_module
|
|
152
192
|
|
|
153
|
-
|
|
193
|
+
extra_spec = _PROVIDER_EXTRAS.get(module_name)
|
|
194
|
+
if extra_spec is not None:
|
|
195
|
+
from agentbyte._optional import require
|
|
154
196
|
|
|
155
|
-
|
|
197
|
+
required_module, extra = extra_spec
|
|
198
|
+
require(required_module, extra=extra, feature=name)
|
|
156
199
|
value = getattr(import_module(module_name, __name__), name)
|
|
157
200
|
globals()[name] = value
|
|
158
201
|
return value
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""Anthropic provider package."""
|
|
2
|
+
|
|
3
|
+
from .chat import AnthropicChatCompletionClient, AnthropicChatCompletionClientConfig
|
|
4
|
+
from .settings import AnthropicSettings
|
|
5
|
+
|
|
6
|
+
__all__ = [
|
|
7
|
+
"AnthropicChatCompletionClient",
|
|
8
|
+
"AnthropicChatCompletionClientConfig",
|
|
9
|
+
"AnthropicSettings",
|
|
10
|
+
]
|
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Shared Anthropic Messages API conversion/parsing logic.
|
|
3
|
+
|
|
4
|
+
Both `AnthropicChatCompletionClient` (direct API) and
|
|
5
|
+
`AnthropicBedrockChatCompletionClient` (Bedrock transport via
|
|
6
|
+
`AsyncAnthropicBedrock`) ride the identical wire format -- same
|
|
7
|
+
`.messages.create()`/`.messages.create(stream=True)` surface, same `Message`,
|
|
8
|
+
`Usage`, and stream-event shapes. This mixin owns everything that depends only
|
|
9
|
+
on that wire format, not on how the client authenticates or which SDK class is
|
|
10
|
+
injected. Transport-specific concerns (`__init__`, `from_*` construction,
|
|
11
|
+
`_estimate_cost`, `_to_config`/`_from_config`) stay on each concrete client.
|
|
12
|
+
|
|
13
|
+
A consuming class must also provide: `self.client` (an object exposing
|
|
14
|
+
`.messages.create()`), `self.model`, `self.config`, `self._estimate_cost(...)`,
|
|
15
|
+
and (via `RetryMixin`) `self._retry_with_backoff`/`self._retry_stream_with_backoff`.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
import logging
|
|
19
|
+
import time
|
|
20
|
+
from collections.abc import AsyncGenerator
|
|
21
|
+
from typing import Any, Dict, List, Optional
|
|
22
|
+
|
|
23
|
+
from agentbyte.messages import (
|
|
24
|
+
AssistantMessage,
|
|
25
|
+
Message,
|
|
26
|
+
MultiModalMessage,
|
|
27
|
+
SystemMessage,
|
|
28
|
+
ToolCallRequest,
|
|
29
|
+
ToolMessage,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
from .._retry_observability import build_retry_summary
|
|
33
|
+
from ..types import (
|
|
34
|
+
ChatCompletionChunk,
|
|
35
|
+
ChatCompletionResult,
|
|
36
|
+
ModelClientError,
|
|
37
|
+
Usage,
|
|
38
|
+
)
|
|
39
|
+
from ..base import AuthenticationError, InvalidRequestError, RateLimitError
|
|
40
|
+
|
|
41
|
+
logger = logging.getLogger(__name__)
|
|
42
|
+
|
|
43
|
+
# The Messages API requires max_tokens; OpenAI's Chat Completions API does not.
|
|
44
|
+
DEFAULT_MAX_TOKENS = 4096
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class AnthropicConversionMixin:
|
|
48
|
+
"""Messages API request/response conversion shared by both Claude transports."""
|
|
49
|
+
|
|
50
|
+
async def create(
|
|
51
|
+
self,
|
|
52
|
+
messages: List[Message],
|
|
53
|
+
tools: Optional[List[Dict[str, Any]]] = None,
|
|
54
|
+
output_format: Optional[type] = None,
|
|
55
|
+
**kwargs: Any,
|
|
56
|
+
) -> ChatCompletionResult:
|
|
57
|
+
"""Make a single Anthropic Messages API call."""
|
|
58
|
+
retry_history: List = []
|
|
59
|
+
try:
|
|
60
|
+
result = await self._retry_with_backoff(
|
|
61
|
+
self._create_internal,
|
|
62
|
+
messages,
|
|
63
|
+
tools,
|
|
64
|
+
output_format,
|
|
65
|
+
_retry_history=retry_history,
|
|
66
|
+
**kwargs,
|
|
67
|
+
)
|
|
68
|
+
if retry_history:
|
|
69
|
+
result.metadata["retry_observability"] = {
|
|
70
|
+
"history": retry_history,
|
|
71
|
+
"latest": build_retry_summary(retry_history),
|
|
72
|
+
}
|
|
73
|
+
return result
|
|
74
|
+
except Exception as e:
|
|
75
|
+
if retry_history:
|
|
76
|
+
logger.warning(
|
|
77
|
+
"LLM call failed after retries for model=%s: %s",
|
|
78
|
+
self.model,
|
|
79
|
+
build_retry_summary(retry_history),
|
|
80
|
+
)
|
|
81
|
+
self._handle_error(e)
|
|
82
|
+
|
|
83
|
+
async def _create_internal(
|
|
84
|
+
self,
|
|
85
|
+
messages: List[Message],
|
|
86
|
+
tools: Optional[List[Dict[str, Any]]] = None,
|
|
87
|
+
output_format: Optional[type] = None,
|
|
88
|
+
**kwargs: Any,
|
|
89
|
+
) -> ChatCompletionResult:
|
|
90
|
+
"""Internal create implementation (retried by wrapper)."""
|
|
91
|
+
api_kwargs = {**self.config, **kwargs}
|
|
92
|
+
api_kwargs.setdefault("max_tokens", DEFAULT_MAX_TOKENS)
|
|
93
|
+
|
|
94
|
+
system = self._extract_system(messages)
|
|
95
|
+
if system is not None:
|
|
96
|
+
api_kwargs["system"] = system
|
|
97
|
+
|
|
98
|
+
api_messages = self._convert_messages_to_api_format(messages)
|
|
99
|
+
api_tools = self._convert_tools(tools)
|
|
100
|
+
if api_tools:
|
|
101
|
+
api_kwargs["tools"] = api_tools
|
|
102
|
+
|
|
103
|
+
start_time = time.perf_counter()
|
|
104
|
+
response = await self.client.messages.create(
|
|
105
|
+
model=self.model,
|
|
106
|
+
messages=api_messages,
|
|
107
|
+
**api_kwargs,
|
|
108
|
+
)
|
|
109
|
+
duration_ms = int((time.perf_counter() - start_time) * 1000)
|
|
110
|
+
|
|
111
|
+
message_content, tool_calls = self._split_content_blocks(response.content)
|
|
112
|
+
|
|
113
|
+
structured_output = None
|
|
114
|
+
if output_format and message_content:
|
|
115
|
+
try:
|
|
116
|
+
structured_output = output_format.model_validate_json(message_content)
|
|
117
|
+
except Exception as e:
|
|
118
|
+
logger.warning(f"Failed to parse structured output: {e}. Using raw content.")
|
|
119
|
+
|
|
120
|
+
cached_tokens = response.usage.cache_read_input_tokens or 0
|
|
121
|
+
|
|
122
|
+
return ChatCompletionResult(
|
|
123
|
+
message=AssistantMessage(
|
|
124
|
+
content=message_content,
|
|
125
|
+
source=self.model,
|
|
126
|
+
tool_calls=tool_calls,
|
|
127
|
+
),
|
|
128
|
+
usage=Usage(
|
|
129
|
+
duration_ms=duration_ms,
|
|
130
|
+
llm_calls=1,
|
|
131
|
+
tokens_input=response.usage.input_tokens,
|
|
132
|
+
tokens_output=response.usage.output_tokens,
|
|
133
|
+
tokens_cached=cached_tokens,
|
|
134
|
+
tool_calls=len(tool_calls) if tool_calls else 0,
|
|
135
|
+
cost_estimate=self._estimate_cost(
|
|
136
|
+
response.usage.input_tokens,
|
|
137
|
+
response.usage.output_tokens,
|
|
138
|
+
cached_tokens,
|
|
139
|
+
),
|
|
140
|
+
),
|
|
141
|
+
model=response.model,
|
|
142
|
+
metadata={"finish_reason": response.stop_reason},
|
|
143
|
+
finish_reason=response.stop_reason,
|
|
144
|
+
structured_output=structured_output,
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
async def create_stream(
|
|
148
|
+
self,
|
|
149
|
+
messages: List[Message],
|
|
150
|
+
tools: Optional[List[Dict[str, Any]]] = None,
|
|
151
|
+
output_format: Optional[type] = None,
|
|
152
|
+
stream_options: Optional[Dict[str, Any]] = None,
|
|
153
|
+
**kwargs: Any,
|
|
154
|
+
) -> AsyncGenerator[ChatCompletionChunk, None]:
|
|
155
|
+
"""Make a streaming Anthropic Messages API call."""
|
|
156
|
+
try:
|
|
157
|
+
async for chunk in self._retry_stream_with_backoff(
|
|
158
|
+
self._create_stream_internal,
|
|
159
|
+
messages,
|
|
160
|
+
tools,
|
|
161
|
+
output_format,
|
|
162
|
+
stream_options,
|
|
163
|
+
**kwargs,
|
|
164
|
+
):
|
|
165
|
+
yield chunk
|
|
166
|
+
except Exception as e:
|
|
167
|
+
self._handle_error(e)
|
|
168
|
+
|
|
169
|
+
async def _create_stream_internal(
|
|
170
|
+
self,
|
|
171
|
+
messages: List[Message],
|
|
172
|
+
tools: Optional[List[Dict[str, Any]]] = None,
|
|
173
|
+
output_format: Optional[type] = None,
|
|
174
|
+
stream_options: Optional[Dict[str, Any]] = None,
|
|
175
|
+
**kwargs: Any,
|
|
176
|
+
) -> AsyncGenerator[ChatCompletionChunk, None]:
|
|
177
|
+
"""Internal streaming implementation (retried by wrapper)."""
|
|
178
|
+
api_kwargs = {**self.config, **kwargs}
|
|
179
|
+
api_kwargs.pop("stream_options", None)
|
|
180
|
+
api_kwargs.setdefault("max_tokens", DEFAULT_MAX_TOKENS)
|
|
181
|
+
|
|
182
|
+
system = self._extract_system(messages)
|
|
183
|
+
if system is not None:
|
|
184
|
+
api_kwargs["system"] = system
|
|
185
|
+
|
|
186
|
+
api_messages = self._convert_messages_to_api_format(messages)
|
|
187
|
+
api_tools = self._convert_tools(tools)
|
|
188
|
+
if api_tools:
|
|
189
|
+
api_kwargs["tools"] = api_tools
|
|
190
|
+
|
|
191
|
+
start_time = time.perf_counter()
|
|
192
|
+
stream = await self.client.messages.create(
|
|
193
|
+
model=self.model,
|
|
194
|
+
messages=api_messages,
|
|
195
|
+
stream=True,
|
|
196
|
+
**api_kwargs,
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
model_name = self.model
|
|
200
|
+
# Anthropic's input_json_delta streams raw JSON-fragment text per
|
|
201
|
+
# content-block index, the same accumulator shape openai/chat.py uses
|
|
202
|
+
# for streamed tool-call arguments.
|
|
203
|
+
tool_call_chunks: Dict[int, Dict[str, Any]] = {}
|
|
204
|
+
|
|
205
|
+
async for event in stream:
|
|
206
|
+
if event.type == "message_start":
|
|
207
|
+
model_name = event.message.model
|
|
208
|
+
continue
|
|
209
|
+
|
|
210
|
+
if event.type == "content_block_start":
|
|
211
|
+
if event.content_block.type == "tool_use":
|
|
212
|
+
tool_call_chunks[event.index] = {
|
|
213
|
+
"id": event.content_block.id,
|
|
214
|
+
"function": {"name": event.content_block.name, "arguments": ""},
|
|
215
|
+
}
|
|
216
|
+
yield ChatCompletionChunk(
|
|
217
|
+
content="",
|
|
218
|
+
model=model_name,
|
|
219
|
+
is_complete=False,
|
|
220
|
+
tool_call_chunk=tool_call_chunks[event.index],
|
|
221
|
+
usage=None,
|
|
222
|
+
metadata={},
|
|
223
|
+
)
|
|
224
|
+
continue
|
|
225
|
+
|
|
226
|
+
if event.type == "content_block_delta":
|
|
227
|
+
if event.delta.type == "text_delta":
|
|
228
|
+
yield ChatCompletionChunk(
|
|
229
|
+
content=event.delta.text,
|
|
230
|
+
model=model_name,
|
|
231
|
+
is_complete=False,
|
|
232
|
+
tool_call_chunk=None,
|
|
233
|
+
usage=None,
|
|
234
|
+
metadata={},
|
|
235
|
+
)
|
|
236
|
+
elif event.delta.type == "input_json_delta":
|
|
237
|
+
chunk_state = tool_call_chunks.get(event.index)
|
|
238
|
+
if chunk_state is not None:
|
|
239
|
+
chunk_state["function"]["arguments"] += event.delta.partial_json
|
|
240
|
+
yield ChatCompletionChunk(
|
|
241
|
+
content="",
|
|
242
|
+
model=model_name,
|
|
243
|
+
is_complete=False,
|
|
244
|
+
tool_call_chunk=chunk_state,
|
|
245
|
+
usage=None,
|
|
246
|
+
metadata={},
|
|
247
|
+
)
|
|
248
|
+
continue
|
|
249
|
+
|
|
250
|
+
if event.type == "message_delta":
|
|
251
|
+
duration_ms = int((time.perf_counter() - start_time) * 1000)
|
|
252
|
+
input_tokens = event.usage.input_tokens or 0
|
|
253
|
+
output_tokens = event.usage.output_tokens or 0
|
|
254
|
+
cached_tokens = event.usage.cache_read_input_tokens or 0
|
|
255
|
+
usage = Usage(
|
|
256
|
+
duration_ms=duration_ms,
|
|
257
|
+
llm_calls=1,
|
|
258
|
+
tokens_input=input_tokens,
|
|
259
|
+
tokens_output=output_tokens,
|
|
260
|
+
tokens_cached=cached_tokens,
|
|
261
|
+
cost_estimate=self._estimate_cost(input_tokens, output_tokens, cached_tokens),
|
|
262
|
+
)
|
|
263
|
+
yield ChatCompletionChunk(
|
|
264
|
+
content="",
|
|
265
|
+
model=model_name,
|
|
266
|
+
is_complete=True,
|
|
267
|
+
tool_call_chunk=None,
|
|
268
|
+
usage=usage,
|
|
269
|
+
metadata={"finish_reason": event.delta.stop_reason},
|
|
270
|
+
)
|
|
271
|
+
continue
|
|
272
|
+
|
|
273
|
+
@staticmethod
|
|
274
|
+
def _extract_system(messages: List[Message]) -> Optional[str]:
|
|
275
|
+
"""Pull SystemMessages out as Anthropic's top-level `system` param."""
|
|
276
|
+
system_parts = [m.content for m in messages if isinstance(m, SystemMessage)]
|
|
277
|
+
return "\n\n".join(system_parts) if system_parts else None
|
|
278
|
+
|
|
279
|
+
def _convert_messages_to_api_format(self, messages: List[Message]) -> List[Dict[str, Any]]:
|
|
280
|
+
"""
|
|
281
|
+
Convert Agentbyte messages to Anthropic's role/content-block format.
|
|
282
|
+
|
|
283
|
+
SystemMessages are excluded here (pulled out via `_extract_system`).
|
|
284
|
+
Adjacent same-role entries are merged into one message, because a turn
|
|
285
|
+
with multiple tool calls produces one ToolMessage per call and Anthropic
|
|
286
|
+
requires them as content blocks on a single "user" message, not several
|
|
287
|
+
consecutive "user" messages.
|
|
288
|
+
"""
|
|
289
|
+
api_messages: List[Dict[str, Any]] = []
|
|
290
|
+
for message in messages:
|
|
291
|
+
if isinstance(message, SystemMessage):
|
|
292
|
+
continue
|
|
293
|
+
role, blocks = self._message_to_blocks(message)
|
|
294
|
+
if api_messages and api_messages[-1]["role"] == role:
|
|
295
|
+
api_messages[-1]["content"].extend(blocks)
|
|
296
|
+
else:
|
|
297
|
+
api_messages.append({"role": role, "content": blocks})
|
|
298
|
+
return api_messages
|
|
299
|
+
|
|
300
|
+
@staticmethod
|
|
301
|
+
def _message_to_blocks(message: Message) -> "tuple[str, List[Dict[str, Any]]]":
|
|
302
|
+
"""Convert one Agentbyte message into (role, content_blocks)."""
|
|
303
|
+
if isinstance(message, ToolMessage):
|
|
304
|
+
# Tool results are a "user" turn in the Messages API, not a "tool" role.
|
|
305
|
+
return "user", [
|
|
306
|
+
{
|
|
307
|
+
"type": "tool_result",
|
|
308
|
+
"tool_use_id": message.tool_call_id,
|
|
309
|
+
"content": message.content,
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
|
|
313
|
+
role = message.role.value if hasattr(message.role, "value") else message.role
|
|
314
|
+
|
|
315
|
+
if isinstance(message, MultiModalMessage):
|
|
316
|
+
blocks: List[Dict[str, Any]] = []
|
|
317
|
+
if message.content:
|
|
318
|
+
blocks.append({"type": "text", "text": message.content})
|
|
319
|
+
if message.is_image():
|
|
320
|
+
if message.media_url:
|
|
321
|
+
blocks.append(
|
|
322
|
+
{"type": "image", "source": {"type": "url", "url": message.media_url}}
|
|
323
|
+
)
|
|
324
|
+
elif message.data is not None:
|
|
325
|
+
base64_data = message.to_base64()
|
|
326
|
+
if base64_data:
|
|
327
|
+
blocks.append(
|
|
328
|
+
{
|
|
329
|
+
"type": "image",
|
|
330
|
+
"source": {
|
|
331
|
+
"type": "base64",
|
|
332
|
+
"media_type": message.mime_type,
|
|
333
|
+
"data": base64_data,
|
|
334
|
+
},
|
|
335
|
+
}
|
|
336
|
+
)
|
|
337
|
+
elif message.is_text() and message.data is not None:
|
|
338
|
+
data_text = (
|
|
339
|
+
message.data.decode("utf-8", errors="ignore")
|
|
340
|
+
if isinstance(message.data, bytes)
|
|
341
|
+
else message.data
|
|
342
|
+
)
|
|
343
|
+
if data_text and data_text != message.content:
|
|
344
|
+
blocks.append({"type": "text", "text": data_text})
|
|
345
|
+
return role, blocks or [{"type": "text", "text": message.content or ""}]
|
|
346
|
+
|
|
347
|
+
if isinstance(message, AssistantMessage) and message.tool_calls:
|
|
348
|
+
blocks = []
|
|
349
|
+
if message.content:
|
|
350
|
+
blocks.append({"type": "text", "text": message.content})
|
|
351
|
+
blocks.extend(
|
|
352
|
+
{
|
|
353
|
+
"type": "tool_use",
|
|
354
|
+
"id": tc.call_id,
|
|
355
|
+
"name": tc.tool_name,
|
|
356
|
+
"input": tc.parameters,
|
|
357
|
+
}
|
|
358
|
+
for tc in message.tool_calls
|
|
359
|
+
)
|
|
360
|
+
return role, blocks
|
|
361
|
+
|
|
362
|
+
return role, [{"type": "text", "text": message.content or ""}]
|
|
363
|
+
|
|
364
|
+
@staticmethod
|
|
365
|
+
def _convert_tools(
|
|
366
|
+
tools: Optional[List[Dict[str, Any]]],
|
|
367
|
+
) -> Optional[List[Dict[str, Any]]]:
|
|
368
|
+
"""Convert OpenAI-shaped tool schemas to Anthropic's flat tool shape."""
|
|
369
|
+
if not tools:
|
|
370
|
+
return None
|
|
371
|
+
converted = []
|
|
372
|
+
for tool in tools:
|
|
373
|
+
function = tool.get("function", tool)
|
|
374
|
+
converted.append(
|
|
375
|
+
{
|
|
376
|
+
"name": function["name"],
|
|
377
|
+
"description": function.get("description", ""),
|
|
378
|
+
"input_schema": function.get(
|
|
379
|
+
"parameters", {"type": "object", "properties": {}}
|
|
380
|
+
),
|
|
381
|
+
}
|
|
382
|
+
)
|
|
383
|
+
return converted
|
|
384
|
+
|
|
385
|
+
@staticmethod
|
|
386
|
+
def _split_content_blocks(
|
|
387
|
+
content_blocks: Any,
|
|
388
|
+
) -> "tuple[str, Optional[List[ToolCallRequest]]]":
|
|
389
|
+
"""Split a Messages API response's content blocks into (text, tool_calls)."""
|
|
390
|
+
text_parts: List[str] = []
|
|
391
|
+
tool_calls: List[ToolCallRequest] = []
|
|
392
|
+
for block in content_blocks:
|
|
393
|
+
if block.type == "text":
|
|
394
|
+
text_parts.append(block.text)
|
|
395
|
+
elif block.type == "tool_use":
|
|
396
|
+
tool_calls.append(
|
|
397
|
+
ToolCallRequest(
|
|
398
|
+
call_id=block.id,
|
|
399
|
+
tool_name=block.name,
|
|
400
|
+
parameters=block.input,
|
|
401
|
+
)
|
|
402
|
+
)
|
|
403
|
+
return "".join(text_parts), (tool_calls or None)
|
|
404
|
+
|
|
405
|
+
def _handle_error(self, error: Exception) -> None:
|
|
406
|
+
"""Convert Anthropic exceptions to the unified error hierarchy.
|
|
407
|
+
|
|
408
|
+
Shared by both transports: Bedrock's `AsyncAnthropicBedrock` client is
|
|
409
|
+
a thin SigV4 transport swap over the same SDK, and still raises the
|
|
410
|
+
same typed `anthropic.*Error` classes as the direct client.
|
|
411
|
+
"""
|
|
412
|
+
try:
|
|
413
|
+
from anthropic import (
|
|
414
|
+
RateLimitError as AnthropicRateLimitError,
|
|
415
|
+
AuthenticationError as AnthropicAuthenticationError,
|
|
416
|
+
BadRequestError,
|
|
417
|
+
APIError,
|
|
418
|
+
)
|
|
419
|
+
except ImportError:
|
|
420
|
+
raise ModelClientError(f"Anthropic error: {str(error)}") from error
|
|
421
|
+
|
|
422
|
+
error_msg = str(error)
|
|
423
|
+
error_type = type(error).__name__
|
|
424
|
+
|
|
425
|
+
if isinstance(error, AnthropicRateLimitError):
|
|
426
|
+
raise RateLimitError(f"Anthropic rate limit exceeded: {error_msg}") from error
|
|
427
|
+
elif isinstance(error, AnthropicAuthenticationError):
|
|
428
|
+
raise AuthenticationError(f"Anthropic authentication failed: {error_msg}") from error
|
|
429
|
+
elif isinstance(error, BadRequestError):
|
|
430
|
+
raise InvalidRequestError(f"Anthropic request invalid: {error_msg}") from error
|
|
431
|
+
elif isinstance(error, APIError):
|
|
432
|
+
raise ModelClientError(f"Anthropic API error ({error_type}): {error_msg}") from error
|
|
433
|
+
else:
|
|
434
|
+
raise ModelClientError(
|
|
435
|
+
f"Unexpected error from Anthropic ({error_type}): {error_msg}"
|
|
436
|
+
) from error
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
__all__ = ["AnthropicConversionMixin", "DEFAULT_MAX_TOKENS"]
|