aip-agents-binary 0.4.8__cp312-cp312-win_amd64.whl → 0.5.5__cp312-cp312-win_amd64.whl
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.
- aip_agents/__init__.pyi +19 -0
- aip_agents/a2a/__init__.pyi +1 -1
- aip_agents/a2a/server/base_executor.pyi +6 -6
- aip_agents/a2a/server/google_adk_executor.pyi +11 -11
- aip_agents/a2a/server/langflow_executor.pyi +43 -0
- aip_agents/a2a/server/langgraph_executor.pyi +10 -11
- aip_agents/a2a/types.pyi +54 -47
- aip_agents/agent/__init__.pyi +3 -1
- aip_agents/agent/base_agent.pyi +24 -8
- aip_agents/agent/base_langgraph_agent.pyi +68 -26
- aip_agents/agent/google_adk_agent.pyi +34 -21
- aip_agents/agent/google_adk_constants.pyi +3 -0
- aip_agents/agent/hitl/__init__.pyi +6 -0
- aip_agents/agent/hitl/config.pyi +15 -0
- aip_agents/agent/hitl/langgraph_hitl_mixin.pyi +42 -0
- aip_agents/agent/hitl/manager.pyi +199 -0
- aip_agents/agent/hitl/models.pyi +3 -0
- aip_agents/agent/hitl/prompt/__init__.pyi +4 -0
- aip_agents/agent/hitl/prompt/base.pyi +24 -0
- aip_agents/agent/hitl/prompt/deferred.pyi +30 -0
- aip_agents/agent/interface.pyi +5 -5
- aip_agents/agent/interfaces.pyi +44 -0
- aip_agents/agent/langflow_agent.pyi +133 -0
- aip_agents/agent/langgraph_memory_enhancer_agent.pyi +49 -0
- aip_agents/agent/langgraph_react_agent.pyi +51 -57
- aip_agents/agent/system_instruction_context.pyi +13 -0
- aip_agents/clients/__init__.pyi +4 -0
- aip_agents/clients/langflow/__init__.pyi +4 -0
- aip_agents/clients/langflow/client.pyi +140 -0
- aip_agents/clients/langflow/types.pyi +7 -0
- aip_agents/constants.pyi +1 -0
- aip_agents/examples/compare_streaming_client.pyi +48 -0
- aip_agents/examples/compare_streaming_server.pyi +18 -0
- aip_agents/examples/demo_memory_recall.pyi +58 -0
- aip_agents/examples/hello_world_a2a_google_adk_client.pyi +2 -2
- aip_agents/examples/hello_world_a2a_google_adk_client_agent.pyi +2 -2
- aip_agents/examples/hello_world_a2a_google_adk_client_streaming.pyi +2 -2
- aip_agents/examples/hello_world_a2a_google_adk_server.pyi +7 -2
- aip_agents/examples/hello_world_a2a_langchain_client.pyi +1 -1
- aip_agents/examples/hello_world_a2a_langchain_client_agent.pyi +1 -1
- aip_agents/examples/hello_world_a2a_langchain_client_lm_invoker.pyi +1 -1
- aip_agents/examples/hello_world_a2a_langchain_client_streaming.pyi +1 -1
- aip_agents/examples/hello_world_a2a_langchain_reference_client_streaming.pyi +1 -1
- aip_agents/examples/hello_world_a2a_langchain_reference_server.pyi +8 -3
- aip_agents/examples/hello_world_a2a_langchain_server.pyi +7 -2
- aip_agents/examples/hello_world_a2a_langchain_server_lm_invoker.pyi +7 -2
- aip_agents/examples/hello_world_a2a_langflow_client.pyi +9 -0
- aip_agents/examples/hello_world_a2a_langflow_server.pyi +14 -0
- aip_agents/examples/hello_world_a2a_langgraph_artifact_client.pyi +1 -1
- aip_agents/examples/hello_world_a2a_langgraph_artifact_client_streaming.pyi +1 -1
- aip_agents/examples/hello_world_a2a_langgraph_artifact_server.pyi +7 -2
- aip_agents/examples/hello_world_a2a_langgraph_client.pyi +2 -2
- aip_agents/examples/hello_world_a2a_langgraph_client_agent.pyi +2 -2
- aip_agents/examples/hello_world_a2a_langgraph_client_agent_lm_invoker.pyi +1 -1
- aip_agents/examples/hello_world_a2a_langgraph_client_streaming.pyi +3 -3
- aip_agents/examples/hello_world_a2a_langgraph_client_streaming_lm_invoker.pyi +1 -1
- aip_agents/examples/hello_world_a2a_langgraph_client_streaming_tool_streaming.pyi +1 -1
- aip_agents/examples/hello_world_a2a_langgraph_server.pyi +7 -2
- aip_agents/examples/hello_world_a2a_langgraph_server_lm_invoker.pyi +7 -2
- aip_agents/examples/hello_world_a2a_langgraph_server_tool_streaming.pyi +7 -2
- aip_agents/examples/hello_world_a2a_mcp_langgraph.pyi +1 -1
- aip_agents/examples/hello_world_a2a_three_level_agent_hierarchy_client.pyi +31 -6
- aip_agents/examples/hello_world_a2a_three_level_agent_hierarchy_server.pyi +33 -5
- aip_agents/examples/hello_world_a2a_with_metadata_langchain_client.pyi +1 -1
- aip_agents/examples/hello_world_a2a_with_metadata_langchain_server_lm_invoker.pyi +7 -2
- aip_agents/examples/hello_world_langchain_mcp_http_interactive.pyi +16 -0
- aip_agents/examples/hello_world_langchain_mcp_multi_server.pyi +18 -0
- aip_agents/examples/hello_world_langflow_agent.pyi +35 -0
- aip_agents/examples/hello_world_model_switch_cli.pyi +18 -3
- aip_agents/examples/hello_world_pii_logger.pyi +1 -1
- aip_agents/examples/hello_world_sentry.pyi +1 -1
- aip_agents/examples/hello_world_step_limits.pyi +17 -0
- aip_agents/examples/hello_world_stock_a2a_server.pyi +7 -2
- aip_agents/examples/hello_world_tool_output_client.pyi +1 -1
- aip_agents/examples/hello_world_tool_output_server.pyi +7 -2
- aip_agents/examples/hitl_demo.pyi +67 -0
- aip_agents/examples/pii_demo_langgraph_client.pyi +5 -0
- aip_agents/examples/pii_demo_langgraph_server.pyi +20 -0
- aip_agents/examples/pii_demo_multi_agent_client.pyi +5 -0
- aip_agents/examples/pii_demo_multi_agent_server.pyi +40 -0
- aip_agents/examples/todolist_planning_a2a_langchain_client.pyi +5 -0
- aip_agents/examples/todolist_planning_a2a_langgraph_server.pyi +19 -0
- aip_agents/examples/tools/__init__.pyi +3 -1
- aip_agents/examples/tools/adk_weather_tool.pyi +1 -1
- aip_agents/examples/tools/data_visualization_tool.pyi +2 -0
- aip_agents/examples/tools/image_artifact_tool.pyi +2 -0
- aip_agents/examples/tools/langchain_arithmetic_tools.pyi +7 -0
- aip_agents/examples/tools/langchain_currency_exchange_tool.pyi +0 -1
- aip_agents/examples/tools/langchain_graph_artifact_tool.pyi +2 -0
- aip_agents/examples/tools/langchain_weather_tool.pyi +1 -1
- aip_agents/examples/tools/langgraph_streaming_tool.pyi +1 -1
- aip_agents/examples/tools/mock_retrieval_tool.pyi +13 -0
- aip_agents/examples/tools/pii_demo_tools.pyi +54 -0
- aip_agents/examples/tools/random_chart_tool.pyi +20 -0
- aip_agents/examples/tools/stock_tools.pyi +18 -3
- aip_agents/mcp/client/__init__.pyi +4 -3
- aip_agents/mcp/client/base_mcp_client.pyi +148 -0
- aip_agents/mcp/client/connection_manager.pyi +48 -0
- aip_agents/mcp/client/google_adk/__init__.pyi +1 -1
- aip_agents/mcp/client/google_adk/client.pyi +50 -13
- aip_agents/mcp/client/langchain/__init__.pyi +1 -1
- aip_agents/mcp/client/langchain/client.pyi +47 -2
- aip_agents/mcp/client/persistent_session.pyi +113 -0
- aip_agents/mcp/client/session_pool.pyi +101 -0
- aip_agents/mcp/client/transports.pyi +123 -0
- aip_agents/mcp/utils/__init__.pyi +0 -0
- aip_agents/mcp/utils/config_validator.pyi +82 -0
- aip_agents/memory/adapters/__init__.pyi +4 -0
- aip_agents/memory/adapters/base_adapter.pyi +150 -0
- aip_agents/memory/adapters/mem0.pyi +22 -0
- aip_agents/memory/base.pyi +3 -3
- aip_agents/memory/constants.pyi +9 -0
- aip_agents/memory/factory.pyi +1 -1
- aip_agents/memory/guidance.pyi +3 -0
- aip_agents/middleware/__init__.pyi +5 -0
- aip_agents/middleware/base.pyi +71 -0
- aip_agents/middleware/manager.pyi +80 -0
- aip_agents/middleware/todolist.pyi +125 -0
- aip_agents/schema/__init__.pyi +9 -0
- aip_agents/schema/a2a.pyi +40 -0
- aip_agents/schema/agent.pyi +65 -0
- aip_agents/schema/hitl.pyi +89 -0
- aip_agents/schema/langgraph.pyi +28 -0
- aip_agents/schema/model_id.pyi +54 -0
- aip_agents/schema/step_limit.pyi +63 -0
- aip_agents/schema/storage.pyi +21 -0
- aip_agents/sentry/__init__.pyi +1 -1
- aip_agents/sentry/sentry.pyi +2 -2
- aip_agents/storage/base.pyi +1 -2
- aip_agents/storage/config.pyi +9 -46
- aip_agents/storage/providers/base.pyi +2 -3
- aip_agents/storage/providers/object_storage.pyi +1 -1
- aip_agents/tools/__init__.pyi +1 -1
- aip_agents/tools/bosa_tools.pyi +2 -2
- aip_agents/tools/constants.pyi +105 -100
- aip_agents/tools/memory_search/__init__.pyi +5 -0
- aip_agents/tools/memory_search/base.pyi +69 -0
- aip_agents/tools/memory_search/mem0.pyi +19 -0
- aip_agents/tools/memory_search/schema.pyi +15 -0
- aip_agents/tools/memory_search_tool.pyi +3 -0
- aip_agents/types/__init__.pyi +19 -3
- aip_agents/types/a2a_events.pyi +2 -73
- aip_agents/utils/__init__.pyi +8 -2
- aip_agents/utils/a2a_connector.pyi +14 -4
- aip_agents/utils/artifact_helpers.pyi +26 -2
- aip_agents/utils/constants.pyi +10 -0
- aip_agents/utils/datetime/__init__.pyi +4 -0
- aip_agents/utils/datetime/normalization.pyi +95 -0
- aip_agents/utils/datetime/timezone.pyi +48 -0
- aip_agents/utils/env_loader.pyi +2 -2
- aip_agents/utils/event_handler_registry.pyi +23 -0
- aip_agents/utils/file_prompt_utils.pyi +21 -0
- aip_agents/utils/final_response_builder.pyi +34 -0
- aip_agents/utils/formatter_llm_client.pyi +71 -0
- aip_agents/utils/langgraph/converter.pyi +1 -1
- aip_agents/utils/langgraph/tool_managers/a2a_tool_manager.pyi +2 -2
- aip_agents/utils/langgraph/tool_managers/base_tool_manager.pyi +2 -3
- aip_agents/utils/langgraph/tool_managers/delegation_tool_manager.pyi +14 -8
- aip_agents/utils/langgraph/tool_output_management.pyi +15 -2
- aip_agents/utils/logger.pyi +60 -0
- aip_agents/utils/metadata/__init__.pyi +5 -0
- aip_agents/utils/metadata/activity_metadata_helper.pyi +25 -0
- aip_agents/utils/metadata/activity_narrative/__init__.pyi +7 -0
- aip_agents/utils/metadata/activity_narrative/builder.pyi +35 -0
- aip_agents/utils/metadata/activity_narrative/constants.pyi +10 -0
- aip_agents/utils/metadata/activity_narrative/context.pyi +32 -0
- aip_agents/utils/metadata/activity_narrative/formatters.pyi +48 -0
- aip_agents/utils/metadata/activity_narrative/utils.pyi +12 -0
- aip_agents/utils/metadata/schemas/__init__.pyi +4 -0
- aip_agents/utils/metadata/schemas/activity_schema.pyi +18 -0
- aip_agents/utils/metadata/schemas/thinking_schema.pyi +20 -0
- aip_agents/utils/metadata/thinking_metadata_helper.pyi +4 -0
- aip_agents/utils/metadata_helper.pyi +50 -34
- aip_agents/utils/name_preprocessor/base_name_preprocessor.pyi +1 -2
- aip_agents/utils/name_preprocessor/google_name_preprocessor.pyi +1 -1
- aip_agents/utils/name_preprocessor/name_preprocessor.pyi +4 -4
- aip_agents/utils/name_preprocessor/openai_name_preprocessor.pyi +1 -1
- aip_agents/utils/pii/__init__.pyi +5 -0
- aip_agents/utils/pii/pii_handler.pyi +96 -0
- aip_agents/utils/pii/pii_helper.pyi +78 -0
- aip_agents/utils/pii/uuid_deanonymizer_mapping.pyi +73 -0
- aip_agents/utils/reference_helper.pyi +38 -6
- aip_agents/utils/sse_chunk_transformer.pyi +166 -0
- aip_agents/utils/step_limit_manager.pyi +112 -0
- aip_agents/utils/token_usage_helper.pyi +1 -1
- aip_agents.cp312-win_amd64.pyd +0 -0
- aip_agents.pyi +95 -34
- aip_agents_binary-0.5.5.dist-info/METADATA +669 -0
- aip_agents_binary-0.5.5.dist-info/RECORD +243 -0
- {aip_agents_binary-0.4.8.dist-info → aip_agents_binary-0.5.5.dist-info}/WHEEL +2 -1
- aip_agents_binary-0.5.5.dist-info/top_level.txt +1 -0
- aip_agents/agent/types.pyi +0 -109
- aip_agents/examples/hello_world_a2a_mem0_coordinator_client.pyi +0 -14
- aip_agents/examples/hello_world_a2a_mem0_coordinator_server.pyi +0 -10
- aip_agents/examples/hello_world_a2a_multi_agent_coordinator_client.pyi +0 -19
- aip_agents/examples/hello_world_a2a_multi_agent_coordinator_client_streaming.pyi +0 -9
- aip_agents/examples/hello_world_a2a_multi_agent_coordinator_server.pyi +0 -12
- aip_agents/examples/hello_world_langgraph_bosa.pyi +0 -5
- aip_agents/examples/hello_world_mem0_coordinator.pyi +0 -5
- aip_agents/examples/tools/pr_details_bosa_tool.pyi +0 -26
- aip_agents/memory/mem0_memory.pyi +0 -94
- aip_agents/tools/base.pyi +0 -44
- aip_agents/tools/base_bosa_tools.pyi +0 -12
- aip_agents/tools/bosa_connector.pyi +0 -30
- aip_agents/tools/bosa_tools_interface.pyi +0 -26
- aip_agents/utils/logger_manager.pyi +0 -151
- aip_agents.build/.gitignore +0 -1
- aip_agents_binary-0.4.8.dist-info/METADATA +0 -280
- aip_agents_binary-0.4.8.dist-info/RECORD +0 -166
aip_agents/storage/config.pyi
CHANGED
|
@@ -1,42 +1,8 @@
|
|
|
1
|
-
from aip_agents.storage
|
|
2
|
-
from aip_agents.storage.
|
|
3
|
-
from aip_agents.storage.providers.base import BaseStorageProvider
|
|
4
|
-
from aip_agents.storage.providers.memory import InMemoryStorageProvider as InMemoryStorageProvider
|
|
5
|
-
from aip_agents.storage.providers.object_storage import ObjectStorageProvider as ObjectStorageProvider
|
|
6
|
-
from dataclasses import dataclass
|
|
7
|
-
from enum import StrEnum
|
|
1
|
+
from aip_agents.schema.storage import OBJECT_STORAGE_PREFIX as OBJECT_STORAGE_PREFIX, StorageConfig as StorageConfig, StorageType as StorageType
|
|
2
|
+
from aip_agents.storage.base import BaseObjectStorageClient
|
|
3
|
+
from aip_agents.storage.providers.base import BaseStorageProvider
|
|
8
4
|
|
|
9
|
-
OBJECT_STORAGE_PREFIX
|
|
10
|
-
|
|
11
|
-
class StorageType(StrEnum):
|
|
12
|
-
"""Supported storage types."""
|
|
13
|
-
MEMORY = 'memory'
|
|
14
|
-
OBJECT_STORAGE = 'object_storage'
|
|
15
|
-
|
|
16
|
-
@dataclass
|
|
17
|
-
class StorageConfig:
|
|
18
|
-
"""Configuration for storage providers.
|
|
19
|
-
|
|
20
|
-
Attributes:
|
|
21
|
-
storage_type: Type of storage to use
|
|
22
|
-
object_prefix: Prefix for object storage keys (like a directory path)
|
|
23
|
-
object_use_json: Use JSON serialization instead of pickle for object storage
|
|
24
|
-
"""
|
|
25
|
-
storage_type: StorageType = ...
|
|
26
|
-
object_prefix: str = ...
|
|
27
|
-
object_use_json: bool = ...
|
|
28
|
-
@classmethod
|
|
29
|
-
def from_env(cls) -> StorageConfig:
|
|
30
|
-
'''Create StorageConfig from environment variables.
|
|
31
|
-
|
|
32
|
-
Environment variables:
|
|
33
|
-
- TOOL_OUTPUT_STORAGE_TYPE: "memory" or "object_storage"
|
|
34
|
-
- TOOL_OUTPUT_OBJECT_PREFIX: Prefix for object storage keys
|
|
35
|
-
- TOOL_OUTPUT_USE_JSON: "true" to use JSON serialization
|
|
36
|
-
|
|
37
|
-
Returns:
|
|
38
|
-
StorageConfig instance
|
|
39
|
-
'''
|
|
5
|
+
__all__ = ['OBJECT_STORAGE_PREFIX', 'StorageConfig', 'StorageType', 'StorageProviderFactory']
|
|
40
6
|
|
|
41
7
|
class StorageProviderFactory:
|
|
42
8
|
"""Factory for creating storage providers based on configuration."""
|
|
@@ -45,22 +11,19 @@ class StorageProviderFactory:
|
|
|
45
11
|
"""Create storage provider based on configuration.
|
|
46
12
|
|
|
47
13
|
Args:
|
|
48
|
-
config: Storage configuration
|
|
49
|
-
object_storage_client:
|
|
14
|
+
config (StorageConfig): Storage configuration object.
|
|
15
|
+
object_storage_client (BaseObjectStorageClient | None, optional): Optional object storage client for object storage type.
|
|
50
16
|
|
|
51
17
|
Returns:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Raises:
|
|
55
|
-
ValueError: If configuration is invalid
|
|
18
|
+
BaseStorageProvider: The created storage provider instance.
|
|
56
19
|
"""
|
|
57
20
|
@staticmethod
|
|
58
21
|
def create_from_env(object_storage_client: BaseObjectStorageClient | None = None) -> BaseStorageProvider:
|
|
59
22
|
"""Create storage provider from environment variables.
|
|
60
23
|
|
|
61
24
|
Args:
|
|
62
|
-
object_storage_client: Optional object storage client
|
|
25
|
+
object_storage_client (BaseObjectStorageClient | None, optional): Optional object storage client for object storage type.
|
|
63
26
|
|
|
64
27
|
Returns:
|
|
65
|
-
|
|
28
|
+
BaseStorageProvider: The created storage provider instance.
|
|
66
29
|
"""
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import abc
|
|
2
1
|
from _typeshed import Incomplete
|
|
3
2
|
from abc import ABC, abstractmethod
|
|
4
|
-
from aip_agents.utils.
|
|
3
|
+
from aip_agents.utils.logger import get_logger as get_logger
|
|
5
4
|
from typing import Any
|
|
6
5
|
|
|
7
6
|
logger: Incomplete
|
|
@@ -9,7 +8,7 @@ logger: Incomplete
|
|
|
9
8
|
class StorageError(Exception):
|
|
10
9
|
"""Base exception for storage operations."""
|
|
11
10
|
|
|
12
|
-
class BaseStorageProvider(ABC
|
|
11
|
+
class BaseStorageProvider(ABC):
|
|
13
12
|
"""Base interface for storage providers.
|
|
14
13
|
|
|
15
14
|
This abstract class defines the contract that all storage providers
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
2
|
from aip_agents.storage.base import BaseObjectStorageClient as BaseObjectStorageClient
|
|
3
3
|
from aip_agents.storage.providers.base import BaseStorageProvider as BaseStorageProvider, StorageError as StorageError
|
|
4
|
-
from aip_agents.utils.
|
|
4
|
+
from aip_agents.utils.logger import get_logger as get_logger
|
|
5
5
|
from typing import Any
|
|
6
6
|
|
|
7
7
|
logger: Incomplete
|
aip_agents/tools/__init__.pyi
CHANGED
aip_agents/tools/bosa_tools.pyi
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
|
-
from aip_agents.tools.constants import BOSA_API_BASE_URL as BOSA_API_BASE_URL, BOSA_API_KEY as BOSA_API_KEY, BOSA_FETCH_MAX_RETRIES as BOSA_FETCH_MAX_RETRIES
|
|
3
|
-
from aip_agents.utils.
|
|
2
|
+
from aip_agents.tools.constants import BOSA_API_BASE_URL as BOSA_API_BASE_URL, BOSA_API_KEY as BOSA_API_KEY, BOSA_FETCH_MAX_RETRIES as BOSA_FETCH_MAX_RETRIES, ToolType as ToolType
|
|
3
|
+
from aip_agents.utils.logger import get_logger as get_logger
|
|
4
4
|
from langchain_core.tools import BaseTool as BaseTool
|
|
5
5
|
|
|
6
6
|
logger: Incomplete
|
aip_agents/tools/constants.pyi
CHANGED
|
@@ -1,129 +1,134 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
|
-
from enum import Enum
|
|
2
|
+
from enum import Enum, StrEnum
|
|
3
3
|
|
|
4
4
|
BOSA_API_BASE_URL: Incomplete
|
|
5
5
|
BOSA_API_KEY: Incomplete
|
|
6
6
|
BOSA_FETCH_MAX_RETRIES: int
|
|
7
7
|
|
|
8
|
+
class ToolType(StrEnum):
|
|
9
|
+
"""Tool types for BOSA Connector."""
|
|
10
|
+
GLLM: str
|
|
11
|
+
LANGCHAIN: str
|
|
12
|
+
|
|
8
13
|
class Action(Enum):
|
|
9
14
|
"""Actions for BOSA Connector."""
|
|
10
|
-
GITHUB
|
|
11
|
-
GOOGLE
|
|
12
|
-
GOOGLE_DRIVE
|
|
13
|
-
GOOGLE_MAIL
|
|
14
|
-
TWITTER
|
|
15
|
+
GITHUB: str
|
|
16
|
+
GOOGLE: str
|
|
17
|
+
GOOGLE_DRIVE: str
|
|
18
|
+
GOOGLE_MAIL: str
|
|
19
|
+
TWITTER: str
|
|
15
20
|
|
|
16
21
|
class GitHubEndpoint(Enum):
|
|
17
22
|
"""GitHub endpoints for BOSA Connector."""
|
|
18
|
-
INTEGRATIONS
|
|
19
|
-
USER_HAS_INTEGRATION
|
|
20
|
-
SUCCESS_AUTHORIZE_CALLBACK
|
|
21
|
-
CREATE_ISSUE_HANDLER
|
|
22
|
-
GET_ISSUE_HANDLER
|
|
23
|
-
LIST_ISSUES
|
|
24
|
-
LIST_ISSUES_COMMENTS
|
|
25
|
-
SEARCH_ALL_ISSUES
|
|
26
|
-
GET_COMMITS
|
|
27
|
-
SEARCH_COMMITS
|
|
28
|
-
GET_COLLABORATORS
|
|
29
|
-
GET_RELEASES
|
|
30
|
-
GET_CONTRIBUTORS
|
|
31
|
-
GET_LANGUAGES
|
|
32
|
-
SEARCH_CONTRIBUTIONS
|
|
33
|
-
LIST_PULL_REQUESTS
|
|
34
|
-
SEARCH_PR
|
|
35
|
-
GET_PULL
|
|
36
|
-
GET_ALL_CONTRIBUTOR_COMMIT_ACTIVITIES
|
|
37
|
-
GET_COMMIT_ACTIVITY
|
|
38
|
-
GET_WEEKLY_COMMIT_COUNTS
|
|
39
|
-
GET_USER_CONTRIBUTION_STATISTICS
|
|
40
|
-
LIST_PROJECT_ITEMS
|
|
41
|
-
LIST_PROJECTS
|
|
23
|
+
INTEGRATIONS: str
|
|
24
|
+
USER_HAS_INTEGRATION: str
|
|
25
|
+
SUCCESS_AUTHORIZE_CALLBACK: str
|
|
26
|
+
CREATE_ISSUE_HANDLER: str
|
|
27
|
+
GET_ISSUE_HANDLER: str
|
|
28
|
+
LIST_ISSUES: str
|
|
29
|
+
LIST_ISSUES_COMMENTS: str
|
|
30
|
+
SEARCH_ALL_ISSUES: str
|
|
31
|
+
GET_COMMITS: str
|
|
32
|
+
SEARCH_COMMITS: str
|
|
33
|
+
GET_COLLABORATORS: str
|
|
34
|
+
GET_RELEASES: str
|
|
35
|
+
GET_CONTRIBUTORS: str
|
|
36
|
+
GET_LANGUAGES: str
|
|
37
|
+
SEARCH_CONTRIBUTIONS: str
|
|
38
|
+
LIST_PULL_REQUESTS: str
|
|
39
|
+
SEARCH_PR: str
|
|
40
|
+
GET_PULL: str
|
|
41
|
+
GET_ALL_CONTRIBUTOR_COMMIT_ACTIVITIES: str
|
|
42
|
+
GET_COMMIT_ACTIVITY: str
|
|
43
|
+
GET_WEEKLY_COMMIT_COUNTS: str
|
|
44
|
+
GET_USER_CONTRIBUTION_STATISTICS: str
|
|
45
|
+
LIST_PROJECT_ITEMS: str
|
|
46
|
+
LIST_PROJECTS: str
|
|
42
47
|
|
|
43
48
|
class GoogleDriveEndpoint(Enum):
|
|
44
49
|
"""Google Drive endpoints for BOSA Connector."""
|
|
45
|
-
INTEGRATIONS
|
|
46
|
-
USER_HAS_INTEGRATION
|
|
47
|
-
SUCCESS_AUTHORIZE_CALLBACK
|
|
48
|
-
SEARCH_FILES
|
|
49
|
-
GET_FILE
|
|
50
|
-
CREATE_FILE
|
|
51
|
-
CREATE_FOLDER
|
|
52
|
-
UPDATE_FILE
|
|
53
|
-
UPDATE_FOLDER
|
|
54
|
-
COPY_FILE
|
|
55
|
-
DELETE_FILE
|
|
56
|
-
SUMMARIZE_FOLDER_FILES_BY_TYPE
|
|
57
|
-
SUMMARIZE_TOTAL_FILES_BY_TYPE
|
|
58
|
-
RECENT_FILES
|
|
59
|
-
CREATE_PERMISSION
|
|
60
|
-
LIST_PERMISSIONS
|
|
61
|
-
GET_PERMISSION
|
|
62
|
-
UPDATE_PERMISSION
|
|
63
|
-
DELETE_PERMISSION
|
|
64
|
-
DOWNLOAD_FILE
|
|
50
|
+
INTEGRATIONS: str
|
|
51
|
+
USER_HAS_INTEGRATION: str
|
|
52
|
+
SUCCESS_AUTHORIZE_CALLBACK: str
|
|
53
|
+
SEARCH_FILES: str
|
|
54
|
+
GET_FILE: str
|
|
55
|
+
CREATE_FILE: str
|
|
56
|
+
CREATE_FOLDER: str
|
|
57
|
+
UPDATE_FILE: str
|
|
58
|
+
UPDATE_FOLDER: str
|
|
59
|
+
COPY_FILE: str
|
|
60
|
+
DELETE_FILE: str
|
|
61
|
+
SUMMARIZE_FOLDER_FILES_BY_TYPE: str
|
|
62
|
+
SUMMARIZE_TOTAL_FILES_BY_TYPE: str
|
|
63
|
+
RECENT_FILES: str
|
|
64
|
+
CREATE_PERMISSION: str
|
|
65
|
+
LIST_PERMISSIONS: str
|
|
66
|
+
GET_PERMISSION: str
|
|
67
|
+
UPDATE_PERMISSION: str
|
|
68
|
+
DELETE_PERMISSION: str
|
|
69
|
+
DOWNLOAD_FILE: str
|
|
65
70
|
|
|
66
71
|
class GoogleDocsEndpoint(Enum):
|
|
67
72
|
"""Google Docs endpoints for BOSA Connector."""
|
|
68
|
-
INTEGRATIONS
|
|
69
|
-
USER_HAS_INTEGRATION
|
|
70
|
-
SUCCESS_AUTHORIZE_CALLBACK
|
|
71
|
-
GET_DOCUMENT
|
|
72
|
-
LIST_DOCUMENTS
|
|
73
|
-
CREATE_DOCUMENT
|
|
74
|
-
UPDATE_DOCUMENT
|
|
75
|
-
COPY_CONTENT
|
|
76
|
-
UPDATE_DOCUMENT_MARKDOWN
|
|
77
|
-
LIST_COMMENTS
|
|
78
|
-
SUMMARIZE_COMMENTS
|
|
73
|
+
INTEGRATIONS: str
|
|
74
|
+
USER_HAS_INTEGRATION: str
|
|
75
|
+
SUCCESS_AUTHORIZE_CALLBACK: str
|
|
76
|
+
GET_DOCUMENT: str
|
|
77
|
+
LIST_DOCUMENTS: str
|
|
78
|
+
CREATE_DOCUMENT: str
|
|
79
|
+
UPDATE_DOCUMENT: str
|
|
80
|
+
COPY_CONTENT: str
|
|
81
|
+
UPDATE_DOCUMENT_MARKDOWN: str
|
|
82
|
+
LIST_COMMENTS: str
|
|
83
|
+
SUMMARIZE_COMMENTS: str
|
|
79
84
|
|
|
80
85
|
class GoogleEndpoint(Enum):
|
|
81
86
|
"""Google endpoints for BOSA Connector."""
|
|
82
|
-
INTEGRATIONS
|
|
83
|
-
USER_HAS_INTEGRATION
|
|
84
|
-
SUCCESS_AUTHORIZE_CALLBACK
|
|
85
|
-
USERINFO
|
|
87
|
+
INTEGRATIONS: str
|
|
88
|
+
USER_HAS_INTEGRATION: str
|
|
89
|
+
SUCCESS_AUTHORIZE_CALLBACK: str
|
|
90
|
+
USERINFO: str
|
|
86
91
|
|
|
87
92
|
class TwitterEndpoint(Enum):
|
|
88
93
|
"""Twitter endpoints for BOSA Connector."""
|
|
89
|
-
INTEGRATIONS
|
|
90
|
-
USER_HAS_INTEGRATION
|
|
91
|
-
SUCCESS_AUTHORIZE_CALLBACK
|
|
92
|
-
SEARCH
|
|
93
|
-
GET_TWEETS
|
|
94
|
-
GET_THREAD
|
|
95
|
-
GET_USERS
|
|
94
|
+
INTEGRATIONS: str
|
|
95
|
+
USER_HAS_INTEGRATION: str
|
|
96
|
+
SUCCESS_AUTHORIZE_CALLBACK: str
|
|
97
|
+
SEARCH: str
|
|
98
|
+
GET_TWEETS: str
|
|
99
|
+
GET_THREAD: str
|
|
100
|
+
GET_USERS: str
|
|
96
101
|
|
|
97
102
|
class GoogleMailEndpoint(Enum):
|
|
98
103
|
"""Google Mail endpoints for BOSA Connector."""
|
|
99
|
-
INTEGRATIONS
|
|
100
|
-
USER_HAS_INTEGRATION
|
|
101
|
-
SUCCESS_AUTHORIZE_CALLBACK
|
|
102
|
-
CREATE_DRAFT
|
|
103
|
-
LIST_DRAFTS
|
|
104
|
-
SEND_DRAFT
|
|
105
|
-
GET_DRAFT
|
|
106
|
-
MODIFY_DRAFT
|
|
107
|
-
LIST_LABELS
|
|
108
|
-
LABEL_STATS
|
|
109
|
-
GET_LABEL_DETAILS
|
|
110
|
-
CREATE_LABELS
|
|
111
|
-
MODIFY_LABELS
|
|
112
|
-
DELETE_LABELS
|
|
113
|
-
SEND_EMAIL
|
|
114
|
-
LIST_EMAILS
|
|
115
|
-
GET_EMAIL_DETAILS
|
|
116
|
-
MODIFY_EMAIL
|
|
117
|
-
DELETE_EMAIL
|
|
118
|
-
TRASH_EMAIL
|
|
119
|
-
UNTRASH_EMAIL
|
|
120
|
-
LIST_THREADS
|
|
121
|
-
THREAD_DETAILS
|
|
122
|
-
MODIFY_THREAD
|
|
123
|
-
GET_AUTO_REPLY
|
|
124
|
-
SET_AUTO_REPLY
|
|
125
|
-
GET_ATTACHMENT
|
|
126
|
-
USERINFO
|
|
104
|
+
INTEGRATIONS: str
|
|
105
|
+
USER_HAS_INTEGRATION: str
|
|
106
|
+
SUCCESS_AUTHORIZE_CALLBACK: str
|
|
107
|
+
CREATE_DRAFT: str
|
|
108
|
+
LIST_DRAFTS: str
|
|
109
|
+
SEND_DRAFT: str
|
|
110
|
+
GET_DRAFT: str
|
|
111
|
+
MODIFY_DRAFT: str
|
|
112
|
+
LIST_LABELS: str
|
|
113
|
+
LABEL_STATS: str
|
|
114
|
+
GET_LABEL_DETAILS: str
|
|
115
|
+
CREATE_LABELS: str
|
|
116
|
+
MODIFY_LABELS: str
|
|
117
|
+
DELETE_LABELS: str
|
|
118
|
+
SEND_EMAIL: str
|
|
119
|
+
LIST_EMAILS: str
|
|
120
|
+
GET_EMAIL_DETAILS: str
|
|
121
|
+
MODIFY_EMAIL: str
|
|
122
|
+
DELETE_EMAIL: str
|
|
123
|
+
TRASH_EMAIL: str
|
|
124
|
+
UNTRASH_EMAIL: str
|
|
125
|
+
LIST_THREADS: str
|
|
126
|
+
THREAD_DETAILS: str
|
|
127
|
+
MODIFY_THREAD: str
|
|
128
|
+
GET_AUTO_REPLY: str
|
|
129
|
+
SET_AUTO_REPLY: str
|
|
130
|
+
GET_ATTACHMENT: str
|
|
131
|
+
USERINFO: str
|
|
127
132
|
|
|
128
133
|
class ActionEndpointMap:
|
|
129
134
|
"""Maps Action enums to their corresponding Endpoint enums."""
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
from aip_agents.tools.memory_search.base import LongTermMemorySearchTool as LongTermMemorySearchTool
|
|
2
|
+
from aip_agents.tools.memory_search.mem0 import MEMORY_SEARCH_TOOL_NAME as MEMORY_SEARCH_TOOL_NAME, Mem0SearchInput as Mem0SearchInput, Mem0SearchTool as Mem0SearchTool
|
|
3
|
+
from aip_agents.tools.memory_search.schema import LongTermMemorySearchInput as LongTermMemorySearchInput, MemoryConfig as MemoryConfig
|
|
4
|
+
|
|
5
|
+
__all__ = ['MemoryConfig', 'LongTermMemorySearchInput', 'LongTermMemorySearchTool', 'Mem0SearchInput', 'Mem0SearchTool', 'MEMORY_SEARCH_TOOL_NAME']
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from abc import ABC
|
|
3
|
+
from aip_agents.memory.constants import MemoryDefaults as MemoryDefaults
|
|
4
|
+
from aip_agents.tools.memory_search.schema import LongTermMemorySearchInput as LongTermMemorySearchInput, MemoryConfig as MemoryConfig
|
|
5
|
+
from aip_agents.utils.logger import get_logger as get_logger
|
|
6
|
+
from collections.abc import Callable
|
|
7
|
+
from langchain_core.tools import BaseTool
|
|
8
|
+
from pydantic import BaseModel as BaseModel
|
|
9
|
+
from typing import Any, ClassVar, Protocol
|
|
10
|
+
|
|
11
|
+
logger: Incomplete
|
|
12
|
+
|
|
13
|
+
class LongTermMemoryBackend(Protocol):
|
|
14
|
+
"""Protocol for memory adapters that support retrieval and formatting."""
|
|
15
|
+
def retrieve(self, *, query: str | None, user_id: str, limit: int | None = None, filters: dict[str, Any] | None = None, page: int | None = None) -> list[dict[str, Any]]:
|
|
16
|
+
"""Retrieve memories matching the given query and filters.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
query: Optional search query string.
|
|
20
|
+
user_id: User identifier for scoped retrieval.
|
|
21
|
+
limit: Maximum number of results to return.
|
|
22
|
+
filters: Optional filters to apply to the retrieval.
|
|
23
|
+
page: Page number for pagination.
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
List of memory hit dictionaries.
|
|
27
|
+
"""
|
|
28
|
+
def format_hits(self, hits: list[dict[str, Any]], max_items: int = ..., with_tag: bool = True) -> str:
|
|
29
|
+
"""Format memory hits into a readable string.
|
|
30
|
+
|
|
31
|
+
Args:
|
|
32
|
+
hits: List of memory hit dictionaries to format.
|
|
33
|
+
max_items: Maximum number of hits to include in output.
|
|
34
|
+
with_tag: Whether to wrap output with memory tags.
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
Formatted string representation of memory hits.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
class LongTermMemorySearchTool(BaseTool, ABC):
|
|
41
|
+
"""Abstract base class for provider-specific long-term memory search tools."""
|
|
42
|
+
name: str
|
|
43
|
+
description: str
|
|
44
|
+
args_schema: type[LongTermMemorySearchInput]
|
|
45
|
+
tool_config_schema: type[BaseModel]
|
|
46
|
+
memory: LongTermMemoryBackend
|
|
47
|
+
default_user_id: str | None
|
|
48
|
+
user_id_provider: Callable[[], str | None] | None
|
|
49
|
+
MINIMUM_MEMORY_RETRIEVAL: ClassVar[int]
|
|
50
|
+
LOG_PREFIX: ClassVar[str]
|
|
51
|
+
def __init__(self, memory: LongTermMemoryBackend, *, default_user_id: str | None = None, user_id_provider: Callable[[], str | None] | None = None, **kwargs: Any) -> None:
|
|
52
|
+
"""Initialize the long-term memory search tool.
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
memory: Memory adapter instance with retrieve() and format_hits() methods.
|
|
56
|
+
default_user_id: Default user ID to use if not provided in metadata.
|
|
57
|
+
user_id_provider: Callable that returns a user ID.
|
|
58
|
+
**kwargs: Additional keyword arguments passed to the parent class.
|
|
59
|
+
"""
|
|
60
|
+
def format_hits(self, hits: list[dict[str, Any]], with_tag: bool = False) -> str:
|
|
61
|
+
"""Format hits into a string with optional tags.
|
|
62
|
+
|
|
63
|
+
Args:
|
|
64
|
+
hits: List of memory hit dictionaries to format.
|
|
65
|
+
with_tag: Whether to wrap the output with memory tags.
|
|
66
|
+
|
|
67
|
+
Returns:
|
|
68
|
+
Formatted string representation of the memory hits.
|
|
69
|
+
"""
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from aip_agents.memory.constants import MemoryDefaults as MemoryDefaults
|
|
3
|
+
from aip_agents.tools.memory_search.base import LongTermMemorySearchTool as LongTermMemorySearchTool
|
|
4
|
+
from aip_agents.tools.memory_search.schema import LongTermMemorySearchInput as LongTermMemorySearchInput
|
|
5
|
+
from aip_agents.utils.datetime import is_valid_date_string as is_valid_date_string, next_day_iso as next_day_iso
|
|
6
|
+
from aip_agents.utils.logger import get_logger as get_logger
|
|
7
|
+
from typing import ClassVar
|
|
8
|
+
|
|
9
|
+
logger: Incomplete
|
|
10
|
+
MEMORY_SEARCH_TOOL_NAME: str
|
|
11
|
+
|
|
12
|
+
class Mem0SearchTool(LongTermMemorySearchTool):
|
|
13
|
+
"""Mem0-specific implementation of the long-term memory search tool."""
|
|
14
|
+
name: str
|
|
15
|
+
description: str
|
|
16
|
+
args_schema: type[LongTermMemorySearchInput]
|
|
17
|
+
LOG_PREFIX: ClassVar[str]
|
|
18
|
+
METADATA_FILTER_BLOCKLIST: ClassVar[set[str]]
|
|
19
|
+
Mem0SearchInput = LongTermMemorySearchInput
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from pydantic import BaseModel
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
class MemoryConfig(BaseModel):
|
|
5
|
+
"""Tool configuration schema for memory operations."""
|
|
6
|
+
user_id: str
|
|
7
|
+
|
|
8
|
+
class LongTermMemorySearchInput(BaseModel):
|
|
9
|
+
"""Input schema for unified long-term memory retrieval."""
|
|
10
|
+
query: str | None
|
|
11
|
+
start_date: str | None
|
|
12
|
+
end_date: str | None
|
|
13
|
+
limit: int | None
|
|
14
|
+
categories: list[str] | None
|
|
15
|
+
metadata: dict[str, Any] | None
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
from aip_agents.tools.memory_search import LongTermMemorySearchInput as LongTermMemorySearchInput, LongTermMemorySearchTool as LongTermMemorySearchTool, MEMORY_SEARCH_TOOL_NAME as MEMORY_SEARCH_TOOL_NAME, Mem0SearchInput as Mem0SearchInput, Mem0SearchTool as Mem0SearchTool, MemoryConfig as MemoryConfig
|
|
2
|
+
|
|
3
|
+
__all__ = ['MemoryConfig', 'LongTermMemorySearchInput', 'LongTermMemorySearchTool', 'Mem0SearchInput', 'Mem0SearchTool', 'MEMORY_SEARCH_TOOL_NAME']
|
aip_agents/types/__init__.pyi
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from aip_agents.
|
|
1
|
+
from aip_agents.schema.a2a import A2AEvent as A2AEvent, A2AStreamEventType as A2AStreamEventType, ToolCallInfo as ToolCallInfo, ToolResultInfo as ToolResultInfo
|
|
2
2
|
from pydantic import BaseModel
|
|
3
3
|
from typing import Any, Protocol
|
|
4
4
|
|
|
@@ -15,6 +15,22 @@ class AgentProtocol(Protocol):
|
|
|
15
15
|
name: str
|
|
16
16
|
description: str
|
|
17
17
|
def run(self, query: str, **kwargs: Any) -> dict[str, Any]:
|
|
18
|
-
"""Synchronous execution method.
|
|
18
|
+
"""Synchronous execution method.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
query (str): The query to execute.
|
|
22
|
+
**kwargs (Any): Additional keyword arguments.
|
|
23
|
+
|
|
24
|
+
Returns:
|
|
25
|
+
dict[str, Any]: The execution result.
|
|
26
|
+
"""
|
|
19
27
|
async def arun(self, query: str, **kwargs: Any) -> dict[str, Any]:
|
|
20
|
-
"""Asynchronous execution method.
|
|
28
|
+
"""Asynchronous execution method.
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
query (str): The query to execute.
|
|
32
|
+
**kwargs (Any): Additional keyword arguments.
|
|
33
|
+
|
|
34
|
+
Returns:
|
|
35
|
+
dict[str, Any]: The execution result.
|
|
36
|
+
"""
|
aip_agents/types/a2a_events.pyi
CHANGED
|
@@ -1,74 +1,3 @@
|
|
|
1
|
-
from
|
|
2
|
-
from typing import Any
|
|
3
|
-
from typing_extensions import TypedDict
|
|
1
|
+
from aip_agents.schema.a2a import A2AEvent as A2AEvent, A2AStreamEventType as A2AStreamEventType, ToolCallInfo as ToolCallInfo, ToolResultInfo as ToolResultInfo
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
"""Semantic event types for A2A agent-executor communication.
|
|
7
|
-
|
|
8
|
-
These event types preserve the semantic meaning of LangChain message types
|
|
9
|
-
and eliminate the need for string-based content classification downstream.
|
|
10
|
-
"""
|
|
11
|
-
STATUS_UPDATE = 'status_update'
|
|
12
|
-
CONTENT_CHUNK = 'content_chunk'
|
|
13
|
-
FINAL_RESPONSE = 'final_response'
|
|
14
|
-
TOOL_CALL = 'tool_call'
|
|
15
|
-
TOOL_RESULT = 'tool_result'
|
|
16
|
-
ERROR = 'error'
|
|
17
|
-
|
|
18
|
-
class A2AEvent(TypedDict):
|
|
19
|
-
"""Structured event data for A2A agent-executor communication.
|
|
20
|
-
|
|
21
|
-
This TypedDict replaces the generic dictionary format previously used,
|
|
22
|
-
providing type safety and semantic clarity for agent streaming events.
|
|
23
|
-
|
|
24
|
-
Attributes:
|
|
25
|
-
event_type: The semantic type of this event (tool call, content, etc.).
|
|
26
|
-
content: The main text content of the event.
|
|
27
|
-
metadata: Additional metadata associated with the event.
|
|
28
|
-
tool_info: Tool-specific information (only present for tool-related events).
|
|
29
|
-
is_final: Whether this event represents the final output.
|
|
30
|
-
artifacts: List of artifacts generated by tools or agents.
|
|
31
|
-
references: Reference data from tools that support reference collection.
|
|
32
|
-
step_usage: Usage metadata associated with the event.
|
|
33
|
-
total_usage: Accumulated usage metadata associated with the event.
|
|
34
|
-
"""
|
|
35
|
-
event_type: A2AStreamEventType
|
|
36
|
-
content: str
|
|
37
|
-
metadata: dict[str, Any]
|
|
38
|
-
tool_info: dict[str, Any] | None
|
|
39
|
-
is_final: bool
|
|
40
|
-
artifacts: list[dict[str, Any]] | None
|
|
41
|
-
references: list[Any] | None
|
|
42
|
-
step_usage: dict[str, Any] | None
|
|
43
|
-
total_usage: dict[str, Any] | None
|
|
44
|
-
thinking_and_activity_info: dict[str, Any] | None
|
|
45
|
-
|
|
46
|
-
class ToolCallInfo(TypedDict):
|
|
47
|
-
'''Structured information for tool invocation events.
|
|
48
|
-
|
|
49
|
-
This provides a standardized format for tool call information,
|
|
50
|
-
eliminating the need for JSON encoding/decoding.
|
|
51
|
-
|
|
52
|
-
Attributes:
|
|
53
|
-
tool_calls: List of tool calls with names and arguments.
|
|
54
|
-
status: Current status of the tool invocation ("running", "finished").
|
|
55
|
-
'''
|
|
56
|
-
tool_calls: list[dict[str, Any]]
|
|
57
|
-
status: str
|
|
58
|
-
|
|
59
|
-
class ToolResultInfo(TypedDict):
|
|
60
|
-
"""Structured information for tool completion events.
|
|
61
|
-
|
|
62
|
-
This provides a standardized format for tool execution results,
|
|
63
|
-
eliminating the need for JSON encoding/decoding.
|
|
64
|
-
|
|
65
|
-
Attributes:
|
|
66
|
-
name: Name of the executed tool.
|
|
67
|
-
args: Arguments passed to the tool.
|
|
68
|
-
output: Output returned by the tool.
|
|
69
|
-
execution_time: Time taken for tool execution in seconds.
|
|
70
|
-
"""
|
|
71
|
-
name: str
|
|
72
|
-
args: dict[str, Any]
|
|
73
|
-
output: str
|
|
74
|
-
execution_time: float | None
|
|
3
|
+
__all__ = ['A2AStreamEventType', 'A2AEvent', 'ToolCallInfo', 'ToolResultInfo']
|
aip_agents/utils/__init__.pyi
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
from aip_agents.utils.artifact_helpers import create_artifact_command as create_artifact_command, create_artifact_response as create_artifact_response, create_error_response as create_error_response, create_multiple_artifacts_command as create_multiple_artifacts_command, create_text_artifact_response as create_text_artifact_response
|
|
2
|
-
from aip_agents.utils.
|
|
2
|
+
from aip_agents.utils.file_prompt_utils import augment_query_with_file_paths as augment_query_with_file_paths
|
|
3
|
+
from aip_agents.utils.final_response_builder import assemble_final_response as assemble_final_response
|
|
4
|
+
from aip_agents.utils.logger import LoggerManager as LoggerManager, get_logger as get_logger
|
|
5
|
+
from aip_agents.utils.pii.pii_handler import ToolPIIHandler as ToolPIIHandler
|
|
6
|
+
from aip_agents.utils.pii.pii_helper import add_pii_mappings as add_pii_mappings, extract_pii_mapping_from_agent_response as extract_pii_mapping_from_agent_response
|
|
3
7
|
from aip_agents.utils.reference_helper import add_references_chunks as add_references_chunks, serialize_references_for_metadata as serialize_references_for_metadata, validate_references as validate_references
|
|
8
|
+
from aip_agents.utils.sse_chunk_transformer import SSEChunkTransformer as SSEChunkTransformer
|
|
9
|
+
from aip_agents.utils.step_limit_manager import StepExecutionContext as StepExecutionContext, StepLimitManager as StepLimitManager, _DELEGATION_CHAIN_CVAR as _DELEGATION_CHAIN_CVAR, _DELEGATION_DEPTH_CVAR as _DELEGATION_DEPTH_CVAR, _REMAINING_STEP_BUDGET_CVAR as _REMAINING_STEP_BUDGET_CVAR, _STEP_LIMIT_CONFIG_CVAR as _STEP_LIMIT_CONFIG_CVAR
|
|
4
10
|
|
|
5
|
-
__all__ = ['LoggerManager', 'create_artifact_response', 'create_error_response', 'create_artifact_command', 'create_multiple_artifacts_command', 'create_text_artifact_response', 'validate_references', 'serialize_references_for_metadata', 'add_references_chunks']
|
|
11
|
+
__all__ = ['get_logger', 'LoggerManager', 'create_artifact_response', 'create_error_response', 'create_artifact_command', 'create_multiple_artifacts_command', 'create_text_artifact_response', 'validate_references', 'serialize_references_for_metadata', 'add_references_chunks', 'assemble_final_response', 'augment_query_with_file_paths', 'SSEChunkTransformer', 'StepExecutionContext', 'StepLimitManager', '_DELEGATION_CHAIN_CVAR', '_DELEGATION_DEPTH_CVAR', '_REMAINING_STEP_BUDGET_CVAR', '_STEP_LIMIT_CONFIG_CVAR', 'ToolPIIHandler', 'add_pii_mappings', 'extract_pii_mapping_from_agent_response']
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
from _typeshed import Incomplete
|
|
2
|
-
from a2a.types import AgentCard
|
|
3
|
-
from aip_agents.
|
|
4
|
-
from aip_agents.utils.
|
|
2
|
+
from a2a.types import AgentCard
|
|
3
|
+
from aip_agents.schema.a2a import A2AStreamEventType as A2AStreamEventType
|
|
4
|
+
from aip_agents.utils.event_handler_registry import DEFAULT_EVENT_HANDLER_REGISTRY as DEFAULT_EVENT_HANDLER_REGISTRY, EventHandlerRegistry as EventHandlerRegistry
|
|
5
|
+
from aip_agents.utils.final_response_builder import FinalResponseMetadataOptions as FinalResponseMetadataOptions, assemble_final_response as assemble_final_response
|
|
6
|
+
from aip_agents.utils.logger import get_logger as get_logger
|
|
7
|
+
from aip_agents.utils.metadata_helper import Kind as Kind, MetadataFieldKeys as MetadataFieldKeys, MetadataTimeTracker as MetadataTimeTracker, Status as Status, create_metadata as create_metadata, create_status_update_metadata as create_status_update_metadata, create_tool_processing_metadata as create_tool_processing_metadata
|
|
8
|
+
from aip_agents.utils.sse_chunk_transformer import SSEChunkTransformer as SSEChunkTransformer
|
|
9
|
+
from collections.abc import AsyncGenerator
|
|
5
10
|
from pydantic import BaseModel
|
|
6
|
-
from typing import Any
|
|
11
|
+
from typing import Any
|
|
7
12
|
|
|
8
13
|
logger: Incomplete
|
|
9
14
|
|
|
@@ -25,6 +30,10 @@ class ArtifactInfo(BaseModel):
|
|
|
25
30
|
description: str | None
|
|
26
31
|
parts: int | None
|
|
27
32
|
|
|
33
|
+
class StreamingConfig(BaseModel):
|
|
34
|
+
"""Configuration for A2A streaming operations."""
|
|
35
|
+
http_kwargs: dict[str, Any] | None
|
|
36
|
+
|
|
28
37
|
class A2AConnector:
|
|
29
38
|
"""Handles A2A protocol communication between agents.
|
|
30
39
|
|
|
@@ -33,6 +42,7 @@ class A2AConnector:
|
|
|
33
42
|
responses with immediate artifact event handling.
|
|
34
43
|
"""
|
|
35
44
|
FLOAT_EPSILON: float
|
|
45
|
+
event_registry: EventHandlerRegistry
|
|
36
46
|
@staticmethod
|
|
37
47
|
def send_to_agent(agent_card: AgentCard, message: str | dict[str, Any], **kwargs: Any) -> dict[str, Any]:
|
|
38
48
|
"""Synchronously sends a message to another agent using the A2A protocol.
|