solace-agent-mesh 1.4.12__py3-none-any.whl → 1.5.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 +3 -4
- solace_agent_mesh/agent/adk/adk_llm_detail.txt +566 -0
- solace_agent_mesh/agent/adk/artifacts/artifacts_llm.txt +1 -1
- solace_agent_mesh/agent/adk/callbacks.py +51 -2
- solace_agent_mesh/agent/adk/models/lite_llm.py +1 -0
- solace_agent_mesh/agent/adk/models/models_llm.txt +1 -2
- solace_agent_mesh/agent/agent_llm.txt +1 -1
- solace_agent_mesh/agent/agent_llm_detail.txt +1702 -0
- solace_agent_mesh/agent/protocol/event_handlers.py +2 -13
- solace_agent_mesh/agent/protocol/protocol_llm.txt +15 -2
- solace_agent_mesh/agent/protocol/protocol_llm_detail.txt +92 -0
- solace_agent_mesh/agent/sac/component.py +51 -21
- solace_agent_mesh/agent/sac/sac_llm.txt +15 -1
- solace_agent_mesh/agent/sac/sac_llm_detail.txt +200 -0
- solace_agent_mesh/agent/sac/task_execution_context.py +73 -0
- solace_agent_mesh/agent/testing/testing_llm_detail.txt +68 -0
- solace_agent_mesh/agent/tools/tools_llm.txt +148 -154
- solace_agent_mesh/agent/tools/tools_llm_detail.txt +274 -0
- solace_agent_mesh/agent/utils/utils_llm.txt +1 -1
- solace_agent_mesh/agent/utils/utils_llm_detail.txt +149 -0
- solace_agent_mesh/assets/docs/404.html +3 -3
- solace_agent_mesh/assets/docs/assets/js/483cef9a.bf9398af.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/{main.f67fc9f4.js → main.0c149855.js} +2 -2
- solace_agent_mesh/assets/docs/assets/js/{runtime~main.40527046.js → runtime~main.c66557e4.js} +1 -1
- solace_agent_mesh/assets/docs/docs/documentation/Enterprise/installation/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/Enterprise/rbac-setup-guilde/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/Enterprise/single-sign-on/index.html +8 -4
- solace_agent_mesh/assets/docs/docs/documentation/Migrations/A2A Upgrade To 0.3.0/a2a-gateway-upgrade-to-0.3.0/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/Migrations/A2A Upgrade To 0.3.0/a2a-technical-migration-map/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/concepts/agents/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/concepts/architecture/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/concepts/cli/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/concepts/gateways/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/concepts/orchestrator/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/concepts/plugins/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/deployment/debugging/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/deployment/deploy/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/deployment/observability/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/component-overview/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/configurations/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/configurations/litellm_models/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/installation/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/introduction/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/quick-start/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/bedrock-agents/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/custom-agent/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/event-mesh-gateway/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/mcp-integration/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/mongodb-integration/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/rag-integration/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/rest-gateway/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/slack-integration/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/sql-database/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/artifact-management/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/audio-tools/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/data-analysis-tools/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/embeds/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-agents/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-gateways/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/creating-python-tools/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/creating-service-providers/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/solace-ai-connector/index.html +3 -3
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/structure/index.html +3 -3
- solace_agent_mesh/assets/docs/lunr-index-1760032255022.json +1 -0
- solace_agent_mesh/assets/docs/lunr-index.json +1 -1
- solace_agent_mesh/assets/docs/search-doc-1760032255022.json +1 -0
- solace_agent_mesh/assets/docs/search-doc.json +1 -1
- solace_agent_mesh/cli/__init__.py +1 -1
- solace_agent_mesh/client/webui/frontend/static/assets/{authCallback-j1LW-wlq.js → authCallback-DwrxZE0E.js} +1 -1
- solace_agent_mesh/client/webui/frontend/static/assets/{client-B9p_nFNA.js → client-DarGQzyw.js} +1 -1
- solace_agent_mesh/client/webui/frontend/static/assets/main-CZbpmwfA.css +1 -0
- solace_agent_mesh/client/webui/frontend/static/assets/main-C__uuUkB.js +339 -0
- solace_agent_mesh/client/webui/frontend/static/assets/{vendor-CS5YMf8a.js → vendor-BKIeiHj_.js} +80 -70
- solace_agent_mesh/client/webui/frontend/static/auth-callback.html +3 -3
- solace_agent_mesh/client/webui/frontend/static/index.html +4 -4
- solace_agent_mesh/common/a2a/a2a_llm.txt +1 -1
- solace_agent_mesh/common/a2a/a2a_llm_detail.txt +193 -0
- solace_agent_mesh/common/a2a_spec/a2a_spec_llm.txt +1 -1
- solace_agent_mesh/common/a2a_spec/a2a_spec_llm_detail.txt +736 -0
- solace_agent_mesh/common/a2a_spec/schemas/llm_invocation.json +23 -0
- solace_agent_mesh/common/a2a_spec/schemas/schemas_llm.txt +93 -15
- solace_agent_mesh/common/a2a_spec/schemas/tool_result.json +23 -0
- solace_agent_mesh/common/common_llm.txt +24 -39
- solace_agent_mesh/common/common_llm_detail.txt +2562 -0
- solace_agent_mesh/common/data_parts.py +9 -1
- solace_agent_mesh/common/middleware/middleware_llm_detail.txt +185 -0
- solace_agent_mesh/common/sac/sac_llm.txt +1 -1
- solace_agent_mesh/common/sac/sac_llm_detail.txt +82 -0
- solace_agent_mesh/common/sam_events/sam_events_llm.txt +104 -0
- solace_agent_mesh/common/sam_events/sam_events_llm_detail.txt +115 -0
- solace_agent_mesh/common/services/services_llm.txt +57 -6
- solace_agent_mesh/common/services/services_llm_detail.txt +459 -0
- solace_agent_mesh/common/utils/embeds/embeds_llm.txt +1 -1
- solace_agent_mesh/common/utils/utils_llm.txt +75 -87
- solace_agent_mesh/common/utils/utils_llm_detail.txt +572 -0
- solace_agent_mesh/core_a2a/core_a2a_llm_detail.txt +101 -0
- solace_agent_mesh/gateway/base/app.py +1 -1
- solace_agent_mesh/gateway/base/base_llm.txt +1 -1
- solace_agent_mesh/gateway/base/base_llm_detail.txt +235 -0
- solace_agent_mesh/gateway/gateway_llm.txt +242 -235
- solace_agent_mesh/gateway/gateway_llm_detail.txt +3885 -0
- solace_agent_mesh/gateway/http_sse/alembic/alembic_llm.txt +295 -0
- solace_agent_mesh/gateway/http_sse/alembic/env.py +10 -1
- solace_agent_mesh/gateway/http_sse/alembic/versions/20251006_98882922fa59_add_tasks_events_feedback_chat_tasks.py +190 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/versions_llm.txt +155 -0
- solace_agent_mesh/gateway/http_sse/alembic.ini +1 -1
- solace_agent_mesh/gateway/http_sse/app.py +148 -2
- solace_agent_mesh/gateway/http_sse/component.py +368 -60
- solace_agent_mesh/gateway/http_sse/components/components_llm.txt +46 -6
- solace_agent_mesh/gateway/http_sse/components/task_logger_forwarder.py +108 -0
- solace_agent_mesh/gateway/http_sse/components/visualization_forwarder_component.py +1 -1
- solace_agent_mesh/gateway/http_sse/dependencies.py +116 -26
- solace_agent_mesh/gateway/http_sse/http_sse_llm.txt +172 -172
- solace_agent_mesh/gateway/http_sse/http_sse_llm_detail.txt +3278 -0
- solace_agent_mesh/gateway/http_sse/main.py +146 -41
- solace_agent_mesh/gateway/http_sse/repository/__init__.py +3 -12
- solace_agent_mesh/gateway/http_sse/repository/chat_task_repository.py +103 -0
- solace_agent_mesh/gateway/http_sse/repository/entities/__init__.py +5 -3
- solace_agent_mesh/gateway/http_sse/repository/entities/chat_task.py +75 -0
- solace_agent_mesh/gateway/http_sse/repository/entities/entities_llm.txt +263 -0
- solace_agent_mesh/gateway/http_sse/repository/entities/feedback.py +20 -0
- solace_agent_mesh/gateway/http_sse/repository/entities/session_history.py +0 -16
- solace_agent_mesh/gateway/http_sse/repository/entities/task.py +25 -0
- solace_agent_mesh/gateway/http_sse/repository/entities/task_event.py +21 -0
- solace_agent_mesh/gateway/http_sse/repository/feedback_repository.py +81 -0
- solace_agent_mesh/gateway/http_sse/repository/interfaces.py +73 -18
- solace_agent_mesh/gateway/http_sse/repository/models/__init__.py +9 -5
- solace_agent_mesh/gateway/http_sse/repository/models/chat_task_model.py +31 -0
- solace_agent_mesh/gateway/http_sse/repository/models/feedback_model.py +21 -0
- solace_agent_mesh/gateway/http_sse/repository/models/models_llm.txt +266 -0
- solace_agent_mesh/gateway/http_sse/repository/models/session_model.py +3 -3
- solace_agent_mesh/gateway/http_sse/repository/models/task_event_model.py +25 -0
- solace_agent_mesh/gateway/http_sse/repository/models/task_model.py +32 -0
- solace_agent_mesh/gateway/http_sse/repository/repository_llm.txt +340 -0
- solace_agent_mesh/gateway/http_sse/repository/session_repository.py +4 -53
- solace_agent_mesh/gateway/http_sse/repository/task_repository.py +173 -0
- solace_agent_mesh/gateway/http_sse/routers/artifacts.py +1 -1
- solace_agent_mesh/gateway/http_sse/routers/config.py +26 -4
- solace_agent_mesh/gateway/http_sse/routers/dto/dto_llm.txt +346 -0
- solace_agent_mesh/gateway/http_sse/routers/dto/requests/__init__.py +3 -3
- solace_agent_mesh/gateway/http_sse/routers/dto/requests/requests_llm.txt +83 -0
- solace_agent_mesh/gateway/http_sse/routers/dto/requests/session_requests.py +2 -10
- solace_agent_mesh/gateway/http_sse/routers/dto/requests/task_requests.py +58 -0
- solace_agent_mesh/gateway/http_sse/routers/dto/responses/__init__.py +5 -3
- solace_agent_mesh/gateway/http_sse/routers/dto/responses/responses_llm.txt +107 -0
- solace_agent_mesh/gateway/http_sse/routers/dto/responses/session_responses.py +1 -15
- solace_agent_mesh/gateway/http_sse/routers/dto/responses/task_responses.py +30 -0
- solace_agent_mesh/gateway/http_sse/routers/feedback.py +37 -0
- solace_agent_mesh/gateway/http_sse/routers/routers_llm.txt +255 -204
- solace_agent_mesh/gateway/http_sse/routers/sessions.py +220 -40
- solace_agent_mesh/gateway/http_sse/routers/tasks.py +168 -42
- solace_agent_mesh/gateway/http_sse/services/data_retention_service.py +272 -0
- solace_agent_mesh/gateway/http_sse/services/feedback_service.py +241 -0
- solace_agent_mesh/gateway/http_sse/services/people_service.py +0 -80
- solace_agent_mesh/gateway/http_sse/services/services_llm.txt +177 -13
- solace_agent_mesh/gateway/http_sse/services/session_service.py +151 -84
- solace_agent_mesh/gateway/http_sse/services/task_logger_service.py +317 -0
- solace_agent_mesh/gateway/http_sse/shared/exception_handlers.py +25 -14
- solace_agent_mesh/gateway/http_sse/shared/shared_llm.txt +285 -0
- solace_agent_mesh/gateway/http_sse/shared/types.py +7 -0
- solace_agent_mesh/gateway/http_sse/utils/__init__.py +1 -0
- solace_agent_mesh/gateway/http_sse/utils/stim_utils.py +32 -0
- solace_agent_mesh/gateway/http_sse/utils/utils_llm.txt +47 -0
- solace_agent_mesh/solace_agent_mesh_llm.txt +1 -1
- solace_agent_mesh/solace_agent_mesh_llm_detail.txt +8599 -0
- {solace_agent_mesh-1.4.12.dist-info → solace_agent_mesh-1.5.0.dist-info}/METADATA +1 -1
- {solace_agent_mesh-1.4.12.dist-info → solace_agent_mesh-1.5.0.dist-info}/RECORD +172 -124
- solace_agent_mesh/agent/adk/invocation_monitor.py +0 -295
- solace_agent_mesh/assets/docs/assets/js/483cef9a.4736f2d8.js +0 -1
- solace_agent_mesh/assets/docs/lunr-index-1759936913198.json +0 -1
- solace_agent_mesh/assets/docs/search-doc-1759936913198.json +0 -1
- solace_agent_mesh/client/webui/frontend/static/assets/main-ChRwcV89.css +0 -1
- solace_agent_mesh/client/webui/frontend/static/assets/main-DnnE01OM.js +0 -339
- solace_agent_mesh/gateway/http_sse/repository/entities/message.py +0 -41
- solace_agent_mesh/gateway/http_sse/repository/message_repository.py +0 -84
- solace_agent_mesh/gateway/http_sse/repository/models/message_model.py +0 -45
- /solace_agent_mesh/assets/docs/assets/js/{main.f67fc9f4.js.LICENSE.txt → main.0c149855.js.LICENSE.txt} +0 -0
- {solace_agent_mesh-1.4.12.dist-info → solace_agent_mesh-1.5.0.dist-info}/WHEEL +0 -0
- {solace_agent_mesh-1.4.12.dist-info → solace_agent_mesh-1.5.0.dist-info}/entry_points.txt +0 -0
- {solace_agent_mesh-1.4.12.dist-info → solace_agent_mesh-1.5.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# DEVELOPER GUIDE: requests
|
|
2
|
+
|
|
3
|
+
## Quick Summary
|
|
4
|
+
This directory contains request Data Transfer Objects (DTOs) for API endpoints, specifically focused on session management operations. These Pydantic models define the structure and validation rules for incoming API requests.
|
|
5
|
+
|
|
6
|
+
## Files Overview
|
|
7
|
+
- `__init__.py` - Exports all session-related request DTOs for easy importing
|
|
8
|
+
- `session_requests.py` - Defines request DTOs for session CRUD operations (get, update, history retrieval)
|
|
9
|
+
|
|
10
|
+
## Developer API Reference
|
|
11
|
+
|
|
12
|
+
### __init__.py
|
|
13
|
+
**Purpose:** Provides centralized imports for all request DTOs
|
|
14
|
+
**Import:** `from solace_agent_mesh.gateway.http_sse.routers.dto.requests import GetSessionRequest, GetSessionHistoryRequest, UpdateSessionRequest`
|
|
15
|
+
|
|
16
|
+
**Usage Examples:**
|
|
17
|
+
```python
|
|
18
|
+
# Import all session request DTOs
|
|
19
|
+
from solace_agent_mesh.gateway.http_sse.routers.dto.requests import (
|
|
20
|
+
GetSessionRequest,
|
|
21
|
+
GetSessionHistoryRequest,
|
|
22
|
+
UpdateSessionRequest
|
|
23
|
+
)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### session_requests.py
|
|
27
|
+
**Purpose:** Defines Pydantic models for session-related API request validation
|
|
28
|
+
**Import:** `from solace_agent_mesh.gateway.http_sse.routers.dto.requests.session_requests import GetSessionRequest, GetSessionHistoryRequest, UpdateSessionRequest`
|
|
29
|
+
|
|
30
|
+
**Classes:**
|
|
31
|
+
- `GetSessionRequest(session_id: SessionId, user_id: UserId)` - Request DTO for retrieving a specific session by ID
|
|
32
|
+
- `GetSessionHistoryRequest(session_id: SessionId, user_id: UserId, pagination: Optional[PaginationInfo] = None)` - Request DTO for retrieving session message history with optional pagination
|
|
33
|
+
- `UpdateSessionRequest(session_id: SessionId, user_id: UserId, name: str)` - Request DTO for updating session details with validation (name must be 1-255 characters)
|
|
34
|
+
|
|
35
|
+
**Usage Examples:**
|
|
36
|
+
```python
|
|
37
|
+
from solace_agent_mesh.gateway.http_sse.routers.dto.requests.session_requests import (
|
|
38
|
+
GetSessionRequest,
|
|
39
|
+
GetSessionHistoryRequest,
|
|
40
|
+
UpdateSessionRequest
|
|
41
|
+
)
|
|
42
|
+
from pydantic import ValidationError
|
|
43
|
+
|
|
44
|
+
# Create a request to get a specific session
|
|
45
|
+
get_session_req = GetSessionRequest(
|
|
46
|
+
session_id="session456",
|
|
47
|
+
user_id="user123"
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
# Create a request to get session history with pagination
|
|
51
|
+
get_history_req = GetSessionHistoryRequest(
|
|
52
|
+
session_id="session456",
|
|
53
|
+
user_id="user123",
|
|
54
|
+
pagination={"page": 1, "size": 20}
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
# Create a request to update a session name
|
|
58
|
+
update_req = UpdateSessionRequest(
|
|
59
|
+
session_id="session456",
|
|
60
|
+
user_id="user123",
|
|
61
|
+
name="My Updated Session"
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
# Validate request data from dictionary
|
|
65
|
+
request_data = {
|
|
66
|
+
"session_id": "session789",
|
|
67
|
+
"user_id": "user456",
|
|
68
|
+
"name": "New Session Name"
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
try:
|
|
72
|
+
validated_request = UpdateSessionRequest(**request_data)
|
|
73
|
+
print(f"Valid request: {validated_request}")
|
|
74
|
+
except ValidationError as e:
|
|
75
|
+
print(f"Validation failed: {e}")
|
|
76
|
+
|
|
77
|
+
# Access validated fields
|
|
78
|
+
print(f"Session ID: {update_req.session_id}")
|
|
79
|
+
print(f"User ID: {update_req.user_id}")
|
|
80
|
+
print(f"New name: {update_req.name}")
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
# content_hash: d40151714f449905662170c71b393dba7c98e7ec1c46f5f3a861097b2d5376b2
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
Session-related request DTOs.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from typing import Optional
|
|
6
5
|
from pydantic import BaseModel, Field
|
|
7
6
|
|
|
8
|
-
from ....shared.types import SessionId, UserId
|
|
7
|
+
from ....shared.types import SessionId, UserId
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
class GetSessionRequest(BaseModel):
|
|
@@ -14,15 +13,8 @@ class GetSessionRequest(BaseModel):
|
|
|
14
13
|
user_id: UserId
|
|
15
14
|
|
|
16
15
|
|
|
17
|
-
class GetSessionHistoryRequest(BaseModel):
|
|
18
|
-
"""Request DTO for retrieving session message history."""
|
|
19
|
-
session_id: SessionId
|
|
20
|
-
user_id: UserId
|
|
21
|
-
pagination: Optional[PaginationInfo] = None
|
|
22
|
-
|
|
23
|
-
|
|
24
16
|
class UpdateSessionRequest(BaseModel):
|
|
25
17
|
"""Request DTO for updating session details."""
|
|
26
18
|
session_id: SessionId
|
|
27
19
|
user_id: UserId
|
|
28
|
-
name: str = Field(..., min_length=1, max_length=255, description="New session name")
|
|
20
|
+
name: str = Field(..., min_length=1, max_length=255, description="New session name")
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Task-related request DTOs.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
from typing import Optional
|
|
7
|
+
from pydantic import BaseModel, Field, field_validator
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class SaveTaskRequest(BaseModel):
|
|
11
|
+
"""Request DTO for saving a task."""
|
|
12
|
+
|
|
13
|
+
task_id: str = Field(..., alias="taskId", min_length=1)
|
|
14
|
+
user_message: Optional[str] = Field(None, alias="userMessage")
|
|
15
|
+
message_bubbles: str = Field(..., alias="messageBubbles") # JSON string (opaque)
|
|
16
|
+
task_metadata: Optional[str] = Field(None, alias="taskMetadata") # JSON string (opaque)
|
|
17
|
+
|
|
18
|
+
model_config = {"populate_by_name": True}
|
|
19
|
+
|
|
20
|
+
@field_validator("task_id")
|
|
21
|
+
@classmethod
|
|
22
|
+
def validate_task_id(cls, v: str) -> str:
|
|
23
|
+
"""Validate that task_id is non-empty."""
|
|
24
|
+
if not v or not v.strip():
|
|
25
|
+
raise ValueError("task_id cannot be empty")
|
|
26
|
+
return v.strip()
|
|
27
|
+
|
|
28
|
+
@field_validator("message_bubbles")
|
|
29
|
+
@classmethod
|
|
30
|
+
def validate_message_bubbles(cls, v: str) -> str:
|
|
31
|
+
"""Validate that message_bubbles is a non-empty JSON string."""
|
|
32
|
+
if not v or not v.strip():
|
|
33
|
+
raise ValueError("message_bubbles cannot be empty")
|
|
34
|
+
|
|
35
|
+
# Validate it's valid JSON (but don't validate structure)
|
|
36
|
+
try:
|
|
37
|
+
parsed = json.loads(v)
|
|
38
|
+
if not isinstance(parsed, list) or len(parsed) == 0:
|
|
39
|
+
raise ValueError("message_bubbles must be a non-empty JSON array")
|
|
40
|
+
except json.JSONDecodeError as e:
|
|
41
|
+
raise ValueError(f"message_bubbles must be valid JSON: {e}")
|
|
42
|
+
|
|
43
|
+
return v
|
|
44
|
+
|
|
45
|
+
@field_validator("task_metadata")
|
|
46
|
+
@classmethod
|
|
47
|
+
def validate_task_metadata(cls, v: Optional[str]) -> Optional[str]:
|
|
48
|
+
"""Validate that task_metadata is valid JSON if provided."""
|
|
49
|
+
if v is None or not v.strip():
|
|
50
|
+
return None
|
|
51
|
+
|
|
52
|
+
# Validate it's valid JSON (but don't validate structure)
|
|
53
|
+
try:
|
|
54
|
+
json.loads(v)
|
|
55
|
+
except json.JSONDecodeError as e:
|
|
56
|
+
raise ValueError(f"task_metadata must be valid JSON: {e}")
|
|
57
|
+
|
|
58
|
+
return v
|
|
@@ -3,14 +3,16 @@ Response DTOs for API endpoints.
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
from .session_responses import (
|
|
6
|
-
MessageResponse,
|
|
7
6
|
SessionResponse,
|
|
8
7
|
SessionListResponse,
|
|
9
8
|
)
|
|
9
|
+
from .task_responses import TaskResponse, TaskListResponse
|
|
10
10
|
|
|
11
11
|
__all__ = [
|
|
12
12
|
# Session responses
|
|
13
|
-
"MessageResponse",
|
|
14
13
|
"SessionResponse",
|
|
15
14
|
"SessionListResponse",
|
|
16
|
-
|
|
15
|
+
# Task responses
|
|
16
|
+
"TaskResponse",
|
|
17
|
+
"TaskListResponse",
|
|
18
|
+
]
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# DEVELOPER GUIDE: responses
|
|
2
|
+
|
|
3
|
+
## Quick Summary
|
|
4
|
+
The `responses` directory contains Pydantic response DTOs (Data Transfer Objects) for API endpoints. It provides structured response models with automatic timestamp conversion from epoch milliseconds to ISO 8601 strings for JSON serialization.
|
|
5
|
+
|
|
6
|
+
## Files Overview
|
|
7
|
+
- `__init__.py` - Exports all response DTOs for easy importing
|
|
8
|
+
- `base_responses.py` - Base response class with automatic timestamp serialization
|
|
9
|
+
- `session_responses.py` - Session and message-related response DTOs
|
|
10
|
+
|
|
11
|
+
## Developer API Reference
|
|
12
|
+
|
|
13
|
+
### __init__.py
|
|
14
|
+
**Purpose:** Central import point for all response DTOs
|
|
15
|
+
**Import:** `from solace_agent_mesh.gateway.http_sse.routers.dto.responses import MessageResponse, SessionResponse, SessionListResponse`
|
|
16
|
+
|
|
17
|
+
### base_responses.py
|
|
18
|
+
**Purpose:** Provides base response class with automatic timestamp field conversion
|
|
19
|
+
**Import:** `from solace_agent_mesh.gateway.http_sse.routers.dto.responses.base_responses import BaseTimestampResponse`
|
|
20
|
+
|
|
21
|
+
**Classes:**
|
|
22
|
+
- `BaseTimestampResponse(BaseModel)` - Base class for responses with timestamp fields that auto-converts epoch ms to ISO strings
|
|
23
|
+
- `model_dump(**kwargs) -> dict[str, Any]` - Converts timestamp fields to ISO strings in output
|
|
24
|
+
- `model_dump_json(**kwargs) -> str` - Serializes to JSON with timestamp conversion
|
|
25
|
+
|
|
26
|
+
**Usage Examples:**
|
|
27
|
+
```python
|
|
28
|
+
from solace_agent_mesh.gateway.http_sse.routers.dto.responses.base_responses import BaseTimestampResponse
|
|
29
|
+
|
|
30
|
+
class MyResponse(BaseTimestampResponse):
|
|
31
|
+
name: str
|
|
32
|
+
created_time: int # Will be auto-converted to ISO string in JSON output
|
|
33
|
+
updated_time: int | None = None
|
|
34
|
+
|
|
35
|
+
# Usage
|
|
36
|
+
response = MyResponse(name="test", created_time=1640995200000)
|
|
37
|
+
json_data = response.model_dump() # created_time becomes ISO string
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### session_responses.py
|
|
41
|
+
**Purpose:** Session and message response DTOs with field aliasing for API consistency
|
|
42
|
+
**Import:** `from solace_agent_mesh.gateway.http_sse.routers.dto.responses import MessageResponse, SessionResponse, SessionListResponse`
|
|
43
|
+
|
|
44
|
+
**Classes:**
|
|
45
|
+
- `MessageResponse(BaseTimestampResponse)` - Response DTO for chat messages
|
|
46
|
+
- `id: MessageId` - Unique message identifier
|
|
47
|
+
- `session_id: SessionId` - Session this message belongs to (aliased as "sessionId")
|
|
48
|
+
- `message: str` - Message content
|
|
49
|
+
- `sender_type: SenderType` - Type of sender (aliased as "senderType")
|
|
50
|
+
- `sender_name: str` - Name of sender (aliased as "senderName")
|
|
51
|
+
- `message_type: MessageType` - Type of message (aliased as "messageType")
|
|
52
|
+
- `created_time: int` - Creation timestamp in epoch ms (aliased as "createdTime")
|
|
53
|
+
- `updated_time: int | None` - Update timestamp in epoch ms (aliased as "updatedTime")
|
|
54
|
+
|
|
55
|
+
- `SessionResponse(BaseTimestampResponse)` - Response DTO for chat sessions
|
|
56
|
+
- `id: SessionId` - Unique session identifier
|
|
57
|
+
- `user_id: UserId` - User who owns the session (aliased as "userId")
|
|
58
|
+
- `name: str | None` - Optional session name
|
|
59
|
+
- `agent_id: str | None` - Optional agent identifier (aliased as "agentId")
|
|
60
|
+
- `created_time: int` - Creation timestamp in epoch ms (aliased as "createdTime")
|
|
61
|
+
- `updated_time: int | None` - Update timestamp in epoch ms (aliased as "updatedTime")
|
|
62
|
+
|
|
63
|
+
- `SessionListResponse(BaseModel)` - Response DTO for paginated session lists
|
|
64
|
+
- `sessions: list[SessionResponse]` - List of session objects
|
|
65
|
+
- `pagination: PaginationInfo | None` - Pagination metadata
|
|
66
|
+
- `total_count: int` - Total number of sessions (aliased as "totalCount")
|
|
67
|
+
|
|
68
|
+
**Usage Examples:**
|
|
69
|
+
```python
|
|
70
|
+
from solace_agent_mesh.gateway.http_sse.routers.dto.responses import (
|
|
71
|
+
MessageResponse,
|
|
72
|
+
SessionResponse,
|
|
73
|
+
SessionListResponse
|
|
74
|
+
)
|
|
75
|
+
from solace_agent_mesh.gateway.http_sse.shared.enums import MessageType, SenderType
|
|
76
|
+
|
|
77
|
+
# Create a message response
|
|
78
|
+
message = MessageResponse(
|
|
79
|
+
id="msg_123",
|
|
80
|
+
session_id="sess_456",
|
|
81
|
+
message="Hello world",
|
|
82
|
+
sender_type=SenderType.USER,
|
|
83
|
+
sender_name="John Doe",
|
|
84
|
+
message_type=MessageType.TEXT,
|
|
85
|
+
created_time=1640995200000
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
# Create a session response
|
|
89
|
+
session = SessionResponse(
|
|
90
|
+
id="sess_456",
|
|
91
|
+
user_id="user_789",
|
|
92
|
+
name="My Chat Session",
|
|
93
|
+
agent_id="agent_001",
|
|
94
|
+
created_time=1640995200000
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
# Create a session list response
|
|
98
|
+
session_list = SessionListResponse(
|
|
99
|
+
sessions=[session],
|
|
100
|
+
total_count=1
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
# Serialize to JSON (timestamps auto-converted to ISO strings)
|
|
104
|
+
json_output = message.model_dump_json()
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
# content_hash: ed7205266a0eb2b2cb548d0c84fd44758cf1030524ffb144d08e9c82545fc4eb
|
|
@@ -4,24 +4,10 @@ Session-related response DTOs.
|
|
|
4
4
|
|
|
5
5
|
from pydantic import BaseModel, ConfigDict, Field
|
|
6
6
|
|
|
7
|
-
from ....shared.
|
|
8
|
-
from ....shared.types import MessageId, PaginationInfo, SessionId, UserId
|
|
7
|
+
from ....shared.types import PaginationInfo, SessionId, UserId
|
|
9
8
|
from .base_responses import BaseTimestampResponse
|
|
10
9
|
|
|
11
10
|
|
|
12
|
-
class MessageResponse(BaseTimestampResponse):
|
|
13
|
-
"""Response DTO for a chat message."""
|
|
14
|
-
|
|
15
|
-
id: MessageId
|
|
16
|
-
session_id: SessionId = Field(alias="sessionId")
|
|
17
|
-
message: str
|
|
18
|
-
sender_type: SenderType = Field(alias="senderType")
|
|
19
|
-
sender_name: str = Field(alias="senderName")
|
|
20
|
-
message_type: MessageType = Field(default=MessageType.TEXT, alias="messageType")
|
|
21
|
-
created_time: int = Field(alias="createdTime")
|
|
22
|
-
updated_time: int | None = Field(default=None, alias="updatedTime")
|
|
23
|
-
|
|
24
|
-
|
|
25
11
|
class SessionResponse(BaseTimestampResponse):
|
|
26
12
|
"""Response DTO for a session."""
|
|
27
13
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Task-related response DTOs.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from typing import List, Optional
|
|
6
|
+
from pydantic import BaseModel, Field
|
|
7
|
+
|
|
8
|
+
from .base_responses import BaseTimestampResponse
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class TaskResponse(BaseTimestampResponse):
|
|
12
|
+
"""Response DTO for a single task."""
|
|
13
|
+
|
|
14
|
+
task_id: str = Field(..., alias="taskId")
|
|
15
|
+
session_id: str = Field(..., alias="sessionId")
|
|
16
|
+
user_message: Optional[str] = Field(None, alias="userMessage")
|
|
17
|
+
message_bubbles: str = Field(..., alias="messageBubbles") # JSON string (opaque)
|
|
18
|
+
task_metadata: Optional[str] = Field(None, alias="taskMetadata") # JSON string (opaque)
|
|
19
|
+
created_time: int = Field(..., alias="createdTime")
|
|
20
|
+
updated_time: Optional[int] = Field(None, alias="updatedTime")
|
|
21
|
+
|
|
22
|
+
model_config = {"populate_by_name": True}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class TaskListResponse(BaseModel):
|
|
26
|
+
"""Response DTO for a list of tasks."""
|
|
27
|
+
|
|
28
|
+
tasks: List[TaskResponse]
|
|
29
|
+
|
|
30
|
+
model_config = {"populate_by_name": True}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""
|
|
2
|
+
API Router for receiving and processing user feedback on chat messages.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from typing import Literal, Optional
|
|
6
|
+
|
|
7
|
+
from fastapi import APIRouter, Depends
|
|
8
|
+
from fastapi import Request as FastAPIRequest
|
|
9
|
+
from pydantic import BaseModel, Field
|
|
10
|
+
|
|
11
|
+
from ..dependencies import get_feedback_service, get_user_id
|
|
12
|
+
from ..services.feedback_service import FeedbackService
|
|
13
|
+
|
|
14
|
+
router = APIRouter()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class FeedbackPayload(BaseModel):
|
|
18
|
+
"""Data model for the feedback submission payload."""
|
|
19
|
+
|
|
20
|
+
task_id: str = Field(..., alias="taskId")
|
|
21
|
+
session_id: str = Field(..., alias="sessionId")
|
|
22
|
+
feedback_type: Literal["up", "down"] = Field(..., alias="feedbackType")
|
|
23
|
+
feedback_text: Optional[str] = Field(None, alias="feedbackText")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@router.post("/feedback", status_code=202, tags=["Feedback"])
|
|
27
|
+
async def submit_feedback(
|
|
28
|
+
payload: FeedbackPayload,
|
|
29
|
+
request: FastAPIRequest,
|
|
30
|
+
user_id: str = Depends(get_user_id),
|
|
31
|
+
feedback_service: FeedbackService = Depends(get_feedback_service),
|
|
32
|
+
):
|
|
33
|
+
"""
|
|
34
|
+
Receives and processes user feedback for a specific task.
|
|
35
|
+
"""
|
|
36
|
+
await feedback_service.process_feedback(payload, user_id)
|
|
37
|
+
return {"status": "feedback received"}
|