traia-iatp 0.1.1__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of traia-iatp might be problematic. Click here for more details.
- {traia_iatp-0.1.1/src/traia_iatp.egg-info → traia_iatp-0.1.3}/PKG-INFO +1 -1
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/pyproject.toml +1 -1
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/cli/main.py +1 -1
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/mcp/traia_mcp_adapter.py +2 -2
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/mongodb_registry.py +4 -4
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/readmes/EMBEDDINGS_SETUP.md +1 -1
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/readmes/IATP_SEARCH_API_GUIDE.md +8 -8
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/readmes/MONGODB_X509_AUTH.md +1 -1
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/readmes/README.md +3 -3
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/readmes/REFACTORING_SUMMARY.md +6 -6
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/templates/README.md +1 -1
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/templates/__main__.py.j2 +58 -2
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/templates/agent.py.j2 +13 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/templates/agent_executor.py.j2 +16 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/templates/env.example.j2 +3 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/templates/pyproject.toml.j2 +1 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/special_agencies/registry_search_agency.py +1 -1
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/utils/iatp_utils.py +1 -1
- {traia_iatp-0.1.1 → traia_iatp-0.1.3/src/traia_iatp.egg-info}/PKG-INFO +1 -1
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/LICENSE +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/README.md +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/setup.cfg +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/README.md +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/__init__.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/cli/__init__.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/client/__init__.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/client/a2a_client.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/client/crewai_a2a_tools.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/client/grpc_a2a_tools.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/client/root_path_a2a_client.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/core/__init__.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/core/models.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/mcp/__init__.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/mcp/client.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/mcp/mcp_agent_template.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/mcp/templates/Dockerfile.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/mcp/templates/README.md.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/mcp/templates/cursor-rules.md.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/mcp/templates/deployment_params.json.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/mcp/templates/docker-compose.yml.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/mcp/templates/dockerignore.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/mcp/templates/gitignore.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/mcp/templates/mcp_health_check.py.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/mcp/templates/pyproject.toml.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/mcp/templates/run_local_docker.sh.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/mcp/templates/server.py.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/preview_diagrams.html +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/__init__.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/atlas_search_indexes.json +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/embeddings.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/iatp_search_api.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/readmes/ATLAS_SEARCH_INDEXES.md +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/readmes/ATLAS_SEARCH_SETUP.md +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/readmes/AUTHENTICATION_UPDATE.md +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/__init__.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/a2a_server.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/example_template_usage.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/iatp_server_agent_generator.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/iatp_server_template_generator.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/templates/Dockerfile.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/templates/README.md.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/templates/__init__.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/templates/agent_config.json.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/templates/docker-compose.yml.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/templates/gitignore.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/templates/grpc_server.py.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/templates/run_local_docker.sh.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/templates/server.py.j2 +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/special_agencies/__init__.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/utils/__init__.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/utils/docker_utils.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/utils/general.py +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp.egg-info/SOURCES.txt +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp.egg-info/dependency_links.txt +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp.egg-info/entry_points.txt +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp.egg-info/requires.txt +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp.egg-info/top_level.txt +0 -0
- {traia_iatp-0.1.1 → traia_iatp-0.1.3}/tests/test_configuration.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: traia-iatp
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Inter-Agent Transfer Protocol (IATP) - Enable AI Agents to utilize other AI Agents as tools
|
|
5
5
|
Project-URL: Documentation, https://pypi.org/project/traia-iatp
|
|
6
6
|
Project-URL: Source, https://github.com/Traia-IO/IATP
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "traia-iatp"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.3"
|
|
8
8
|
description = "Inter-Agent Transfer Protocol (IATP) - Enable AI Agents to utilize other AI Agents as tools"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12.8"
|
|
@@ -438,7 +438,7 @@ def example_crew():
|
|
|
438
438
|
# Example: Using utility agencies in a CrewAI crew
|
|
439
439
|
|
|
440
440
|
from crewai import Agent, Crew, Task
|
|
441
|
-
from
|
|
441
|
+
from traia_iatp import create_utility_agency_tools
|
|
442
442
|
|
|
443
443
|
# Find and create tools from utility agencies
|
|
444
444
|
tools = create_utility_agency_tools(
|
|
@@ -236,7 +236,7 @@ all HTTP requests when using streamable-http transport.
|
|
|
236
236
|
Basic Usage
|
|
237
237
|
-----------
|
|
238
238
|
```python
|
|
239
|
-
from
|
|
239
|
+
from traia_iatp.mcp import TraiaMCPAdapter
|
|
240
240
|
|
|
241
241
|
# Standard connection (no authentication)
|
|
242
242
|
server_params = {
|
|
@@ -264,7 +264,7 @@ with TraiaMCPAdapter(server_params) as tools:
|
|
|
264
264
|
Using Helper Functions
|
|
265
265
|
----------------------
|
|
266
266
|
```python
|
|
267
|
-
from
|
|
267
|
+
from traia_iatp.mcp import create_mcp_adapter_with_auth
|
|
268
268
|
|
|
269
269
|
# Create authenticated adapter
|
|
270
270
|
adapter = create_mcp_adapter_with_auth(
|
|
@@ -26,8 +26,8 @@ if __name__ == "__main__":
|
|
|
26
26
|
# When running as a script, import directly
|
|
27
27
|
import sys
|
|
28
28
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
|
29
|
-
from
|
|
30
|
-
from
|
|
29
|
+
from src.traia_iatp.core.models import UtilityAgentRegistryEntry, UtilityAgent
|
|
30
|
+
from src.traia_iatp.registry.embeddings import get_embedding_service
|
|
31
31
|
from ..utils import get_now_in_utc
|
|
32
32
|
else:
|
|
33
33
|
# When imported as a module
|
|
@@ -401,7 +401,7 @@ class UtilityAgentRegistry:
|
|
|
401
401
|
return False
|
|
402
402
|
|
|
403
403
|
# Create new endpoints based on the new base URL
|
|
404
|
-
from
|
|
404
|
+
from ..utils.iatp_utils import create_iatp_endpoints
|
|
405
405
|
supports_streaming = doc.get("endpoints", {}).get("streaming_endpoint") is not None
|
|
406
406
|
new_endpoints = create_iatp_endpoints(new_base_url, supports_streaming)
|
|
407
407
|
|
|
@@ -700,7 +700,7 @@ if __name__ == "__main__":
|
|
|
700
700
|
)
|
|
701
701
|
|
|
702
702
|
# Create test agent with endpoints
|
|
703
|
-
from
|
|
703
|
+
from ..utils.iatp_utils import create_iatp_endpoints
|
|
704
704
|
test_agent.endpoints = create_iatp_endpoints("http://weather-agent:8100", supports_streaming=True)
|
|
705
705
|
|
|
706
706
|
# Add to registry
|
|
@@ -116,7 +116,7 @@ import os
|
|
|
116
116
|
os.environ["ENABLE_EMBEDDINGS"] = "true"
|
|
117
117
|
os.environ["OPENAI_API_KEY"] = "your-key"
|
|
118
118
|
|
|
119
|
-
from
|
|
119
|
+
from traia_iatp.registry.mongodb_registry import UtilityAgencyRegistry
|
|
120
120
|
|
|
121
121
|
# Create registry (embeddings will be auto-generated)
|
|
122
122
|
registry = UtilityAgencyRegistry()
|
{traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/readmes/IATP_SEARCH_API_GUIDE.md
RENAMED
|
@@ -22,7 +22,7 @@ The API automatically detects and uses the appropriate authentication method:
|
|
|
22
22
|
Find a single utility agent by specific criteria.
|
|
23
23
|
|
|
24
24
|
```python
|
|
25
|
-
from
|
|
25
|
+
from traia_iatp.registry.iatp_search_api import find_utility_agent
|
|
26
26
|
|
|
27
27
|
# Find by exact name
|
|
28
28
|
agent = find_utility_agent(name="hyperliquid-mcp-traia-utility-agency")
|
|
@@ -41,7 +41,7 @@ agent = find_utility_agent(query="trading bot")
|
|
|
41
41
|
List utility agents with optional filters.
|
|
42
42
|
|
|
43
43
|
```python
|
|
44
|
-
from
|
|
44
|
+
from traia_iatp.registry.iatp_search_api import list_utility_agents
|
|
45
45
|
|
|
46
46
|
# List all active agents
|
|
47
47
|
agents = list_utility_agents(limit=20)
|
|
@@ -57,7 +57,7 @@ agents = list_utility_agents(capabilities=["market_info", "trading_orders"])
|
|
|
57
57
|
Search utility agents using vector search.
|
|
58
58
|
|
|
59
59
|
```python
|
|
60
|
-
from
|
|
60
|
+
from traia_iatp.registry.iatp_search_api import search_utility_agents
|
|
61
61
|
|
|
62
62
|
# Search using default search_text embedding (recommended for best performance)
|
|
63
63
|
agents = await search_utility_agents("trading hyperliquid", limit=5)
|
|
@@ -83,7 +83,7 @@ agents = await search_utility_agents(
|
|
|
83
83
|
Find a single MCP server by specific criteria.
|
|
84
84
|
|
|
85
85
|
```python
|
|
86
|
-
from
|
|
86
|
+
from traia_iatp.registry.iatp_search_api import find_mcp_server
|
|
87
87
|
|
|
88
88
|
# Find by exact name
|
|
89
89
|
server = find_mcp_server(name="hyperliquid-mcp")
|
|
@@ -96,7 +96,7 @@ server = find_mcp_server(capability="trading_orders")
|
|
|
96
96
|
List MCP servers with optional filters.
|
|
97
97
|
|
|
98
98
|
```python
|
|
99
|
-
from
|
|
99
|
+
from traia_iatp.registry.iatp_search_api import list_mcp_servers
|
|
100
100
|
|
|
101
101
|
# List all servers
|
|
102
102
|
servers = list_mcp_servers(limit=10)
|
|
@@ -109,7 +109,7 @@ servers = list_mcp_servers(capabilities=["market_info"])
|
|
|
109
109
|
Search MCP servers using vector search.
|
|
110
110
|
|
|
111
111
|
```python
|
|
112
|
-
from
|
|
112
|
+
from traia_iatp.registry.iatp_search_api import search_mcp_servers
|
|
113
113
|
|
|
114
114
|
# Search using default embedding fields (description and capabilities)
|
|
115
115
|
servers = await search_mcp_servers("trading", limit=5)
|
|
@@ -126,7 +126,7 @@ servers = await search_mcp_servers(
|
|
|
126
126
|
Get detailed MCP server information by name (returns raw MongoDB document).
|
|
127
127
|
|
|
128
128
|
```python
|
|
129
|
-
from
|
|
129
|
+
from traia_iatp.registry.iatp_search_api import get_mcp_server
|
|
130
130
|
|
|
131
131
|
# Get full server details
|
|
132
132
|
server_doc = get_mcp_server("hyperliquid-mcp")
|
|
@@ -172,7 +172,7 @@ class MCPServerInfo:
|
|
|
172
172
|
#!/usr/bin/env python
|
|
173
173
|
import asyncio
|
|
174
174
|
import os
|
|
175
|
-
from
|
|
175
|
+
from traia_iatp.registry.iatp_search_api import (
|
|
176
176
|
find_utility_agent,
|
|
177
177
|
list_utility_agents,
|
|
178
178
|
search_utility_agents,
|
|
@@ -132,7 +132,7 @@ openssl s_client -connect your-cluster.mongodb.net:27017 -CAfile cert.pem
|
|
|
132
132
|
The registry automatically detects and uses X.509 authentication when configured:
|
|
133
133
|
|
|
134
134
|
```python
|
|
135
|
-
from
|
|
135
|
+
from traia_iatp.registry.mongodb_registry import UtilityAgentRegistry
|
|
136
136
|
|
|
137
137
|
# No need to pass credentials - uses MONGODB_X509_CERT_FILE automatically
|
|
138
138
|
registry = UtilityAgentRegistry()
|
|
@@ -65,7 +65,7 @@ export MONGODB_CONNECTION_STRING=mongodb+srv://user:pass@cluster.mongodb.net/...
|
|
|
65
65
|
### Using the High-Level API (No MongoDB Required)
|
|
66
66
|
|
|
67
67
|
```python
|
|
68
|
-
from
|
|
68
|
+
from traia_iatp.registry.iatp_search_api import find_utility_agent, list_mcp_servers
|
|
69
69
|
|
|
70
70
|
# Find a specific utility agent
|
|
71
71
|
agent = await find_utility_agent(name="trading-agent")
|
|
@@ -77,7 +77,7 @@ servers = list_mcp_servers(limit=10)
|
|
|
77
77
|
### Direct MongoDB Access
|
|
78
78
|
|
|
79
79
|
```python
|
|
80
|
-
from
|
|
80
|
+
from traia_iatp.registry.mongodb_registry import UtilityAgentRegistry
|
|
81
81
|
|
|
82
82
|
# Registry will automatically use configured authentication
|
|
83
83
|
registry = UtilityAgentRegistry()
|
|
@@ -168,7 +168,7 @@ See [atlas_search_indexes.json](./atlas_search_indexes.json) for index definitio
|
|
|
168
168
|
### Register a New Utility Agent
|
|
169
169
|
|
|
170
170
|
```python
|
|
171
|
-
from
|
|
171
|
+
from traia_iatp.core.models import UtilityAgent, AgentEndpoints
|
|
172
172
|
|
|
173
173
|
agent = UtilityAgent(
|
|
174
174
|
name="My Trading Bot",
|
{traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/readmes/REFACTORING_SUMMARY.md
RENAMED
|
@@ -95,7 +95,7 @@ This refactoring separates the concerns between registry management (write opera
|
|
|
95
95
|
|
|
96
96
|
### Registry Operations (Write)
|
|
97
97
|
```python
|
|
98
|
-
from
|
|
98
|
+
from traia_iatp.registry.mongodb_registry import UtilityAgentRegistry
|
|
99
99
|
|
|
100
100
|
# Add new agent
|
|
101
101
|
registry = UtilityAgentRegistry()
|
|
@@ -108,7 +108,7 @@ await registry.update_agent_base_url(agent_id, new_url)
|
|
|
108
108
|
|
|
109
109
|
### Search Operations (Read)
|
|
110
110
|
```python
|
|
111
|
-
from
|
|
111
|
+
from traia_iatp.registry.iatp_search_api import search_utility_agents, find_utility_agent
|
|
112
112
|
|
|
113
113
|
# Search for agents
|
|
114
114
|
agents = await search_utility_agents("hyperliquid trading", limit=5)
|
|
@@ -120,7 +120,7 @@ agent = find_utility_agent(capability="market_data")
|
|
|
120
120
|
### Discovery Test
|
|
121
121
|
```python
|
|
122
122
|
# The discovery test now uses the search API
|
|
123
|
-
from
|
|
123
|
+
from traia_iatp.registry.iatp_search_api import search_utility_agents
|
|
124
124
|
|
|
125
125
|
# Search for Hyperliquid agent
|
|
126
126
|
search_results = await search_utility_agents(
|
|
@@ -137,19 +137,19 @@ search_results = await search_utility_agents(
|
|
|
137
137
|
1. **If using registry for search/query:**
|
|
138
138
|
```python
|
|
139
139
|
# OLD
|
|
140
|
-
from
|
|
140
|
+
from traia_iatp.registry.mongodb_registry import UtilityAgentRegistry
|
|
141
141
|
registry = UtilityAgentRegistry()
|
|
142
142
|
agents = await registry.query_agents(query="trading")
|
|
143
143
|
|
|
144
144
|
# NEW
|
|
145
|
-
from
|
|
145
|
+
from traia_iatp.registry.iatp_search_api import search_utility_agents
|
|
146
146
|
agents = await search_utility_agents("trading")
|
|
147
147
|
```
|
|
148
148
|
|
|
149
149
|
2. **If using registry for write operations:**
|
|
150
150
|
```python
|
|
151
151
|
# No changes needed - these methods are still available
|
|
152
|
-
from
|
|
152
|
+
from traia_iatp.registry.mongodb_registry import UtilityAgentRegistry
|
|
153
153
|
registry = UtilityAgentRegistry()
|
|
154
154
|
await registry.add_utility_agent(agent)
|
|
155
155
|
```
|
|
@@ -63,7 +63,7 @@ The templates expect the following variables:
|
|
|
63
63
|
Use the `UtilityAgencyTemplateGenerator` class to generate agencies:
|
|
64
64
|
|
|
65
65
|
```python
|
|
66
|
-
from
|
|
66
|
+
from traia_iatp.server.template_generator import UtilityAgencyTemplateGenerator
|
|
67
67
|
|
|
68
68
|
generator = UtilityAgencyTemplateGenerator()
|
|
69
69
|
output_path = generator.generate_agency(
|
|
@@ -32,6 +32,14 @@ from starlette.routing import Route
|
|
|
32
32
|
from starlette.middleware.base import BaseHTTPMiddleware
|
|
33
33
|
from starlette.responses import Response
|
|
34
34
|
|
|
35
|
+
# Import AgentOps for monitoring and observability
|
|
36
|
+
try:
|
|
37
|
+
import agentops
|
|
38
|
+
AGENTOPS_AVAILABLE = True
|
|
39
|
+
except ImportError:
|
|
40
|
+
AGENTOPS_AVAILABLE = False
|
|
41
|
+
agentops = None
|
|
42
|
+
|
|
35
43
|
|
|
36
44
|
import sys
|
|
37
45
|
from pathlib import Path
|
|
@@ -385,6 +393,32 @@ def generate_self_signed_cert(cert_path: str = "cert.pem", key_path: str = "key.
|
|
|
385
393
|
|
|
386
394
|
async def main():
|
|
387
395
|
"""Main function to start the A2A server with HTTP/2 support."""
|
|
396
|
+
|
|
397
|
+
# Initialize AgentOps for monitoring and observability
|
|
398
|
+
agentops_session_id = None
|
|
399
|
+
if AGENTOPS_AVAILABLE:
|
|
400
|
+
agentops_api_key = os.environ.get("AGENTOPS_API_KEY")
|
|
401
|
+
if agentops_api_key:
|
|
402
|
+
try:
|
|
403
|
+
# Initialize AgentOps with CrewAI-friendly settings
|
|
404
|
+
agentops_session_id = agentops.init(
|
|
405
|
+
api_key=agentops_api_key,
|
|
406
|
+
skip_auto_end_session=True, # Let CrewAI handle session lifecycle
|
|
407
|
+
tags=["{{ agent_name }}", "{{ mcp_server_name }}", "IATP", "A2A"],
|
|
408
|
+
auto_start_session=True
|
|
409
|
+
)
|
|
410
|
+
logger.info(f"✅ AgentOps initialized successfully - Session ID: {agentops_session_id}")
|
|
411
|
+
logger.info("📊 View session at: https://app.agentops.ai")
|
|
412
|
+
except Exception as e:
|
|
413
|
+
logger.warning(f"⚠️ Failed to initialize AgentOps: {e}")
|
|
414
|
+
logger.warning(" Continuing without AgentOps monitoring...")
|
|
415
|
+
else:
|
|
416
|
+
logger.info("ℹ️ AGENTOPS_API_KEY not set - AgentOps monitoring disabled")
|
|
417
|
+
logger.info(" Set AGENTOPS_API_KEY environment variable to enable monitoring")
|
|
418
|
+
else:
|
|
419
|
+
logger.info("ℹ️ AgentOps not installed - monitoring disabled")
|
|
420
|
+
logger.info(" Install with: pip install agentops")
|
|
421
|
+
|
|
388
422
|
# Get configuration from environment
|
|
389
423
|
host = os.environ.get("HOST", "0.0.0.0")
|
|
390
424
|
port = int(os.environ.get("PORT", 8000))
|
|
@@ -441,8 +475,30 @@ async def main():
|
|
|
441
475
|
logger.info(f"SSE endpoints available at: /a2a/tasks/subscribe and /a2a/tasks/resubscribe")
|
|
442
476
|
logger.info(f"HTTP/2 multiplexing enabled with max {config.h2_max_concurrent_streams} concurrent streams")
|
|
443
477
|
|
|
444
|
-
|
|
445
|
-
|
|
478
|
+
if agentops_session_id:
|
|
479
|
+
logger.info(f"📊 AgentOps Session ID: {agentops_session_id}")
|
|
480
|
+
logger.info("📊 Monitor agent performance at: https://app.agentops.ai")
|
|
481
|
+
|
|
482
|
+
try:
|
|
483
|
+
# Run the server with Hypercorn
|
|
484
|
+
await serve(app, config)
|
|
485
|
+
except KeyboardInterrupt:
|
|
486
|
+
logger.info("🛑 Server shutdown requested")
|
|
487
|
+
if AGENTOPS_AVAILABLE and agentops_session_id:
|
|
488
|
+
try:
|
|
489
|
+
agentops.end_session('Success')
|
|
490
|
+
logger.info("✅ AgentOps session ended successfully")
|
|
491
|
+
except Exception as e:
|
|
492
|
+
logger.warning(f"⚠️ Failed to end AgentOps session: {e}")
|
|
493
|
+
except Exception as e:
|
|
494
|
+
logger.error(f"❌ Server error: {e}")
|
|
495
|
+
if AGENTOPS_AVAILABLE and agentops_session_id:
|
|
496
|
+
try:
|
|
497
|
+
agentops.end_session('Fail', end_state_reason=str(e))
|
|
498
|
+
logger.info("📊 AgentOps session ended with failure status")
|
|
499
|
+
except Exception as ae:
|
|
500
|
+
logger.warning(f"⚠️ Failed to end AgentOps session: {ae}")
|
|
501
|
+
raise
|
|
446
502
|
|
|
447
503
|
|
|
448
504
|
if __name__ == "__main__":
|
|
@@ -13,6 +13,18 @@ import os
|
|
|
13
13
|
# Import MCP integration from traia_iatp.mcp
|
|
14
14
|
from traia_iatp.mcp import MCPServerConfig, MCPAgentBuilder, run_with_mcp_tools, MCPServerInfo
|
|
15
15
|
|
|
16
|
+
# Import AgentOps for operation tracking
|
|
17
|
+
try:
|
|
18
|
+
import agentops
|
|
19
|
+
from agentops.sdk.decorators import operation
|
|
20
|
+
AGENTOPS_AVAILABLE = True
|
|
21
|
+
except ImportError:
|
|
22
|
+
AGENTOPS_AVAILABLE = False
|
|
23
|
+
agentops = None
|
|
24
|
+
# Create a no-op decorator if AgentOps is not available
|
|
25
|
+
def operation(func):
|
|
26
|
+
return func
|
|
27
|
+
|
|
16
28
|
logger = logging.getLogger(__name__)
|
|
17
29
|
|
|
18
30
|
|
|
@@ -52,6 +64,7 @@ class {{ class_name }}Agent:
|
|
|
52
64
|
tools_subset=tools_subset
|
|
53
65
|
)
|
|
54
66
|
|
|
67
|
+
@operation
|
|
55
68
|
def process_request(self, request: str, context: Dict[str, Any] = None) -> str:
|
|
56
69
|
"""Process a request using the MCP server capabilities."""
|
|
57
70
|
try:
|
|
@@ -20,6 +20,18 @@ from a2a.utils import new_agent_text_message
|
|
|
20
20
|
from crewai import Task
|
|
21
21
|
from traia_iatp.mcp import MCPServerConfig, MCPAgentBuilder, run_with_mcp_tools, MCPServerInfo
|
|
22
22
|
|
|
23
|
+
# Import AgentOps for operation tracking
|
|
24
|
+
try:
|
|
25
|
+
import agentops
|
|
26
|
+
from agentops.sdk.decorators import operation
|
|
27
|
+
AGENTOPS_AVAILABLE = True
|
|
28
|
+
except ImportError:
|
|
29
|
+
AGENTOPS_AVAILABLE = False
|
|
30
|
+
agentops = None
|
|
31
|
+
# Create a no-op decorator if AgentOps is not available
|
|
32
|
+
def operation(func):
|
|
33
|
+
return func
|
|
34
|
+
|
|
23
35
|
logger = logging.getLogger(__name__)
|
|
24
36
|
|
|
25
37
|
# Create a thread pool for CPU-bound CrewAI operations
|
|
@@ -72,6 +84,7 @@ class {{ class_name }}AgentExecutor(AgentExecutor):
|
|
|
72
84
|
tags=mcp_config.metadata.get("tags", [])
|
|
73
85
|
)
|
|
74
86
|
|
|
87
|
+
@operation
|
|
75
88
|
async def execute(self, context: RequestContext, event_queue: EventQueue) -> None:
|
|
76
89
|
"""Process a request using the {{ agent_name }} capabilities."""
|
|
77
90
|
try:
|
|
@@ -104,6 +117,7 @@ class {{ class_name }}AgentExecutor(AgentExecutor):
|
|
|
104
117
|
msg.taskId = context.task_id
|
|
105
118
|
await event_queue.enqueue_event(msg)
|
|
106
119
|
|
|
120
|
+
@operation
|
|
107
121
|
async def _execute_standard(self, context: RequestContext, event_queue: EventQueue, request_text: str) -> None:
|
|
108
122
|
"""Execute standard (non-streaming) request."""
|
|
109
123
|
# Get additional context if provided
|
|
@@ -152,6 +166,7 @@ class {{ class_name }}AgentExecutor(AgentExecutor):
|
|
|
152
166
|
msg.taskId = context.task_id
|
|
153
167
|
await event_queue.enqueue_event(msg)
|
|
154
168
|
|
|
169
|
+
@operation
|
|
155
170
|
async def _execute_streaming(self, context: RequestContext, event_queue: EventQueue, request_text: str) -> None:
|
|
156
171
|
"""Execute streaming request using SSE."""
|
|
157
172
|
try:
|
|
@@ -202,6 +217,7 @@ class {{ class_name }}AgentExecutor(AgentExecutor):
|
|
|
202
217
|
})
|
|
203
218
|
)
|
|
204
219
|
|
|
220
|
+
@operation
|
|
205
221
|
async def _stream_mcp_response(self, request_text: str, context: RequestContext) -> AsyncGenerator[str, None]:
|
|
206
222
|
"""
|
|
207
223
|
Stream responses from MCP server.
|
{traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/special_agencies/registry_search_agency.py
RENAMED
|
@@ -357,7 +357,7 @@ python -m uvicorn server:app --host 0.0.0.0 --port 8000
|
|
|
357
357
|
## Usage Example
|
|
358
358
|
|
|
359
359
|
```python
|
|
360
|
-
from
|
|
360
|
+
from traia_iatp import create_utility_agency_tools
|
|
361
361
|
|
|
362
362
|
# This agency will be discoverable like any other
|
|
363
363
|
tools = create_utility_agency_tools(
|
|
@@ -4,7 +4,7 @@ import logging
|
|
|
4
4
|
from typing import Dict, Any, Optional, List
|
|
5
5
|
import httpx
|
|
6
6
|
|
|
7
|
-
from
|
|
7
|
+
from ..core.models import AgentCard, AgentSkill, AgentCapabilities, IATPEndpoints
|
|
8
8
|
|
|
9
9
|
logger = logging.getLogger(__name__)
|
|
10
10
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: traia-iatp
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Inter-Agent Transfer Protocol (IATP) - Enable AI Agents to utilize other AI Agents as tools
|
|
5
5
|
Project-URL: Documentation, https://pypi.org/project/traia-iatp
|
|
6
6
|
Project-URL: Source, https://github.com/Traia-IO/IATP
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/mcp/templates/deployment_params.json.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/readmes/ATLAS_SEARCH_INDEXES.md
RENAMED
|
File without changes
|
|
File without changes
|
{traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/registry/readmes/AUTHENTICATION_UPDATE.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/iatp_server_template_generator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{traia_iatp-0.1.1 → traia_iatp-0.1.3}/src/traia_iatp/server/templates/run_local_docker.sh.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|