xpander-sdk 2.0.108__tar.gz → 2.0.145__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.
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/PKG-INFO +7 -4
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/README.md +2 -3
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/setup.py +4 -2
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/consts/api_routes.py +4 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/core/xpander_api_client.py +4 -1
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/models/configuration.py +5 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/models/events.py +3 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/models/frameworks.py +17 -1
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/models/shared.py +4 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/agents/agents_module.py +15 -7
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/agents/models/agent.py +50 -1
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/agents/sub_modules/agent.py +76 -5
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/backend/backend_module.py +2 -2
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/backend/frameworks/agno.py +123 -19
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/backend/frameworks/dispatch.py +2 -1
- xpander_sdk-2.0.145/src/xpander_sdk/modules/backend/utils/mcp_oauth.py +95 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/events/events_module.py +15 -2
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/tasks/sub_modules/task.py +7 -4
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/tasks/tasks_module.py +8 -2
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/tasks/utils/files.py +5 -2
- xpander_sdk-2.0.145/src/xpander_sdk/modules/tools_repository/models/mcp.py +67 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/tools_repository/tools_repository_module.py +5 -2
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/tools_repository/utils/schemas.py +51 -13
- xpander_sdk-2.0.145/src/xpander_sdk/utils/__init__.py +0 -0
- xpander_sdk-2.0.145/src/xpander_sdk/utils/tools.py +32 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk.egg-info/PKG-INFO +7 -4
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk.egg-info/SOURCES.txt +3 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk.egg-info/requires.txt +4 -0
- xpander_sdk-2.0.108/src/xpander_sdk/modules/tools_repository/models/mcp.py +0 -31
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/LICENSE +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/pyproject.toml +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/setup.cfg +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/consts/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/core/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/core/module_base.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/core/state.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/exceptions/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/exceptions/module_exception.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/models/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/models/user.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/agents/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/agents/models/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/agents/models/agent_list.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/agents/models/knowledge_bases.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/agents/sub_modules/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/agents/utils/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/agents/utils/generic.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/backend/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/backend/frameworks/__init__.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/events → xpander_sdk-2.0.145/src/xpander_sdk/modules/backend/utils}/__init__.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/events/decorators → xpander_sdk-2.0.145/src/xpander_sdk/modules/events}/__init__.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/events/models → xpander_sdk-2.0.145/src/xpander_sdk/modules/events/decorators}/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/events/decorators/on_boot.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/events/decorators/on_shutdown.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/events/decorators/on_task.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/events/utils → xpander_sdk-2.0.145/src/xpander_sdk/modules/events/models}/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/events/models/deployments.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/events/models/events.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/knowledge_bases → xpander_sdk-2.0.145/src/xpander_sdk/modules/events/utils}/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/events/utils/generic.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/events/utils/git_init.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/knowledge_bases/models → xpander_sdk-2.0.145/src/xpander_sdk/modules/knowledge_bases}/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/knowledge_bases/knowledge_bases_module.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/knowledge_bases/sub_modules → xpander_sdk-2.0.145/src/xpander_sdk/modules/knowledge_bases/models}/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/knowledge_bases/models/knowledge_bases.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/knowledge_bases/utils → xpander_sdk-2.0.145/src/xpander_sdk/modules/knowledge_bases/sub_modules}/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/knowledge_bases/sub_modules/knowledge_base.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/knowledge_bases/sub_modules/knowledge_base_document_item.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/tasks → xpander_sdk-2.0.145/src/xpander_sdk/modules/knowledge_bases/utils}/__init__.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/tasks/models → xpander_sdk-2.0.145/src/xpander_sdk/modules/tasks}/__init__.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/tasks/sub_modules → xpander_sdk-2.0.145/src/xpander_sdk/modules/tasks/models}/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/tasks/models/task.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/tasks/models/tasks_list.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/tasks/utils → xpander_sdk-2.0.145/src/xpander_sdk/modules/tasks/sub_modules}/__init__.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/tools_repository → xpander_sdk-2.0.145/src/xpander_sdk/modules/tasks/utils}/__init__.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/tools_repository/decorators → xpander_sdk-2.0.145/src/xpander_sdk/modules/tools_repository}/__init__.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/tools_repository/models → xpander_sdk-2.0.145/src/xpander_sdk/modules/tools_repository/decorators}/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/tools_repository/decorators/register_tool.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/tools_repository/sub_modules → xpander_sdk-2.0.145/src/xpander_sdk/modules/tools_repository/models}/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/tools_repository/models/tool_invocation_result.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk/modules/tools_repository/utils → xpander_sdk-2.0.145/src/xpander_sdk/modules/tools_repository/sub_modules}/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/tools_repository/sub_modules/tool.py +0 -0
- {xpander_sdk-2.0.108/src/xpander_sdk → xpander_sdk-2.0.145/src/xpander_sdk/modules/tools_repository}/utils/__init__.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/tools_repository/utils/generic.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/tools_repository/utils/local_tools.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/utils/env.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/utils/event_loop.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk.egg-info/dependency_links.txt +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk.egg-info/top_level.txt +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/tests/test_agents_module.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/tests/test_api_client.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/tests/test_backend_module.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/tests/test_boot_shutdown_handlers.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/tests/test_configuration.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/tests/test_knowledge_bases_module.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/tests/test_tasks_module.py +0 -0
- {xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/tests/test_tools_repository.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xpander-sdk
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.145
|
|
4
4
|
Summary: xpander.ai Backend-as-a-service for AI Agents - SDK
|
|
5
5
|
Home-page: https://www.xpander.ai
|
|
6
6
|
Author: xpanderAI
|
|
@@ -18,6 +18,8 @@ Requires-Dist: loguru
|
|
|
18
18
|
Requires-Dist: httpx
|
|
19
19
|
Requires-Dist: httpx_sse
|
|
20
20
|
Requires-Dist: nest-asyncio
|
|
21
|
+
Requires-Dist: strands-agents
|
|
22
|
+
Requires-Dist: openai-agents
|
|
21
23
|
Provides-Extra: agno
|
|
22
24
|
Requires-Dist: agno; extra == "agno"
|
|
23
25
|
Requires-Dist: sqlalchemy; extra == "agno"
|
|
@@ -31,6 +33,8 @@ Requires-Dist: anthropic; extra == "dev"
|
|
|
31
33
|
Requires-Dist: mcp; extra == "dev"
|
|
32
34
|
Requires-Dist: openai; extra == "dev"
|
|
33
35
|
Requires-Dist: fireworks-ai; extra == "dev"
|
|
36
|
+
Requires-Dist: aioboto3; extra == "dev"
|
|
37
|
+
Requires-Dist: google-genai; extra == "dev"
|
|
34
38
|
Dynamic: author
|
|
35
39
|
Dynamic: author-email
|
|
36
40
|
Dynamic: classifier
|
|
@@ -47,7 +51,6 @@ Dynamic: summary
|
|
|
47
51
|
|
|
48
52
|
[](https://www.python.org/downloads/) [](https://opensource.org/licenses/MIT) [](https://docs.xpander.ai) [](https://pypi.org/project/xpander-sdk/) [](https://pepy.tech/project/xpander-sdk)
|
|
49
53
|
|
|
50
|
-
|
|
51
54
|
The official Python SDK for xpander.ai - a powerful Backend-as-a-Service (BaaS) platform for building, deploying, and managing AI agents at scale.
|
|
52
55
|
|
|
53
56
|
## 🚀 Overview
|
|
@@ -304,7 +307,7 @@ async def handle_test_task(task):
|
|
|
304
307
|
task.result = {
|
|
305
308
|
"capabilities": [
|
|
306
309
|
"Data analysis",
|
|
307
|
-
"Text processing",
|
|
310
|
+
"Text processing",
|
|
308
311
|
"API integration"
|
|
309
312
|
]
|
|
310
313
|
}
|
|
@@ -402,7 +405,7 @@ This project is licensed under the MIT License - see the LICENSE file for detail
|
|
|
402
405
|
|
|
403
406
|
- **Documentation**: [https://docs.xpander.ai](https://docs.xpander.ai)
|
|
404
407
|
- **Issues**: [GitHub Issues](https://github.com/xpander-ai/xpander-sdk/issues)
|
|
405
|
-
- **Email**:
|
|
408
|
+
- **Email**: support@xpander.ai
|
|
406
409
|
|
|
407
410
|
---
|
|
408
411
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.python.org/downloads/) [](https://opensource.org/licenses/MIT) [](https://docs.xpander.ai) [](https://pypi.org/project/xpander-sdk/) [](https://pepy.tech/project/xpander-sdk)
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
The official Python SDK for xpander.ai - a powerful Backend-as-a-Service (BaaS) platform for building, deploying, and managing AI agents at scale.
|
|
7
6
|
|
|
8
7
|
## 🚀 Overview
|
|
@@ -259,7 +258,7 @@ async def handle_test_task(task):
|
|
|
259
258
|
task.result = {
|
|
260
259
|
"capabilities": [
|
|
261
260
|
"Data analysis",
|
|
262
|
-
"Text processing",
|
|
261
|
+
"Text processing",
|
|
263
262
|
"API integration"
|
|
264
263
|
]
|
|
265
264
|
}
|
|
@@ -357,7 +356,7 @@ This project is licensed under the MIT License - see the LICENSE file for detail
|
|
|
357
356
|
|
|
358
357
|
- **Documentation**: [https://docs.xpander.ai](https://docs.xpander.ai)
|
|
359
358
|
- **Issues**: [GitHub Issues](https://github.com/xpander-ai/xpander-sdk/issues)
|
|
360
|
-
- **Email**:
|
|
359
|
+
- **Email**: support@xpander.ai
|
|
361
360
|
|
|
362
361
|
---
|
|
363
362
|
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="xpander-sdk",
|
|
8
|
-
version="2.0.
|
|
8
|
+
version="2.0.145",
|
|
9
9
|
author="xpanderAI",
|
|
10
10
|
author_email="dev@xpander.ai",
|
|
11
11
|
description="xpander.ai Backend-as-a-service for AI Agents - SDK",
|
|
@@ -22,10 +22,12 @@ setup(
|
|
|
22
22
|
"httpx",
|
|
23
23
|
"httpx_sse",
|
|
24
24
|
"nest-asyncio",
|
|
25
|
+
"strands-agents",
|
|
26
|
+
"openai-agents",
|
|
25
27
|
],
|
|
26
28
|
extras_require={
|
|
27
29
|
"agno": ["agno", "sqlalchemy" ,"psycopg[binary,pool]", "greenlet"],
|
|
28
|
-
"dev": ["black", "pre-commit", "pytest", "anthropic", "mcp", "openai", "fireworks-ai"],
|
|
30
|
+
"dev": ["black", "pre-commit", "pytest", "anthropic", "mcp", "openai", "fireworks-ai", "aioboto3", "google-genai"],
|
|
29
31
|
},
|
|
30
32
|
classifiers=[
|
|
31
33
|
"Programming Language :: Python :: 3",
|
|
@@ -39,6 +39,7 @@ and deleting resources.
|
|
|
39
39
|
UpdateTask = "/agent-execution/{task_id}/update"
|
|
40
40
|
ReportExternalTask = "/agent-execution/{agent_id}/report_task"
|
|
41
41
|
ReportExecutionMetrics = "/agents-metrics/{agent_id}/execution"
|
|
42
|
+
PushExecutionEventToQueue = "/agent-execution/{task_id}/events/push"
|
|
42
43
|
|
|
43
44
|
# Knowledge Bases Endpoints
|
|
44
45
|
ListKnowledgeBases = "/knowledge_bases"
|
|
@@ -48,6 +49,9 @@ and deleting resources.
|
|
|
48
49
|
KnowledgeBaseDocumentsCrud = "/knowledge_bases/{knowledge_base_id}"
|
|
49
50
|
GetKnowledgeBaseDetails = "/knowledge_bases/{knowledge_base_id}/details"
|
|
50
51
|
|
|
52
|
+
# MCP Auth
|
|
53
|
+
GetUserMCPAuthToken = "/mcp_auth/{agent_id}/{user_id}/get_token"
|
|
54
|
+
|
|
51
55
|
# Tools
|
|
52
56
|
GetOrInvokeToolById = "/tools/{tool_id}"
|
|
53
57
|
|
|
@@ -8,6 +8,7 @@ requests to the xpander.ai Backend-as-a-Service platform.
|
|
|
8
8
|
from abc import ABC
|
|
9
9
|
from typing import Optional, Any, Literal, Dict
|
|
10
10
|
import httpx
|
|
11
|
+
from pydantic import BaseModel
|
|
11
12
|
|
|
12
13
|
from xpander_sdk.models.configuration import Configuration
|
|
13
14
|
|
|
@@ -67,6 +68,7 @@ class APIClient(ABC):
|
|
|
67
68
|
query: Optional[Dict[str, Any]] = None,
|
|
68
69
|
headers: Optional[Dict[str, Any]] = None,
|
|
69
70
|
configuration: Optional[Configuration] = None,
|
|
71
|
+
model: Optional[BaseModel] = None,
|
|
70
72
|
) -> Any:
|
|
71
73
|
"""
|
|
72
74
|
Make an authenticated HTTP request to the xpander.ai API.
|
|
@@ -78,6 +80,7 @@ class APIClient(ABC):
|
|
|
78
80
|
query (Optional[Dict[str, Any]]): Query string parameters.
|
|
79
81
|
headers (Optional[Dict[str, Any]]): Extra headers.
|
|
80
82
|
configuration (Optional[Configuration]): Overrides self.configuration.
|
|
83
|
+
model (Optional[BaseModel]): pydantic model to use when constructing the result.
|
|
81
84
|
|
|
82
85
|
Returns:
|
|
83
86
|
Any: Parsed response body (JSON or text).
|
|
@@ -110,7 +113,7 @@ class APIClient(ABC):
|
|
|
110
113
|
content_type = response.headers.get("Content-Type", "")
|
|
111
114
|
if "application/json" in content_type:
|
|
112
115
|
try:
|
|
113
|
-
return response.json()
|
|
116
|
+
return response.json() if not model else model(**response.json())
|
|
114
117
|
except Exception:
|
|
115
118
|
return response.text
|
|
116
119
|
return response.text
|
|
@@ -47,6 +47,11 @@ class Configuration(BaseModel):
|
|
|
47
47
|
description="Base URL for xpander.ai API endpoints"
|
|
48
48
|
)
|
|
49
49
|
|
|
50
|
+
agent_id: Optional[str] = Field(
|
|
51
|
+
default= None,
|
|
52
|
+
description="Agent ID To work on"
|
|
53
|
+
)
|
|
54
|
+
|
|
50
55
|
organization_id: Optional[str] = Field(
|
|
51
56
|
default_factory=lambda: getenv(key="XPANDER_ORGANIZATION_ID"),
|
|
52
57
|
description="Organization identifier for xpander.ai account",
|
|
@@ -12,7 +12,15 @@ class Framework(str, Enum):
|
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
14
|
Agno = "agno"
|
|
15
|
+
GoogleADK = "google-adk"
|
|
16
|
+
LangChain = "langchain"
|
|
17
|
+
OpenAIAgents = "open-ai-agents"
|
|
18
|
+
Strands = "strands-agents"
|
|
15
19
|
|
|
20
|
+
class AgnoToolCallsCompressionSettings(BaseModel):
|
|
21
|
+
enabled: Optional[bool] = False
|
|
22
|
+
threshold: Optional[int] = 3
|
|
23
|
+
instructions: Optional[str] = ""
|
|
16
24
|
|
|
17
25
|
class AgnoSettings(BaseModel):
|
|
18
26
|
"""
|
|
@@ -34,7 +42,13 @@ class AgnoSettings(BaseModel):
|
|
|
34
42
|
"""
|
|
35
43
|
|
|
36
44
|
session_storage: Optional[bool] = True
|
|
37
|
-
|
|
45
|
+
|
|
46
|
+
user_memories: Optional[bool] = False
|
|
47
|
+
agentic_memory: Optional[bool] = False
|
|
48
|
+
|
|
49
|
+
agent_memories: Optional[bool] = False
|
|
50
|
+
agentic_culture: Optional[bool] = False
|
|
51
|
+
|
|
38
52
|
session_summaries: Optional[bool] = False
|
|
39
53
|
num_history_runs: Optional[int] = 3
|
|
40
54
|
max_tool_calls_from_history: Optional[int] = 0
|
|
@@ -46,3 +60,5 @@ class AgnoSettings(BaseModel):
|
|
|
46
60
|
openai_moderation_enabled: Optional[bool] = False
|
|
47
61
|
openai_moderation_categories: Optional[List[str]] = None
|
|
48
62
|
reasoning_tools_enabled: Optional[bool] = False
|
|
63
|
+
|
|
64
|
+
tool_calls_compression: Optional[AgnoToolCallsCompressionSettings] = None
|
|
@@ -6,7 +6,7 @@ within the xpander.ai Backend-as-a-Service platform.
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
from typing import List, Optional
|
|
9
|
-
|
|
9
|
+
from os import getenv
|
|
10
10
|
from httpx import HTTPStatusError
|
|
11
11
|
|
|
12
12
|
from xpander_sdk.consts.api_routes import APIRoute
|
|
@@ -99,7 +99,7 @@ class Agents(ModuleBase):
|
|
|
99
99
|
"""
|
|
100
100
|
return run_sync(self.alist())
|
|
101
101
|
|
|
102
|
-
async def aget(self, agent_id: str, version: Optional[int] = None) -> Agent:
|
|
102
|
+
async def aget(self, agent_id: Optional[str] = None, version: Optional[int] = None) -> Agent:
|
|
103
103
|
"""
|
|
104
104
|
Asynchronously retrieve a specific agent by ID.
|
|
105
105
|
|
|
@@ -108,7 +108,7 @@ class Agents(ModuleBase):
|
|
|
108
108
|
a specific version of the agent.
|
|
109
109
|
|
|
110
110
|
Args:
|
|
111
|
-
agent_id (str): Unique identifier of the agent to retrieve.
|
|
111
|
+
agent_id (Optional[str]): Unique identifier of the agent to retrieve, Fallback to XPANDER_AGENT_ID.
|
|
112
112
|
version (Optional[int]): Specific version number to load. If None,
|
|
113
113
|
loads the latest version.
|
|
114
114
|
|
|
@@ -127,9 +127,12 @@ class Agents(ModuleBase):
|
|
|
127
127
|
>>> # Load specific version
|
|
128
128
|
>>> agent_v2 = await agents.aget("agent-123", version=2)
|
|
129
129
|
"""
|
|
130
|
-
return await Agent.aload(
|
|
130
|
+
return await Agent.aload(
|
|
131
|
+
agent_id=agent_id or self.configuration.agent_id or getenv("XPANDER_AGENT_ID"),
|
|
132
|
+
configuration=self.configuration, version=version
|
|
133
|
+
)
|
|
131
134
|
|
|
132
|
-
def get(self, agent_id: str, version: Optional[int] = None) -> Agent:
|
|
135
|
+
def get(self, agent_id: Optional[str] = None, version: Optional[int] = None) -> Agent:
|
|
133
136
|
"""
|
|
134
137
|
Synchronously retrieve a specific agent by ID.
|
|
135
138
|
|
|
@@ -137,7 +140,7 @@ class Agents(ModuleBase):
|
|
|
137
140
|
asynchronous method and waits for completion.
|
|
138
141
|
|
|
139
142
|
Args:
|
|
140
|
-
agent_id (str): Unique identifier of the agent to retrieve.
|
|
143
|
+
agent_id (Optional[str]): Unique identifier of the agent to retrieve, Fallback to XPANDER_AGENT_ID.
|
|
141
144
|
version (Optional[int]): Specific version number to load. If None,
|
|
142
145
|
loads the latest version.
|
|
143
146
|
|
|
@@ -153,4 +156,9 @@ class Agents(ModuleBase):
|
|
|
153
156
|
>>> agent = agents.get("agent-123")
|
|
154
157
|
>>> result = agent.execute("What is the weather today?")
|
|
155
158
|
"""
|
|
156
|
-
return run_sync(
|
|
159
|
+
return run_sync(
|
|
160
|
+
self.aget(
|
|
161
|
+
agent_id=agent_id,
|
|
162
|
+
version=version
|
|
163
|
+
)
|
|
164
|
+
)
|
|
@@ -72,7 +72,7 @@ class AgentInstructions(BaseModel):
|
|
|
72
72
|
|
|
73
73
|
@computed_field
|
|
74
74
|
@property
|
|
75
|
-
def instructions(self) ->
|
|
75
|
+
def instructions(self) -> str:
|
|
76
76
|
"""
|
|
77
77
|
Get the role-specific instructions for the agent.
|
|
78
78
|
|
|
@@ -87,6 +87,27 @@ class AgentInstructions(BaseModel):
|
|
|
87
87
|
{self.goal_str}
|
|
88
88
|
</goals>
|
|
89
89
|
"""
|
|
90
|
+
|
|
91
|
+
@computed_field
|
|
92
|
+
@property
|
|
93
|
+
def full(self) -> str:
|
|
94
|
+
"""
|
|
95
|
+
Get the role-specific instructions for the agent.
|
|
96
|
+
|
|
97
|
+
Returns:
|
|
98
|
+
List[str]: List of role instructions.
|
|
99
|
+
"""
|
|
100
|
+
return f"""
|
|
101
|
+
<description>
|
|
102
|
+
{self.description}
|
|
103
|
+
</description>
|
|
104
|
+
<instructions>
|
|
105
|
+
{self.role}
|
|
106
|
+
</instructions>
|
|
107
|
+
<goals>
|
|
108
|
+
{self.goal_str}
|
|
109
|
+
</goals>
|
|
110
|
+
"""
|
|
90
111
|
|
|
91
112
|
@computed_field
|
|
92
113
|
@property
|
|
@@ -363,6 +384,30 @@ class AgentGraphItem(BaseModel):
|
|
|
363
384
|
is_first: Optional[bool] = False
|
|
364
385
|
|
|
365
386
|
|
|
387
|
+
|
|
388
|
+
class AIAgentConnectivityDetailsA2AAuthType(str, Enum):
|
|
389
|
+
NoAuth = "none"
|
|
390
|
+
ApiKey = "api_key"
|
|
391
|
+
Basic = "basic"
|
|
392
|
+
Bearer = "bearer"
|
|
393
|
+
|
|
394
|
+
class AIAgentConnectivityDetailsBase(XPanderSharedModel):
|
|
395
|
+
custom_headers: Optional[Dict[str, str]] = {}
|
|
396
|
+
auth_type: Optional[AIAgentConnectivityDetailsA2AAuthType] = AIAgentConnectivityDetailsA2AAuthType.NoAuth
|
|
397
|
+
api_key_header_name: Optional[str] = "X-API-Key"
|
|
398
|
+
auth_value: Optional[str] = None
|
|
399
|
+
|
|
400
|
+
class AIAgentConnectivityDetailsA2A(AIAgentConnectivityDetailsBase):
|
|
401
|
+
agent_url: str
|
|
402
|
+
|
|
403
|
+
class AIAgentConnectivityDetailsCurl(AIAgentConnectivityDetailsBase):
|
|
404
|
+
curl_command: str
|
|
405
|
+
invoke_url: Optional[str] = None # post analysis (auto populate by llm)
|
|
406
|
+
method: Optional[str] = "POST" # post analysis (auto populate by llm)
|
|
407
|
+
prompt_field_name: Optional[str] = "" # post analysis (auto populate by llm) - CAN BE SET BY THE USER
|
|
408
|
+
files_field_name: Optional[str] = "" # post analysis (auto populate by llm) - CAN BE SET BY THE USER
|
|
409
|
+
task_id_field_name: Optional[str] = "" # post analysis (auto populate by llm) - CAN BE SET BY THE USER
|
|
410
|
+
|
|
366
411
|
class AgentType(str, Enum):
|
|
367
412
|
"""
|
|
368
413
|
Enumeration of agent types.
|
|
@@ -370,10 +415,14 @@ class AgentType(str, Enum):
|
|
|
370
415
|
Values:
|
|
371
416
|
Manager: Agent that manages and coordinates other agents.
|
|
372
417
|
Regular: Standard agent for individual task execution.
|
|
418
|
+
A2A: Agent that is used via A2A protocol.
|
|
419
|
+
Curl: Custom Agent that is used via curl.
|
|
373
420
|
"""
|
|
374
421
|
|
|
375
422
|
Manager = "manager"
|
|
376
423
|
Regular = "regular"
|
|
424
|
+
A2A = "a2a"
|
|
425
|
+
Curl = "curl"
|
|
377
426
|
|
|
378
427
|
|
|
379
428
|
@dataclass
|
{xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/agents/sub_modules/agent.py
RENAMED
|
@@ -8,11 +8,12 @@ agents in the xpander.ai Backend-as-a-Service platform.
|
|
|
8
8
|
import asyncio
|
|
9
9
|
from datetime import datetime
|
|
10
10
|
import heapq
|
|
11
|
-
|
|
11
|
+
import re
|
|
12
|
+
from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union
|
|
12
13
|
from httpx import HTTPStatusError
|
|
13
14
|
from loguru import logger
|
|
14
15
|
from pydantic import ConfigDict, computed_field
|
|
15
|
-
|
|
16
|
+
from strands import tool as strands_tool
|
|
16
17
|
from xpander_sdk.consts.api_routes import APIRoute
|
|
17
18
|
from xpander_sdk.core.xpander_api_client import APIClient
|
|
18
19
|
from xpander_sdk.exceptions.module_exception import ModuleException
|
|
@@ -23,9 +24,11 @@ from xpander_sdk.modules.knowledge_bases.models.knowledge_bases import (
|
|
|
23
24
|
KnowledgeBaseSearchResult,
|
|
24
25
|
)
|
|
25
26
|
from xpander_sdk.modules.tools_repository.models.mcp import MCPServerDetails
|
|
26
|
-
from xpander_sdk.models.shared import LLMModelT, OutputFormat, XPanderSharedModel
|
|
27
|
+
from xpander_sdk.models.shared import LLMModelT, OutputFormat, ThinkMode, XPanderSharedModel
|
|
27
28
|
from xpander_sdk.models.user import User
|
|
28
29
|
from xpander_sdk.modules.agents.models.agent import (
|
|
30
|
+
AIAgentConnectivityDetailsA2A,
|
|
31
|
+
AIAgentConnectivityDetailsCurl,
|
|
29
32
|
AgentAccessScope,
|
|
30
33
|
AgentDeploymentType,
|
|
31
34
|
AgentGraphItem,
|
|
@@ -50,6 +53,7 @@ from xpander_sdk.modules.tools_repository.sub_modules.tool import Tool
|
|
|
50
53
|
from xpander_sdk.modules.tools_repository.tools_repository_module import ToolsRepository
|
|
51
54
|
from xpander_sdk.modules.tools_repository.utils.schemas import build_model_from_schema
|
|
52
55
|
from xpander_sdk.utils.event_loop import run_sync
|
|
56
|
+
from xpander_sdk.utils.tools import get_openai_agents_sdk_tools
|
|
53
57
|
|
|
54
58
|
|
|
55
59
|
class AgentGraph(XPanderSharedModel):
|
|
@@ -151,6 +155,7 @@ class Agent(XPanderSharedModel):
|
|
|
151
155
|
webhook_url: Optional[str]
|
|
152
156
|
created_at: Optional[datetime]
|
|
153
157
|
type: Optional[AgentType]
|
|
158
|
+
connectivity_details: Optional[Union[AIAgentConnectivityDetailsA2A,AIAgentConnectivityDetailsCurl, Dict]] = {}
|
|
154
159
|
output_format: Optional[OutputFormat]
|
|
155
160
|
output_schema: Optional[Dict]
|
|
156
161
|
llm_credentials: Optional[LLMCredentials]
|
|
@@ -171,6 +176,7 @@ class Agent(XPanderSharedModel):
|
|
|
171
176
|
environment_id: str = None
|
|
172
177
|
tools: Optional[ToolsRepository] = None
|
|
173
178
|
icon: Optional[str] = "🚀"
|
|
179
|
+
connectivity_details: Optional[Union[AIAgentConnectivityDetailsA2A,AIAgentConnectivityDetailsCurl, Dict]] = {}
|
|
174
180
|
deployment_type: Optional[AgentDeploymentType] = AgentDeploymentType.Serverless
|
|
175
181
|
source_nodes: Optional[List[AgentSourceNode]] = []
|
|
176
182
|
access_scope: Optional[AgentAccessScope] = AgentAccessScope.Organizational
|
|
@@ -393,6 +399,8 @@ class Agent(XPanderSharedModel):
|
|
|
393
399
|
mcp_servers: Optional[List[MCPServerDetails]] = [],
|
|
394
400
|
triggering_agent_id: Optional[str] = None,
|
|
395
401
|
title: Optional[str] = None,
|
|
402
|
+
think_mode: Optional[ThinkMode] = ThinkMode.Default,
|
|
403
|
+
disable_attachment_injection: Optional[bool] = False,
|
|
396
404
|
) -> Task:
|
|
397
405
|
"""
|
|
398
406
|
Asynchronously create a new task and link it to this agent.
|
|
@@ -414,7 +422,9 @@ class Agent(XPanderSharedModel):
|
|
|
414
422
|
expected_output (Optional[str]): Expected output of the execution.
|
|
415
423
|
mcp_servers (Optional[List[MCPServerDetails]]): Optional list of mcp servers to use.
|
|
416
424
|
triggering_agent_id (Optional[str]): Optional triggering agent id.
|
|
417
|
-
|
|
425
|
+
title (Optional[str]): Optional task title.
|
|
426
|
+
think_mode (Optional[ThinkMode]): Optional task think mode, defaults to "default".
|
|
427
|
+
disable_attachment_injection (Optional[bool]): Optional selection if to disable attachment injection to the context window.
|
|
418
428
|
|
|
419
429
|
Returns:
|
|
420
430
|
Task: Created Task object linked to this agent.
|
|
@@ -447,6 +457,8 @@ class Agent(XPanderSharedModel):
|
|
|
447
457
|
"mcp_servers": [server.model_dump() for server in mcp_servers],
|
|
448
458
|
"triggering_agent_id": triggering_agent_id,
|
|
449
459
|
"title": title,
|
|
460
|
+
"think_mode": think_mode.value,
|
|
461
|
+
"disable_attachment_injection": disable_attachment_injection,
|
|
450
462
|
},
|
|
451
463
|
)
|
|
452
464
|
return Task(**created_task, configuration=self.configuration)
|
|
@@ -583,7 +595,8 @@ class Agent(XPanderSharedModel):
|
|
|
583
595
|
ImportError: If required dependencies are missing.
|
|
584
596
|
ValueError: If the connection string for storage is invalid.
|
|
585
597
|
"""
|
|
586
|
-
|
|
598
|
+
framework = Framework.Agno # will be removed
|
|
599
|
+
if self.framework != framework:
|
|
587
600
|
raise NotImplementedError(
|
|
588
601
|
f"Storage for framework '{self.framework}' is not supported."
|
|
589
602
|
)
|
|
@@ -877,3 +890,61 @@ class Agent(XPanderSharedModel):
|
|
|
877
890
|
|
|
878
891
|
if not any(kb.id == knowledge_base_id for kb in self.knowledge_bases):
|
|
879
892
|
self.knowledge_bases.append(AgentKnowledgeBase(id=knowledge_base_id))
|
|
893
|
+
|
|
894
|
+
@computed_field
|
|
895
|
+
@property
|
|
896
|
+
def strands_tools(self) -> List[Any]:
|
|
897
|
+
tools = []
|
|
898
|
+
for _tool in self.tools.list:
|
|
899
|
+
def make_tool(_tool_def: Tool):
|
|
900
|
+
async def invoke(payload: dict):
|
|
901
|
+
return await _tool_def.ainvoke(
|
|
902
|
+
task_id=self.configuration.state.task.id
|
|
903
|
+
if self.configuration.state.task
|
|
904
|
+
else None,
|
|
905
|
+
agent_id=self.id,
|
|
906
|
+
agent_version=self.version,
|
|
907
|
+
payload=payload,
|
|
908
|
+
configuration=_tool.configuration
|
|
909
|
+
)
|
|
910
|
+
return invoke
|
|
911
|
+
|
|
912
|
+
tools.append(
|
|
913
|
+
strands_tool(
|
|
914
|
+
func=make_tool(_tool),
|
|
915
|
+
name=_tool.id,
|
|
916
|
+
description=_tool.description,
|
|
917
|
+
inputSchema={
|
|
918
|
+
"json": {
|
|
919
|
+
"type": "object",
|
|
920
|
+
"properties":{
|
|
921
|
+
"payload": _tool.parameters
|
|
922
|
+
},
|
|
923
|
+
"required": ["payload"]
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
)
|
|
927
|
+
)
|
|
928
|
+
|
|
929
|
+
return tools
|
|
930
|
+
|
|
931
|
+
@computed_field
|
|
932
|
+
@property
|
|
933
|
+
def sanitized_name(self) -> str:
|
|
934
|
+
# Replace invalid characters with underscores
|
|
935
|
+
sanitized = re.sub(r'[^A-Za-z0-9_]', '_', self.name)
|
|
936
|
+
|
|
937
|
+
# If the first character is invalid, prefix with underscore
|
|
938
|
+
if not re.match(r'[A-Za-z_]', sanitized):
|
|
939
|
+
sanitized = '_' + sanitized
|
|
940
|
+
|
|
941
|
+
# Prevent empty result
|
|
942
|
+
if not sanitized:
|
|
943
|
+
sanitized = '_agent'
|
|
944
|
+
|
|
945
|
+
return sanitized
|
|
946
|
+
|
|
947
|
+
@computed_field
|
|
948
|
+
@property
|
|
949
|
+
def openai_agents_sdk_tools(self) -> List[Any]:
|
|
950
|
+
return get_openai_agents_sdk_tools(self)
|
{xpander_sdk-2.0.108 → xpander_sdk-2.0.145}/src/xpander_sdk/modules/backend/backend_module.py
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from os import getenv
|
|
3
|
-
from typing import Any, Callable, Dict, List, Optional
|
|
3
|
+
from typing import Any, Callable, Dict, List, Optional
|
|
4
4
|
|
|
5
5
|
from xpander_sdk.core.module_base import ModuleBase
|
|
6
6
|
from xpander_sdk.models.configuration import Configuration
|
|
@@ -230,7 +230,7 @@ class Backend(ModuleBase):
|
|
|
230
230
|
task: Optional[Task] = None,
|
|
231
231
|
override: Optional[Dict[str, Any]] = None,
|
|
232
232
|
tools: Optional[List[Callable]] = None,
|
|
233
|
-
is_async: Optional[bool] = True
|
|
233
|
+
is_async: Optional[bool] = True,
|
|
234
234
|
) -> Dict[str, Any]:
|
|
235
235
|
"""
|
|
236
236
|
Asynchronously resolve runtime arguments for the specified agent.
|