aiecs 2.1.2__tar.gz → 2.2.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.
- {aiecs-2.1.2/aiecs.egg-info → aiecs-2.2.0}/PKG-INFO +1 -1
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/__init__.py +1 -1
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/base_agent.py +169 -3
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/hybrid_agent.py +220 -160
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/integration/retry_policy.py +50 -6
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/llm_agent.py +98 -71
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/tool_agent.py +401 -334
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/tool_loop_core.py +2 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/base_client.py +2 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/google_function_calling_mixin.py +26 -15
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/openai_client.py +99 -6
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/openrouter_client.py +2 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/vertex_client.py +34 -331
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/xai_client.py +2 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/main.py +2 -2
- {aiecs-2.1.2 → aiecs-2.2.0/aiecs.egg-info}/PKG-INFO +1 -1
- {aiecs-2.1.2 → aiecs-2.2.0}/pyproject.toml +2 -2
- {aiecs-2.1.2 → aiecs-2.2.0}/LICENSE +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/LICENSE_HEADER.txt +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/MANIFEST.in +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/README.md +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/__main__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/aiecs_client.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/application/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/application/executors/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/application/executors/operation_executor.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/common/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/config/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/config/config.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/config/skills_config.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/config/tool_config.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/core/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/core/interface/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/core/interface/execution_interface.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/core/interface/storage_interface.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/core/registry/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/core/registry/service_registry.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/exceptions.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/goal_graph.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/integration/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/integration/context_compressor.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/integration/context_engine_adapter.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/integration/protocols.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/integration/role_config.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/lifecycle.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/loop_detection.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/memory/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/memory/conversation.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/migration/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/migration/conversion.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/migration/legacy_wrapper.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/models.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/observability.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/persistence.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/base.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/collaboration_plugin.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/dawp_plugin.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/hook_plugin.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/knowledge_plugin.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/memory_plugin.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/skill_plugin.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/temporal_memory_plugin.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/tool_plugin.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/tools/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/tools/dawp_start_tool.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/context.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/budget.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/completion.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/document_loader.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/document_path_policy.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/enqueue_guard.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/inject.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/loop_scope.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/metrics.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/prompt_chain_runner.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/run_scheduler.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/schema.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/step_handlers.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/step_handoff.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/stream_consumer.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/suppress.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/temp_store.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/temporal_memory_context.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/tools_filter.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/workflow_registry.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/defaults.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/errors.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/bridge_compression.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/dispatch.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/events.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/executor.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/gvr_blocking.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/loader.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/notifications.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/payload.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/permission.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/prompt_client.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/registry.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/schemas.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/task_boundary.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/tool_dispatch.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/types.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/identifier.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/manager.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/manifest_loader.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/models.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/protocols.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/registry.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/schema/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/schema/dependency.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/schema/manifest.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/schema/validation.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/testing/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/testing/capture.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/testing/normalize.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/testing/parity.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/prompts/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/prompts/builder.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/prompts/formatters.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/prompts/template.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/registry.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/search_burst_guard.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/builtin/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/builtin/api-integration/examples/api-client-example.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/builtin/data-analysis/examples/analysis-example.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/builtin/data-analysis/scripts/validate-data.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/builtin/python-coding/examples/code-patterns.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/context.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/discovery.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/executor.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/loader.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/matcher.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/mixin.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/models.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/registry.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/validator.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/tool_result_matcher.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/tools/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/tools/models.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/tools/registry.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/tools/schema_generator.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/context_builder.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/criteria.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/cwe_verifier.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/cwe_verifier_policy_models.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/dawp_result.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gates/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gates/citation_url_gate.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gates/conversion.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gates/gate_criterion.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gates/models.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gates/protocol.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gates/registry.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gates/spec_gate.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gvr_checkpoints.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/models.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/peer_review.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/peer_review_policy_models.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/policy_models.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/policy_runner.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/read_only_verifier.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/review_refinement.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/verifier.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/agent_adapter.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/analytics.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/collaborative_workflow.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/communication_hub.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/community_builder.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/community_integration.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/community_manager.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/decision_engine.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/exceptions.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/models/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/models/community_models.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/resource_manager.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/shared_context_manager.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/adapters/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/adapters/conversation_message.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/adapters/llm_message.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/collapse.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/constants.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/gvr_preserve.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/hooks.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/images.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/legacy.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/llm_compact.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/metadata.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/microcompact.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/orchestrator.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/pairs.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/policy.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/policy_resolver.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/progress.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/ptl.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/result.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/session_memory.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/state.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/tokens.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/tool_budget.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/truncation.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/types.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/context_engine.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/conversation_models.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/execution/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/execution/model.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/memory/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/memory/models.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/memory/unified_retriever.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/task/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/task/dsl_processor.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/task/model.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/task/task_context.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/constants.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/engine.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/episode_bridge.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/group_id.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/models/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/models/episode.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/models/fact.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/pii.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/ports.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/search_cache.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/compression/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/compression/config.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/compression/l2_mc_adapter.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/compression/progress_bridge.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/compression/s3_tool_artifact_port.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/compression/transcript_compact.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/hooks/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/hooks/sse_bridge.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/knowledge/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/knowledge/graph_store_factory.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/knowledge/graph_store_protocol.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/knowledge/noop_graph_store.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/messaging/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/messaging/celery_task_manager.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/messaging/websocket_manager.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/monitoring/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/monitoring/executor_metrics.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/monitoring/global_metrics_manager.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/monitoring/structured_logger.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/monitoring/tracing_manager.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/clickhouse_client.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/clickhouse_permanent_backend.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/context_engine_client.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/database_manager.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/file_storage.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/permanent_backend_factory.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/permanent_backend_utils.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/postgres_permanent_backend.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/redis_client.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/graphiti/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/graphiti/llm_adapter.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/graphiti/search_filters.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/graphiti/store.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/ingest_queue.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/metrics.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/noop_store.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/postgres/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/postgres/store.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/store_factory.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/callbacks/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/callbacks/custom_callbacks.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/client_factory.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/client_resolver.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/anthropic_client.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/googleai_client.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/openai_compatible_mixin.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/schemas.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/vertex_maas_client.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/config/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/config/config_loader.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/config/config_validator.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/config/model_config.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/protocols.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/utils/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/utils/gcp_credentials.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/utils/image_utils.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/utils/validate_config.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/aid/VERSION_MANAGEMENT.md +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/aid/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/aid/module_checker.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/aid/version_manager.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/dependance_patch/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/dependance_patch/fix_weasel/README_WEASEL_PATCH.md +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/dependance_patch/fix_weasel/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/dependance_patch/fix_weasel/fix_weasel_validator.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/dependance_patch/fix_weasel/fix_weasel_validator.sh +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/dependance_patch/fix_weasel/patch_weasel_library.sh +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/dependance_patch/fix_weasel/run_weasel_patch.sh +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/migrations/multi_tenancy/README.md +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tasks/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tasks/worker.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/_builtin_tool_deprecation.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/base_tool.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/schema_generator.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/analyzers.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/_resilience_factory.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/async_bridge.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/credentials.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/gemini_grounding.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/google_cse.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/grok_grounding.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/protocol.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/registry.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/cache.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/cache_fingerprint.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/constants.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/context.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/core.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/deduplicator.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/error_handler.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/errors.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/metrics.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/normalizer.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/partition.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/rate_limiter.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/resilience.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/router.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/schemas.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/task_tools/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/task_tools/image_tool.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/temp_file_manager.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/tool_executor/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/tool_executor/tool_executor.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/utils/LLM_output_structor.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/utils/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/utils/base_callback.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/utils/cache_provider.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/utils/execution_utils.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/utils/logging.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/utils/prompt_loader.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/utils/token_usage_repository.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/ws/__init__.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/ws/socket_server.py +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs.egg-info/SOURCES.txt +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs.egg-info/dependency_links.txt +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs.egg-info/entry_points.txt +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs.egg-info/requires.txt +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/aiecs.egg-info/top_level.txt +0 -0
- {aiecs-2.1.2 → aiecs-2.2.0}/setup.cfg +0 -0
|
@@ -9,7 +9,7 @@ A powerful Python middleware framework for building AI-powered applications
|
|
|
9
9
|
with tool orchestration, task execution, and multi-provider LLM support.
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
|
-
__version__ = "2.
|
|
12
|
+
__version__ = "2.2.0"
|
|
13
13
|
__author__ = "AIECS Team"
|
|
14
14
|
__email__ = "iretbl@gmail.com"
|
|
15
15
|
|
|
@@ -910,6 +910,23 @@ class BaseAIAgent(SkillCapableMixin, ABC):
|
|
|
910
910
|
|
|
911
911
|
logger.info(f"Agent {self.agent_id} state: {self._previous_state.value} → {new_state.value}")
|
|
912
912
|
|
|
913
|
+
def _require_ready_for_task(self) -> None:
|
|
914
|
+
"""Refuse work when initialize() failed and the agent is still ERROR."""
|
|
915
|
+
if self._state == AgentState.ERROR:
|
|
916
|
+
raise TaskExecutionError(
|
|
917
|
+
"Agent is not ready: initialization failed or agent is in ERROR state",
|
|
918
|
+
agent_id=self.agent_id,
|
|
919
|
+
)
|
|
920
|
+
|
|
921
|
+
def _release_task(self, entered_busy: bool) -> None:
|
|
922
|
+
"""Return BUSY (or this task's ERROR) to ACTIVE and clear the current task id."""
|
|
923
|
+
if not entered_busy or self._state == AgentState.STOPPED:
|
|
924
|
+
return
|
|
925
|
+
self._current_task_id = None
|
|
926
|
+
if self._state in (AgentState.BUSY, AgentState.ERROR):
|
|
927
|
+
self._transition_state(AgentState.ACTIVE)
|
|
928
|
+
self.last_active_at = datetime.utcnow()
|
|
929
|
+
|
|
913
930
|
# ==================== Lifecycle Methods ====================
|
|
914
931
|
|
|
915
932
|
async def initialize(self) -> None:
|
|
@@ -1538,6 +1555,133 @@ class BaseAIAgent(SkillCapableMixin, ABC):
|
|
|
1538
1555
|
# Execute with retry
|
|
1539
1556
|
return await retry_policy.execute_with_retry(func, *args, **kwargs)
|
|
1540
1557
|
|
|
1558
|
+
def _resolved_llm_client(self) -> Optional["LLMClientProtocol"]:
|
|
1559
|
+
return getattr(self, "llm_client", None) or self._llm_client
|
|
1560
|
+
|
|
1561
|
+
def _agent_retry_policy(self):
|
|
1562
|
+
from .integration.retry_policy import EnhancedRetryPolicy
|
|
1563
|
+
|
|
1564
|
+
retry_config = self._config.retry_policy
|
|
1565
|
+
return EnhancedRetryPolicy(
|
|
1566
|
+
max_retries=retry_config.max_retries,
|
|
1567
|
+
base_delay=retry_config.base_delay,
|
|
1568
|
+
max_delay=retry_config.max_delay,
|
|
1569
|
+
exponential_base=retry_config.exponential_factor,
|
|
1570
|
+
jitter_factor=retry_config.jitter_factor,
|
|
1571
|
+
)
|
|
1572
|
+
|
|
1573
|
+
def _build_llm_call_kwargs(
|
|
1574
|
+
self,
|
|
1575
|
+
messages: List[Any],
|
|
1576
|
+
context: Dict[str, Any],
|
|
1577
|
+
extra: Optional[Dict[str, Any]] = None,
|
|
1578
|
+
) -> Dict[str, Any]:
|
|
1579
|
+
kwargs: Dict[str, Any] = dict(
|
|
1580
|
+
messages=messages,
|
|
1581
|
+
model=self._config.llm_model,
|
|
1582
|
+
temperature=self._config.temperature,
|
|
1583
|
+
max_tokens=self._config.max_tokens,
|
|
1584
|
+
context=context,
|
|
1585
|
+
)
|
|
1586
|
+
kwargs.update(self._config.get_llm_call_kwargs())
|
|
1587
|
+
if extra:
|
|
1588
|
+
kwargs.update(extra)
|
|
1589
|
+
return kwargs
|
|
1590
|
+
|
|
1591
|
+
async def _call_llm(
|
|
1592
|
+
self,
|
|
1593
|
+
messages: List[Any],
|
|
1594
|
+
context: Dict[str, Any],
|
|
1595
|
+
**extra: Any,
|
|
1596
|
+
) -> Any:
|
|
1597
|
+
"""One generate_text call. Agent retries only when the client does not."""
|
|
1598
|
+
client = self._resolved_llm_client()
|
|
1599
|
+
if client is None:
|
|
1600
|
+
raise TaskExecutionError("LLM client is not configured", agent_id=self.agent_id)
|
|
1601
|
+
|
|
1602
|
+
kwargs = self._build_llm_call_kwargs(messages, context, extra)
|
|
1603
|
+
|
|
1604
|
+
async def _once() -> Any:
|
|
1605
|
+
return await client.generate_text(**kwargs)
|
|
1606
|
+
|
|
1607
|
+
if getattr(client, "retries_generate_text", False):
|
|
1608
|
+
return await _once()
|
|
1609
|
+
return await self._agent_retry_policy().execute_with_retry(_once)
|
|
1610
|
+
|
|
1611
|
+
async def _stream_llm(
|
|
1612
|
+
self,
|
|
1613
|
+
messages: List[Any],
|
|
1614
|
+
context: Dict[str, Any],
|
|
1615
|
+
**extra: Any,
|
|
1616
|
+
) -> AsyncGenerator[Any, None]:
|
|
1617
|
+
"""Read stream_text. Retry only before any chunk is handed to the caller."""
|
|
1618
|
+
from .integration.retry_policy import ErrorClassifier
|
|
1619
|
+
|
|
1620
|
+
client = self._resolved_llm_client()
|
|
1621
|
+
if client is None:
|
|
1622
|
+
raise TaskExecutionError("LLM client is not configured", agent_id=self.agent_id)
|
|
1623
|
+
|
|
1624
|
+
kwargs = self._build_llm_call_kwargs(messages, context, extra)
|
|
1625
|
+
kwargs["return_chunks"] = True
|
|
1626
|
+
policy = self._agent_retry_policy()
|
|
1627
|
+
last_error: Optional[Exception] = None
|
|
1628
|
+
|
|
1629
|
+
for attempt in range(policy.max_retries + 1):
|
|
1630
|
+
handed_off = False
|
|
1631
|
+
stream_gen = client.stream_text(**kwargs)
|
|
1632
|
+
try:
|
|
1633
|
+
async for chunk in stream_gen:
|
|
1634
|
+
handed_off = True
|
|
1635
|
+
yield chunk
|
|
1636
|
+
return
|
|
1637
|
+
except Exception as exc:
|
|
1638
|
+
last_error = exc
|
|
1639
|
+
if handed_off:
|
|
1640
|
+
raise
|
|
1641
|
+
error_type = ErrorClassifier.classify(exc)
|
|
1642
|
+
if attempt >= policy.max_retries or not ErrorClassifier.is_retryable(error_type):
|
|
1643
|
+
raise
|
|
1644
|
+
delay = policy.calculate_delay(attempt, error_type)
|
|
1645
|
+
logger.warning(f"Agent {self.agent_id} stream attempt {attempt + 1} failed " f"({error_type.value}). Retrying in {delay:.2f}s...")
|
|
1646
|
+
aclose = getattr(stream_gen, "aclose", None)
|
|
1647
|
+
if callable(aclose):
|
|
1648
|
+
await aclose()
|
|
1649
|
+
await asyncio.sleep(delay)
|
|
1650
|
+
|
|
1651
|
+
if last_error is None:
|
|
1652
|
+
raise RuntimeError("Stream retry failed but no error was captured")
|
|
1653
|
+
raise last_error
|
|
1654
|
+
|
|
1655
|
+
async def _iter_user_stream_tokens(
|
|
1656
|
+
self,
|
|
1657
|
+
task: Dict[str, Any],
|
|
1658
|
+
context: Dict[str, Any],
|
|
1659
|
+
) -> AsyncGenerator[str, None]:
|
|
1660
|
+
"""Forward tokens from execute_task_streaming; raise on error; yield result body once if no tokens."""
|
|
1661
|
+
yielded_token = False
|
|
1662
|
+
result_output: Optional[Any] = None
|
|
1663
|
+
error_message: Optional[str] = None
|
|
1664
|
+
async for event in self.execute_task_streaming(task, context):
|
|
1665
|
+
event_type = event.get("type")
|
|
1666
|
+
if event_type == "error":
|
|
1667
|
+
error_message = str(event.get("error") or "Streaming failed")
|
|
1668
|
+
continue
|
|
1669
|
+
if event_type == "token":
|
|
1670
|
+
content = event.get("content")
|
|
1671
|
+
if content:
|
|
1672
|
+
yielded_token = True
|
|
1673
|
+
yield str(content)
|
|
1674
|
+
elif event_type == "result":
|
|
1675
|
+
result_output = event.get("output")
|
|
1676
|
+
if error_message:
|
|
1677
|
+
raise TaskExecutionError(
|
|
1678
|
+
error_message,
|
|
1679
|
+
agent_id=self.agent_id,
|
|
1680
|
+
task_id=task.get("task_id"),
|
|
1681
|
+
)
|
|
1682
|
+
if not yielded_token and result_output:
|
|
1683
|
+
yield str(result_output)
|
|
1684
|
+
|
|
1541
1685
|
# ==================== Memory Management ====================
|
|
1542
1686
|
|
|
1543
1687
|
async def add_to_memory(
|
|
@@ -1905,6 +2049,28 @@ class BaseAIAgent(SkillCapableMixin, ABC):
|
|
|
1905
2049
|
self._metrics.updated_at = datetime.utcnow()
|
|
1906
2050
|
logger.debug(f"Agent {self.agent_id} cache metrics updated: " f"hit_rate={self._metrics.cache_hit_rate:.2%}, " f"read_tokens={cache_read_tokens}, creation_tokens={cache_creation_tokens}")
|
|
1907
2051
|
|
|
2052
|
+
def record_prompt_cache(
|
|
2053
|
+
self,
|
|
2054
|
+
cache_read_tokens: Optional[int] = None,
|
|
2055
|
+
cache_creation_tokens: Optional[int] = None,
|
|
2056
|
+
) -> Dict[str, Any]:
|
|
2057
|
+
"""Record one LLM response's implicit-cache usage and return a caller event.
|
|
2058
|
+
|
|
2059
|
+
A hit is ``cache_read_tokens > 0``. Zero or a missing count is a miss.
|
|
2060
|
+
"""
|
|
2061
|
+
tokens = cache_read_tokens if isinstance(cache_read_tokens, int) and cache_read_tokens > 0 else 0
|
|
2062
|
+
hit = tokens > 0
|
|
2063
|
+
self.update_cache_metrics(
|
|
2064
|
+
cache_read_tokens=cache_read_tokens if isinstance(cache_read_tokens, int) else None,
|
|
2065
|
+
cache_creation_tokens=cache_creation_tokens,
|
|
2066
|
+
cache_hit=hit,
|
|
2067
|
+
)
|
|
2068
|
+
return {
|
|
2069
|
+
"type": "cache_status",
|
|
2070
|
+
"cache_hit": hit,
|
|
2071
|
+
"cache_read_tokens": tokens,
|
|
2072
|
+
}
|
|
2073
|
+
|
|
1908
2074
|
def update_session_metrics(
|
|
1909
2075
|
self,
|
|
1910
2076
|
session_status: str,
|
|
@@ -4383,7 +4549,7 @@ class BaseAIAgent(SkillCapableMixin, ABC):
|
|
|
4383
4549
|
break
|
|
4384
4550
|
|
|
4385
4551
|
if strategy == RecoveryStrategy.RETRY:
|
|
4386
|
-
result = await self.
|
|
4552
|
+
result = await self.execute_task(task, context)
|
|
4387
4553
|
elif strategy == RecoveryStrategy.SIMPLIFY:
|
|
4388
4554
|
simplified_task = await self._simplify_task(task)
|
|
4389
4555
|
result = await self.execute_task(simplified_task, context)
|
|
@@ -4401,11 +4567,11 @@ class BaseAIAgent(SkillCapableMixin, ABC):
|
|
|
4401
4567
|
if structured:
|
|
4402
4568
|
return RecoveryResult(
|
|
4403
4569
|
success=True,
|
|
4404
|
-
result=
|
|
4570
|
+
result=result,
|
|
4405
4571
|
strategies_attempted=attempted,
|
|
4406
4572
|
errors=errors,
|
|
4407
4573
|
)
|
|
4408
|
-
return
|
|
4574
|
+
return result
|
|
4409
4575
|
|
|
4410
4576
|
except VerificationExhausted as exc:
|
|
4411
4577
|
verification_exhausted = exc
|