solace-agent-mesh 1.0.8__py3-none-any.whl → 1.1.0__py3-none-any.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.
Potentially problematic release.
This version of solace-agent-mesh might be problematic. Click here for more details.
- solace_agent_mesh/agent/adk/adk_llm.txt +182 -42
- solace_agent_mesh/agent/adk/artifacts/artifacts_llm.txt +171 -0
- solace_agent_mesh/agent/adk/callbacks.py +165 -104
- solace_agent_mesh/agent/adk/embed_resolving_mcp_toolset.py +0 -18
- solace_agent_mesh/agent/adk/models/models_llm.txt +104 -55
- solace_agent_mesh/agent/adk/runner.py +7 -5
- solace_agent_mesh/agent/adk/setup.py +11 -0
- solace_agent_mesh/agent/adk/stream_parser.py +8 -1
- solace_agent_mesh/agent/adk/tool_wrapper.py +10 -3
- solace_agent_mesh/agent/agent_llm.txt +355 -18
- solace_agent_mesh/agent/protocol/event_handlers.py +433 -296
- solace_agent_mesh/agent/protocol/protocol_llm.txt +54 -7
- solace_agent_mesh/agent/sac/app.py +1 -1
- solace_agent_mesh/agent/sac/component.py +212 -517
- solace_agent_mesh/agent/sac/sac_llm.txt +133 -63
- solace_agent_mesh/agent/testing/testing_llm.txt +25 -58
- solace_agent_mesh/agent/tools/peer_agent_tool.py +15 -11
- solace_agent_mesh/agent/tools/tools_llm.txt +234 -69
- solace_agent_mesh/agent/utils/artifact_helpers.py +35 -1
- solace_agent_mesh/agent/utils/utils_llm.txt +90 -105
- solace_agent_mesh/assets/docs/404.html +3 -3
- solace_agent_mesh/assets/docs/assets/js/{3d406171.7d02a73b.js → 3d406171.0b9eeed1.js} +1 -1
- solace_agent_mesh/assets/docs/assets/js/6e0db977.39a79ca9.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/{75384d09.ccd480c4.js → 75384d09.bf78fbdb.js} +1 -1
- solace_agent_mesh/assets/docs/assets/js/90dd9cf6.88f385ea.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/f284c35a.fb68323a.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/main.a75ecc0d.js +2 -0
- solace_agent_mesh/assets/docs/assets/js/runtime~main.458efb1d.js +1 -0
- solace_agent_mesh/assets/docs/docs/documentation/concepts/agents/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/architecture/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/cli/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/gateways/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/orchestrator/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/plugins/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/deployment/debugging/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/deployment/deploy/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/deployment/observability/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/component-overview/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/configurations/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/installation/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/introduction/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/quick-start/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/migration-guides/a2a-upgrade-to-0.3.0/a2a-gateway-upgrade-to-0.3.0/index.html +105 -0
- solace_agent_mesh/assets/docs/docs/documentation/migration-guides/a2a-upgrade-to-0.3.0/a2a-technical-migration-map/index.html +53 -0
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/bedrock-agents/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/custom-agent/index.html +8 -8
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/event-mesh-gateway/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/mcp-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/mongodb-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/rag-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/rest-gateway/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/slack-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/sql-database/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/artifact-management/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/audio-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/data-analysis-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/embeds/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-agents/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-gateways/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/creating-service-providers/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/solace-ai-connector/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/structure/index.html +4 -4
- solace_agent_mesh/assets/docs/lunr-index-1756992446316.json +1 -0
- solace_agent_mesh/assets/docs/lunr-index.json +1 -1
- solace_agent_mesh/assets/docs/search-doc-1756992446316.json +1 -0
- solace_agent_mesh/assets/docs/search-doc.json +1 -1
- solace_agent_mesh/assets/docs/sitemap.xml +1 -1
- solace_agent_mesh/cli/__init__.py +1 -1
- solace_agent_mesh/cli/commands/add_cmd/web_add_agent_step.py +12 -3
- solace_agent_mesh/cli/commands/add_cmd/web_add_gateway_step.py +10 -14
- solace_agent_mesh/cli/commands/init_cmd/web_init_step.py +2 -15
- solace_agent_mesh/cli/commands/plugin_cmd/catalog_cmd.py +6 -2
- solace_agent_mesh/cli/utils.py +15 -0
- solace_agent_mesh/client/webui/frontend/static/assets/{authCallback-DvlO62me.js → authCallback-BmF2l6vg.js} +1 -1
- solace_agent_mesh/client/webui/frontend/static/assets/{client-bp6u3qVZ.js → client-D881Dttc.js} +4 -4
- solace_agent_mesh/client/webui/frontend/static/assets/main-C0jZjYa8.js +699 -0
- solace_agent_mesh/client/webui/frontend/static/assets/main-CCeG324-.css +1 -0
- solace_agent_mesh/client/webui/frontend/static/auth-callback.html +2 -2
- solace_agent_mesh/client/webui/frontend/static/index.html +3 -3
- solace_agent_mesh/common/a2a/__init__.py +213 -0
- solace_agent_mesh/common/a2a/a2a_llm.txt +182 -0
- solace_agent_mesh/common/a2a/artifact.py +328 -0
- solace_agent_mesh/common/a2a/events.py +183 -0
- solace_agent_mesh/common/a2a/message.py +307 -0
- solace_agent_mesh/common/a2a/protocol.py +513 -0
- solace_agent_mesh/common/a2a/task.py +127 -0
- solace_agent_mesh/common/a2a/translation.py +653 -0
- solace_agent_mesh/common/a2a/types.py +54 -0
- solace_agent_mesh/common/a2a_spec/a2a.json +2576 -0
- solace_agent_mesh/common/a2a_spec/a2a_spec_llm.txt +407 -0
- solace_agent_mesh/common/a2a_spec/schemas/agent_progress_update.json +18 -0
- solace_agent_mesh/common/a2a_spec/schemas/artifact_creation_progress.json +31 -0
- solace_agent_mesh/common/a2a_spec/schemas/llm_invocation.json +18 -0
- solace_agent_mesh/common/a2a_spec/schemas/schemas_llm.txt +235 -0
- solace_agent_mesh/common/a2a_spec/schemas/tool_invocation_start.json +26 -0
- solace_agent_mesh/common/a2a_spec/schemas/tool_result.json +25 -0
- solace_agent_mesh/common/agent_registry.py +1 -1
- solace_agent_mesh/common/common_llm.txt +192 -70
- solace_agent_mesh/common/data_parts.py +99 -0
- solace_agent_mesh/common/middleware/middleware_llm.txt +17 -17
- solace_agent_mesh/common/sac/__init__.py +0 -0
- solace_agent_mesh/common/sac/sac_llm.txt +71 -0
- solace_agent_mesh/common/sac/sam_component_base.py +252 -0
- solace_agent_mesh/common/services/providers/providers_llm.txt +51 -84
- solace_agent_mesh/common/services/services_llm.txt +206 -26
- solace_agent_mesh/common/utils/artifact_utils.py +29 -0
- solace_agent_mesh/common/utils/embeds/embeds_llm.txt +176 -80
- solace_agent_mesh/common/utils/utils_llm.txt +323 -42
- solace_agent_mesh/config_portal/backend/common.py +1 -1
- solace_agent_mesh/config_portal/frontend/static/client/assets/{_index-MqsrTd6g.js → _index-Bym6YkMd.js} +74 -24
- solace_agent_mesh/config_portal/frontend/static/client/assets/{components-B7lKcHVY.js → components-Rk0n-9cK.js} +1 -1
- solace_agent_mesh/config_portal/frontend/static/client/assets/{entry.client-CEumGClk.js → entry.client-mvZjNKiz.js} +1 -1
- solace_agent_mesh/config_portal/frontend/static/client/assets/{index-DSo1AH_7.js → index-DzNKzXrc.js} +1 -1
- solace_agent_mesh/config_portal/frontend/static/client/assets/manifest-d845808d.js +1 -0
- solace_agent_mesh/config_portal/frontend/static/client/assets/{root-C4XmHinv.js → root-BWvk5-gF.js} +1 -1
- solace_agent_mesh/config_portal/frontend/static/client/index.html +3 -3
- solace_agent_mesh/core_a2a/core_a2a_llm.txt +10 -8
- solace_agent_mesh/core_a2a/service.py +20 -44
- solace_agent_mesh/gateway/base/app.py +27 -1
- solace_agent_mesh/gateway/base/base_llm.txt +177 -72
- solace_agent_mesh/gateway/base/component.py +294 -523
- solace_agent_mesh/gateway/gateway_llm.txt +299 -58
- solace_agent_mesh/gateway/http_sse/component.py +156 -183
- solace_agent_mesh/gateway/http_sse/components/components_llm.txt +29 -29
- solace_agent_mesh/gateway/http_sse/http_sse_llm.txt +272 -36
- solace_agent_mesh/gateway/http_sse/main.py +8 -10
- solace_agent_mesh/gateway/http_sse/routers/agents.py +1 -1
- solace_agent_mesh/gateway/http_sse/routers/artifacts.py +18 -4
- solace_agent_mesh/gateway/http_sse/routers/routers_llm.txt +231 -5
- solace_agent_mesh/gateway/http_sse/routers/sessions.py +12 -7
- solace_agent_mesh/gateway/http_sse/routers/tasks.py +116 -169
- solace_agent_mesh/gateway/http_sse/services/agent_service.py +1 -1
- solace_agent_mesh/gateway/http_sse/services/services_llm.txt +89 -135
- solace_agent_mesh/gateway/http_sse/services/task_service.py +2 -5
- solace_agent_mesh/solace_agent_mesh_llm.txt +362 -0
- solace_agent_mesh/templates/gateway_component_template.py +149 -98
- {solace_agent_mesh-1.0.8.dist-info → solace_agent_mesh-1.1.0.dist-info}/METADATA +5 -4
- {solace_agent_mesh-1.0.8.dist-info → solace_agent_mesh-1.1.0.dist-info}/RECORD +143 -126
- solace_agent_mesh/assets/docs/assets/js/f284c35a.731836ad.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/main.6dba4a66.js +0 -2
- solace_agent_mesh/assets/docs/assets/js/runtime~main.6415ad00.js +0 -1
- solace_agent_mesh/assets/docs/lunr-index-1756153049706.json +0 -1
- solace_agent_mesh/assets/docs/search-doc-1756153049706.json +0 -1
- solace_agent_mesh/client/webui/frontend/static/assets/main-BCpII1-0.css +0 -1
- solace_agent_mesh/client/webui/frontend/static/assets/main-BucUdn9m.js +0 -673
- solace_agent_mesh/common/a2a_protocol.py +0 -564
- solace_agent_mesh/common/client/__init__.py +0 -4
- solace_agent_mesh/common/client/card_resolver.py +0 -21
- solace_agent_mesh/common/client/client.py +0 -85
- solace_agent_mesh/common/client/client_llm.txt +0 -133
- solace_agent_mesh/common/server/__init__.py +0 -4
- solace_agent_mesh/common/server/server.py +0 -122
- solace_agent_mesh/common/server/server_llm.txt +0 -169
- solace_agent_mesh/common/server/task_manager.py +0 -291
- solace_agent_mesh/common/server/utils.py +0 -28
- solace_agent_mesh/common/types.py +0 -411
- solace_agent_mesh/config_portal/frontend/static/client/assets/manifest-28271392.js +0 -1
- /solace_agent_mesh/assets/docs/assets/js/{main.6dba4a66.js.LICENSE.txt → main.a75ecc0d.js.LICENSE.txt} +0 -0
- {solace_agent_mesh-1.0.8.dist-info → solace_agent_mesh-1.1.0.dist-info}/WHEEL +0 -0
- {solace_agent_mesh-1.0.8.dist-info → solace_agent_mesh-1.1.0.dist-info}/entry_points.txt +0 -0
- {solace_agent_mesh-1.0.8.dist-info → solace_agent_mesh-1.1.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
# DEVELOPER GUIDE: a2a_spec
|
|
2
|
+
|
|
3
|
+
## Quick Summary
|
|
4
|
+
The `a2a_spec` directory contains the complete Agent-to-Agent (A2A) communication specification for the Solace Agent Mesh. It includes the main JSON schema definition (`a2a.json`) that defines all data structures, request/response types, and error codes for agent communication, plus a `schemas/` subdirectory containing specialized validation schemas for various agent signals and progress updates. Together, these provide a comprehensive framework for validating and implementing compliant agent-to-agent communication.
|
|
5
|
+
|
|
6
|
+
## Files and Subdirectories Overview
|
|
7
|
+
- **Direct files:**
|
|
8
|
+
- `a2a.json` - Complete JSON Schema specification for A2A protocol including all data types, requests, responses, and error definitions
|
|
9
|
+
- `a2a_spec_llm.txt` - Developer guide documentation for the A2A specification
|
|
10
|
+
- **Subdirectories:**
|
|
11
|
+
- `schemas/` - JSON Schema definitions for agent communication signals (progress updates, tool invocations, LLM calls, artifact creation)
|
|
12
|
+
|
|
13
|
+
## Developer API Reference
|
|
14
|
+
|
|
15
|
+
### Direct Files
|
|
16
|
+
|
|
17
|
+
#### a2a.json
|
|
18
|
+
**Purpose:** Complete JSON Schema specification defining the Agent-to-Agent communication protocol
|
|
19
|
+
**Import:** This is a JSON Schema file, typically loaded for validation purposes
|
|
20
|
+
|
|
21
|
+
**Key Schema Definitions:**
|
|
22
|
+
- **AgentCard** - Self-describing manifest for agents with capabilities, skills, and endpoints
|
|
23
|
+
- **Message** - Individual messages in agent conversations with parts (text, files, data)
|
|
24
|
+
- **Task** - Stateful operations/conversations between clients and agents
|
|
25
|
+
- **A2ARequest/A2AResponse** - All supported JSON-RPC request and response types
|
|
26
|
+
- **Security Schemes** - OAuth2, API Key, mTLS, and other authentication methods
|
|
27
|
+
- **Error Types** - Standard JSON-RPC and A2A-specific error definitions
|
|
28
|
+
|
|
29
|
+
**Core Data Structures:**
|
|
30
|
+
```typescript
|
|
31
|
+
// Agent Card - describes agent capabilities
|
|
32
|
+
AgentCard {
|
|
33
|
+
name: string
|
|
34
|
+
description: string
|
|
35
|
+
url: string
|
|
36
|
+
skills: AgentSkill[]
|
|
37
|
+
capabilities: AgentCapabilities
|
|
38
|
+
security: SecurityRequirement[]
|
|
39
|
+
// ... additional fields
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Message - conversation content
|
|
43
|
+
Message {
|
|
44
|
+
messageId: string
|
|
45
|
+
role: "user" | "agent"
|
|
46
|
+
parts: Part[] // TextPart | FilePart | DataPart
|
|
47
|
+
taskId?: string
|
|
48
|
+
contextId?: string
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Task - stateful operation
|
|
52
|
+
Task {
|
|
53
|
+
id: string
|
|
54
|
+
contextId: string
|
|
55
|
+
status: TaskStatus
|
|
56
|
+
history?: Message[]
|
|
57
|
+
artifacts?: Artifact[]
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### a2a_spec_llm.txt
|
|
62
|
+
**Purpose:** Developer documentation and usage guide for the A2A specification
|
|
63
|
+
**Import:** Documentation file for reference
|
|
64
|
+
|
|
65
|
+
### Subdirectory APIs
|
|
66
|
+
|
|
67
|
+
#### schemas/
|
|
68
|
+
**Purpose:** Provides JSON Schema definitions for agent communication signals and progress updates
|
|
69
|
+
**Key Exports:** Schema definitions for progress tracking, tool invocations, LLM calls, and artifact creation
|
|
70
|
+
**Import Examples:**
|
|
71
|
+
```python
|
|
72
|
+
import json
|
|
73
|
+
from jsonschema import validate
|
|
74
|
+
|
|
75
|
+
# Load and use schemas for validation
|
|
76
|
+
with open('solace_agent_mesh/common/a2a_spec/schemas/agent_progress_update.json') as f:
|
|
77
|
+
progress_schema = json.load(f)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Available Schemas:**
|
|
81
|
+
- `agent_progress_update.json` - General progress status messages
|
|
82
|
+
- `artifact_creation_progress.json` - File/artifact creation tracking with chunked data
|
|
83
|
+
- `llm_invocation.json` - LLM model invocation signals
|
|
84
|
+
- `tool_invocation_start.json` - Tool execution start notifications
|
|
85
|
+
- `tool_result.json` - Tool execution completion results
|
|
86
|
+
|
|
87
|
+
## Complete Usage Guide
|
|
88
|
+
|
|
89
|
+
### 1. Loading and Using the A2A Schema
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
import json
|
|
93
|
+
from jsonschema import validate, Draft7Validator
|
|
94
|
+
|
|
95
|
+
# Load the main A2A schema
|
|
96
|
+
with open('solace_agent_mesh/common/a2a_spec/a2a.json') as f:
|
|
97
|
+
a2a_schema = json.load(f)
|
|
98
|
+
|
|
99
|
+
# Create validator for specific types
|
|
100
|
+
def validate_agent_card(card_data):
|
|
101
|
+
"""Validate an AgentCard against the schema"""
|
|
102
|
+
card_schema = a2a_schema['definitions']['AgentCard']
|
|
103
|
+
validate(instance=card_data, schema=card_schema)
|
|
104
|
+
|
|
105
|
+
def validate_message(message_data):
|
|
106
|
+
"""Validate a Message against the schema"""
|
|
107
|
+
message_schema = a2a_schema['definitions']['Message']
|
|
108
|
+
validate(instance=message_data, schema=message_schema)
|
|
109
|
+
|
|
110
|
+
def validate_request(request_data):
|
|
111
|
+
"""Validate an A2A request"""
|
|
112
|
+
request_schema = a2a_schema['definitions']['A2ARequest']
|
|
113
|
+
validate(instance=request_data, schema=request_schema)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 2. Creating Valid A2A Data Structures
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
# Create a valid Message
|
|
120
|
+
message = {
|
|
121
|
+
"kind": "message",
|
|
122
|
+
"messageId": "msg-123",
|
|
123
|
+
"role": "user",
|
|
124
|
+
"parts": [
|
|
125
|
+
{
|
|
126
|
+
"kind": "text",
|
|
127
|
+
"text": "Hello, can you help me with a task?"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
# Create a SendMessage request
|
|
133
|
+
send_request = {
|
|
134
|
+
"jsonrpc": "2.0",
|
|
135
|
+
"id": "req-456",
|
|
136
|
+
"method": "message/send",
|
|
137
|
+
"params": {
|
|
138
|
+
"message": message
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
# Validate the request
|
|
143
|
+
validate_request(send_request)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 3. Using Agent Communication Schemas
|
|
147
|
+
|
|
148
|
+
```python
|
|
149
|
+
import json
|
|
150
|
+
from jsonschema import validate
|
|
151
|
+
|
|
152
|
+
# Load and validate progress update
|
|
153
|
+
with open('solace_agent_mesh/common/a2a_spec/schemas/agent_progress_update.json') as f:
|
|
154
|
+
progress_schema = json.load(f)
|
|
155
|
+
|
|
156
|
+
progress_update = {
|
|
157
|
+
"type": "agent_progress_update",
|
|
158
|
+
"status_text": "Processing your request..."
|
|
159
|
+
}
|
|
160
|
+
validate(instance=progress_update, schema=progress_schema)
|
|
161
|
+
|
|
162
|
+
# Load and validate tool invocation
|
|
163
|
+
with open('solace_agent_mesh/common/a2a_spec/schemas/tool_invocation_start.json') as f:
|
|
164
|
+
tool_schema = json.load(f)
|
|
165
|
+
|
|
166
|
+
tool_invocation = {
|
|
167
|
+
"type": "tool_invocation_start",
|
|
168
|
+
"tool_name": "file_reader",
|
|
169
|
+
"tool_args": {"filepath": "/data/file.txt"},
|
|
170
|
+
"function_call_id": "call_123"
|
|
171
|
+
}
|
|
172
|
+
validate(instance=tool_invocation, schema=tool_schema)
|
|
173
|
+
|
|
174
|
+
# Load and validate tool result
|
|
175
|
+
with open('solace_agent_mesh/common/a2a_spec/schemas/tool_result.json') as f:
|
|
176
|
+
result_schema = json.load(f)
|
|
177
|
+
|
|
178
|
+
tool_result = {
|
|
179
|
+
"type": "tool_result",
|
|
180
|
+
"tool_name": "file_reader",
|
|
181
|
+
"result_data": {"content": "File contents...", "size": 1024},
|
|
182
|
+
"function_call_id": "call_123"
|
|
183
|
+
}
|
|
184
|
+
validate(instance=tool_result, schema=result_schema)
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### 4. Working with Agent Cards
|
|
188
|
+
|
|
189
|
+
```python
|
|
190
|
+
# Create a complete AgentCard
|
|
191
|
+
agent_card = {
|
|
192
|
+
"name": "Document Processor",
|
|
193
|
+
"description": "Agent that processes and analyzes documents",
|
|
194
|
+
"url": "https://api.example.com/agent",
|
|
195
|
+
"version": "1.0.0",
|
|
196
|
+
"protocolVersion": "0.3.0",
|
|
197
|
+
"capabilities": {
|
|
198
|
+
"streaming": True,
|
|
199
|
+
"pushNotifications": False,
|
|
200
|
+
"stateTransitionHistory": True
|
|
201
|
+
},
|
|
202
|
+
"defaultInputModes": ["text/plain", "application/pdf"],
|
|
203
|
+
"defaultOutputModes": ["text/plain", "application/json"],
|
|
204
|
+
"skills": [
|
|
205
|
+
{
|
|
206
|
+
"id": "document-analysis",
|
|
207
|
+
"name": "Document Analysis",
|
|
208
|
+
"description": "Analyze and extract information from documents",
|
|
209
|
+
"tags": ["document", "analysis", "extraction"]
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
# Validate the agent card
|
|
215
|
+
validate_agent_card(agent_card)
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### 5. Artifact Creation Progress Tracking
|
|
219
|
+
|
|
220
|
+
```python
|
|
221
|
+
# Load artifact creation schema
|
|
222
|
+
with open('solace_agent_mesh/common/a2a_spec/schemas/artifact_creation_progress.json') as f:
|
|
223
|
+
artifact_schema = json.load(f)
|
|
224
|
+
|
|
225
|
+
# Track artifact creation with chunked data
|
|
226
|
+
artifact_progress = {
|
|
227
|
+
"type": "artifact_creation_progress",
|
|
228
|
+
"filename": "report.pdf",
|
|
229
|
+
"bytes_saved": 1024,
|
|
230
|
+
"artifact_chunk": "JVBERi0xLjQKJcOkw7zDtsO..." # Base64 encoded chunk
|
|
231
|
+
}
|
|
232
|
+
validate(instance=artifact_progress, schema=artifact_schema)
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### 6. LLM Invocation Tracking
|
|
236
|
+
|
|
237
|
+
```python
|
|
238
|
+
# Load LLM invocation schema
|
|
239
|
+
with open('solace_agent_mesh/common/a2a_spec/schemas/llm_invocation.json') as f:
|
|
240
|
+
llm_schema = json.load(f)
|
|
241
|
+
|
|
242
|
+
# Track LLM calls
|
|
243
|
+
llm_invocation = {
|
|
244
|
+
"type": "llm_invocation",
|
|
245
|
+
"request": {
|
|
246
|
+
"model": "gpt-4",
|
|
247
|
+
"messages": [{"role": "user", "content": "Analyze this data"}],
|
|
248
|
+
"temperature": 0.7
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
validate(instance=llm_invocation, schema=llm_schema)
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### 7. Complete Request/Response Flow with Progress Tracking
|
|
255
|
+
|
|
256
|
+
```python
|
|
257
|
+
# 1. Create and send a message
|
|
258
|
+
message = {
|
|
259
|
+
"kind": "message",
|
|
260
|
+
"messageId": "msg-001",
|
|
261
|
+
"role": "user",
|
|
262
|
+
"parts": [{"kind": "text", "text": "Analyze this document"}]
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
request = {
|
|
266
|
+
"jsonrpc": "2.0",
|
|
267
|
+
"id": "req-001",
|
|
268
|
+
"method": "message/send",
|
|
269
|
+
"params": {
|
|
270
|
+
"message": message,
|
|
271
|
+
"configuration": {
|
|
272
|
+
"blocking": False,
|
|
273
|
+
"acceptedOutputModes": ["text/plain", "application/json"]
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
# 2. Send progress updates during processing
|
|
279
|
+
def send_progress_update(status_text):
|
|
280
|
+
progress = {
|
|
281
|
+
"type": "agent_progress_update",
|
|
282
|
+
"status_text": status_text
|
|
283
|
+
}
|
|
284
|
+
# Validate and send progress update
|
|
285
|
+
validate(instance=progress, schema=progress_schema)
|
|
286
|
+
return progress
|
|
287
|
+
|
|
288
|
+
# 3. Track tool invocations
|
|
289
|
+
def track_tool_invocation(tool_name, args, call_id):
|
|
290
|
+
invocation = {
|
|
291
|
+
"type": "tool_invocation_start",
|
|
292
|
+
"tool_name": tool_name,
|
|
293
|
+
"tool_args": args,
|
|
294
|
+
"function_call_id": call_id
|
|
295
|
+
}
|
|
296
|
+
validate(instance=invocation, schema=tool_schema)
|
|
297
|
+
return invocation
|
|
298
|
+
|
|
299
|
+
# 4. Track tool results
|
|
300
|
+
def track_tool_result(tool_name, result_data, call_id):
|
|
301
|
+
result = {
|
|
302
|
+
"type": "tool_result",
|
|
303
|
+
"tool_name": tool_name,
|
|
304
|
+
"result_data": result_data,
|
|
305
|
+
"function_call_id": call_id
|
|
306
|
+
}
|
|
307
|
+
validate(instance=result, schema=result_schema)
|
|
308
|
+
return result
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### 8. Comprehensive Schema Validation Utilities
|
|
312
|
+
|
|
313
|
+
```python
|
|
314
|
+
class A2AValidator:
|
|
315
|
+
"""Utility class for A2A schema validation"""
|
|
316
|
+
|
|
317
|
+
def __init__(self, schema_dir='solace_agent_mesh/common/a2a_spec'):
|
|
318
|
+
self.schema_dir = schema_dir
|
|
319
|
+
self.main_schema = self._load_main_schema()
|
|
320
|
+
self.signal_schemas = self._load_signal_schemas()
|
|
321
|
+
|
|
322
|
+
def _load_main_schema(self):
|
|
323
|
+
with open(f'{self.schema_dir}/a2a.json') as f:
|
|
324
|
+
return json.load(f)
|
|
325
|
+
|
|
326
|
+
def _load_signal_schemas(self):
|
|
327
|
+
schemas = {}
|
|
328
|
+
schema_files = [
|
|
329
|
+
'agent_progress_update.json',
|
|
330
|
+
'artifact_creation_progress.json',
|
|
331
|
+
'llm_invocation.json',
|
|
332
|
+
'tool_invocation_start.json',
|
|
333
|
+
'tool_result.json'
|
|
334
|
+
]
|
|
335
|
+
for filename in schema_files:
|
|
336
|
+
with open(f'{self.schema_dir}/schemas/{filename}') as f:
|
|
337
|
+
schema_name = filename.replace('.json', '')
|
|
338
|
+
schemas[schema_name] = json.load(f)
|
|
339
|
+
return schemas
|
|
340
|
+
|
|
341
|
+
def validate_definition(self, data, definition_name):
|
|
342
|
+
"""Validate data against a specific A2A definition"""
|
|
343
|
+
schema = self.main_schema['definitions'][definition_name]
|
|
344
|
+
validate(instance=data, schema=schema)
|
|
345
|
+
|
|
346
|
+
def validate_signal(self, data, signal_type):
|
|
347
|
+
"""Validate agent communication signal"""
|
|
348
|
+
schema = self.signal_schemas[signal_type]
|
|
349
|
+
validate(instance=data, schema=schema)
|
|
350
|
+
|
|
351
|
+
def validate_a2a_message(self, message_data):
|
|
352
|
+
"""Validate a complete A2A message"""
|
|
353
|
+
self.validate_definition(message_data, 'Message')
|
|
354
|
+
|
|
355
|
+
def validate_agent_card(self, card_data):
|
|
356
|
+
"""Validate an agent card"""
|
|
357
|
+
self.validate_definition(card_data, 'AgentCard')
|
|
358
|
+
|
|
359
|
+
def validate_task(self, task_data):
|
|
360
|
+
"""Validate a task object"""
|
|
361
|
+
self.validate_definition(task_data, 'Task')
|
|
362
|
+
|
|
363
|
+
# Usage example
|
|
364
|
+
validator = A2AValidator()
|
|
365
|
+
|
|
366
|
+
# Validate main A2A objects
|
|
367
|
+
validator.validate_agent_card(agent_card)
|
|
368
|
+
validator.validate_a2a_message(message)
|
|
369
|
+
|
|
370
|
+
# Validate communication signals
|
|
371
|
+
validator.validate_signal(progress_update, 'agent_progress_update')
|
|
372
|
+
validator.validate_signal(tool_invocation, 'tool_invocation_start')
|
|
373
|
+
validator.validate_signal(tool_result, 'tool_result')
|
|
374
|
+
validator.validate_signal(artifact_progress, 'artifact_creation_progress')
|
|
375
|
+
validator.validate_signal(llm_invocation, 'llm_invocation')
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### 9. Error Handling with A2A Error Types
|
|
379
|
+
|
|
380
|
+
```python
|
|
381
|
+
# Create A2A-specific errors using the schema definitions
|
|
382
|
+
task_not_found_error = {
|
|
383
|
+
"code": -32001,
|
|
384
|
+
"message": "Task not found",
|
|
385
|
+
"data": {"taskId": "task-123"}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
content_type_error = {
|
|
389
|
+
"code": -32005,
|
|
390
|
+
"message": "Incompatible content types",
|
|
391
|
+
"data": {"requested": "image/png", "supported": ["text/plain", "application/json"]}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
# Create error response
|
|
395
|
+
error_response = {
|
|
396
|
+
"jsonrpc": "2.0",
|
|
397
|
+
"id": "req-456",
|
|
398
|
+
"error": task_not_found_error
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
# Validate error response
|
|
402
|
+
validator.validate_definition(error_response, 'JSONRPCErrorResponse')
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
This comprehensive guide shows how to use both the main A2A specification and the specialized signal schemas together to build compliant agent-to-agent communication systems in the Solace Agent Mesh, including progress tracking, tool invocation monitoring, LLM call tracking, and artifact creation progress.
|
|
406
|
+
|
|
407
|
+
# content_hash: f9b143dcd949464f8cf51960be146ae5a87bdd25fd2af5cd93c400925212bb24
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "AgentProgressUpdateData",
|
|
4
|
+
"description": "Schema for the data part of an agent progress update signal.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"type": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"const": "agent_progress_update",
|
|
10
|
+
"description": "The constant type for this data part."
|
|
11
|
+
},
|
|
12
|
+
"status_text": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "A human-readable progress message (e.g., 'Analyzing the report...')."
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": ["type", "status_text"]
|
|
18
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "ArtifactCreationProgressData",
|
|
4
|
+
"description": "Schema for the data part of an artifact creation progress signal.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"type": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"const": "artifact_creation_progress",
|
|
10
|
+
"description": "The constant type for this data part."
|
|
11
|
+
},
|
|
12
|
+
"filename": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "The name of the artifact being created."
|
|
15
|
+
},
|
|
16
|
+
"bytes_saved": {
|
|
17
|
+
"type": "integer",
|
|
18
|
+
"description": "The number of bytes saved so far."
|
|
19
|
+
},
|
|
20
|
+
"artifact_chunk": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "The chunk of artifact data that was saved in this progress update."
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"required": [
|
|
26
|
+
"type",
|
|
27
|
+
"filename",
|
|
28
|
+
"bytes_saved",
|
|
29
|
+
"artifact_chunk"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "LlmInvocationData",
|
|
4
|
+
"description": "Schema for the data part of an LLM invocation signal.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"type": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"const": "llm_invocation",
|
|
10
|
+
"description": "The constant type for this data part."
|
|
11
|
+
},
|
|
12
|
+
"request": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"description": "A sanitized representation of the LlmRequest object sent to the model."
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": ["type", "request"]
|
|
18
|
+
}
|