xpander-sdk 2.0.144__py3-none-any.whl → 2.0.161__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.
- xpander_sdk/consts/api_routes.py +1 -0
- xpander_sdk/models/activity.py +65 -0
- xpander_sdk/models/deep_planning.py +18 -0
- xpander_sdk/models/events.py +3 -0
- xpander_sdk/modules/agents/models/agent.py +4 -1
- xpander_sdk/modules/agents/sub_modules/agent.py +7 -0
- xpander_sdk/modules/backend/frameworks/agno.py +245 -5
- xpander_sdk/modules/backend/utils/mcp_oauth.py +1 -1
- xpander_sdk/modules/events/events_module.py +21 -0
- xpander_sdk/modules/tasks/sub_modules/task.py +235 -77
- xpander_sdk/modules/tools_repository/models/mcp.py +1 -0
- xpander_sdk/modules/tools_repository/tools_repository_module.py +6 -2
- {xpander_sdk-2.0.144.dist-info → xpander_sdk-2.0.161.dist-info}/METADATA +130 -4
- {xpander_sdk-2.0.144.dist-info → xpander_sdk-2.0.161.dist-info}/RECORD +17 -15
- {xpander_sdk-2.0.144.dist-info → xpander_sdk-2.0.161.dist-info}/WHEEL +0 -0
- {xpander_sdk-2.0.144.dist-info → xpander_sdk-2.0.161.dist-info}/licenses/LICENSE +0 -0
- {xpander_sdk-2.0.144.dist-info → xpander_sdk-2.0.161.dist-info}/top_level.txt +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.161
|
|
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
|
|
@@ -131,6 +131,11 @@ tasks = Tasks(configuration=config)
|
|
|
131
131
|
task = await tasks.aget("task-id")
|
|
132
132
|
await task.aset_status(AgentExecutionStatus.Running)
|
|
133
133
|
await task.asave()
|
|
134
|
+
|
|
135
|
+
# Retrieve task activity log
|
|
136
|
+
activity_log = await task.aget_activity_log()
|
|
137
|
+
for message in activity_log.messages:
|
|
138
|
+
print(f"{message.role}: {message.content.text}")
|
|
134
139
|
```
|
|
135
140
|
|
|
136
141
|
### 4. Tools Integration
|
|
@@ -287,6 +292,40 @@ async for event in task.aevents():
|
|
|
287
292
|
print(f"Event Data: {event.data}")
|
|
288
293
|
```
|
|
289
294
|
|
|
295
|
+
### Task Activity Monitoring
|
|
296
|
+
|
|
297
|
+
```python
|
|
298
|
+
from xpander_sdk import Task
|
|
299
|
+
from xpander_sdk.models.activity import (
|
|
300
|
+
AgentActivityThreadMessage,
|
|
301
|
+
AgentActivityThreadToolCall,
|
|
302
|
+
AgentActivityThreadReasoning
|
|
303
|
+
)
|
|
304
|
+
|
|
305
|
+
# Load a completed task
|
|
306
|
+
task = await Task.aload("task-id")
|
|
307
|
+
|
|
308
|
+
# Get detailed activity log
|
|
309
|
+
activity_log = await task.aget_activity_log()
|
|
310
|
+
|
|
311
|
+
# Analyze messages between user and agent
|
|
312
|
+
for message in activity_log.messages:
|
|
313
|
+
if isinstance(message, AgentActivityThreadMessage):
|
|
314
|
+
print(f"{message.role}: {message.content.text}")
|
|
315
|
+
elif isinstance(message, AgentActivityThreadToolCall):
|
|
316
|
+
# Tool call
|
|
317
|
+
print(f"Tool: {message.tool_name}")
|
|
318
|
+
print(f"Payload: {message.payload}")
|
|
319
|
+
print(f"Result: {message.result}")
|
|
320
|
+
elif isinstance(message, AgentActivityThreadReasoning):
|
|
321
|
+
# Reasoning step
|
|
322
|
+
print(f"Reasoning ({message.type}): {message.thought}")
|
|
323
|
+
|
|
324
|
+
# Synchronous version
|
|
325
|
+
task = Task.load("task-id")
|
|
326
|
+
activity_log = task.get_activity_log()
|
|
327
|
+
```
|
|
328
|
+
|
|
290
329
|
### Local Task Testing
|
|
291
330
|
|
|
292
331
|
```python
|
|
@@ -378,6 +417,93 @@ load_dotenv()
|
|
|
378
417
|
config = Configuration()
|
|
379
418
|
```
|
|
380
419
|
|
|
420
|
+
## 🏢 Self-Hosted Deployment
|
|
421
|
+
|
|
422
|
+
If you're using a self-hosted xpander.ai deployment, configure the SDK to point to your Agent Controller endpoint.
|
|
423
|
+
|
|
424
|
+
**Important**: Use the **Agent Controller API key** generated during Helm installation, not your xpander.ai cloud API key.
|
|
425
|
+
|
|
426
|
+
### Configuration
|
|
427
|
+
|
|
428
|
+
```bash
|
|
429
|
+
# Set environment variables
|
|
430
|
+
export XPANDER_API_KEY="your-agent-controller-api-key" # From Helm installation
|
|
431
|
+
export XPANDER_ORGANIZATION_ID="your-org-id"
|
|
432
|
+
export XPANDER_BASE_URL="https://agent-controller.my-company.com"
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
Or configure explicitly:
|
|
436
|
+
|
|
437
|
+
```python
|
|
438
|
+
from xpander_sdk import Configuration
|
|
439
|
+
|
|
440
|
+
config = Configuration(
|
|
441
|
+
api_key="your-agent-controller-api-key", # From Helm installation
|
|
442
|
+
organization_id="your-org-id",
|
|
443
|
+
base_url="https://agent-controller.my-company.com"
|
|
444
|
+
)
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
### Using with Agno Framework
|
|
448
|
+
|
|
449
|
+
```python
|
|
450
|
+
from xpander_sdk import Backend, Configuration
|
|
451
|
+
from agno.agent import Agent
|
|
452
|
+
|
|
453
|
+
# Configure for self-hosted
|
|
454
|
+
config = Configuration(
|
|
455
|
+
api_key="your-agent-controller-api-key", # From Helm installation
|
|
456
|
+
organization_id="your-org-id",
|
|
457
|
+
base_url="https://agent-controller.my-company.com"
|
|
458
|
+
)
|
|
459
|
+
|
|
460
|
+
# Initialize Backend with self-hosted config
|
|
461
|
+
backend = Backend(configuration=config)
|
|
462
|
+
|
|
463
|
+
# Create agent - it will use your self-hosted infrastructure
|
|
464
|
+
agno_agent = Agent(**backend.get_args(agent_id="agent-123"))
|
|
465
|
+
|
|
466
|
+
# Run agent
|
|
467
|
+
result = await agno_agent.arun(
|
|
468
|
+
input="What can you help me with?",
|
|
469
|
+
stream=True
|
|
470
|
+
)
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
### Complete Self-Hosted Example
|
|
474
|
+
|
|
475
|
+
```python
|
|
476
|
+
import asyncio
|
|
477
|
+
from xpander_sdk import Configuration, Agent
|
|
478
|
+
|
|
479
|
+
async def main():
|
|
480
|
+
# Configure for self-hosted deployment
|
|
481
|
+
config = Configuration(
|
|
482
|
+
api_key="your-agent-controller-api-key", # From Helm installation
|
|
483
|
+
organization_id="your-org-id",
|
|
484
|
+
base_url="https://agent-controller.my-company.com"
|
|
485
|
+
)
|
|
486
|
+
|
|
487
|
+
# Load agent from self-hosted deployment
|
|
488
|
+
agent = await Agent.aload("agent-123", configuration=config)
|
|
489
|
+
print(f"Agent: {agent.name}")
|
|
490
|
+
|
|
491
|
+
# Create and execute task
|
|
492
|
+
task = await agent.acreate_task(
|
|
493
|
+
prompt="Analyze Q4 sales data",
|
|
494
|
+
file_urls=["https://example.com/sales-q4.csv"]
|
|
495
|
+
)
|
|
496
|
+
print(f"Task created: {task.id}")
|
|
497
|
+
print(f"Status: {task.status}")
|
|
498
|
+
|
|
499
|
+
if __name__ == "__main__":
|
|
500
|
+
asyncio.run(main())
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
**Important**: Make sure your `base_url` points to the Agent Controller endpoint (e.g., `https://agent-controller.{your-domain}`), not the root domain.
|
|
504
|
+
|
|
505
|
+
📖 **Full Guide**: [Self-Hosted Configuration Documentation](https://docs.xpander.ai/api-reference/configuration/self-hosted)
|
|
506
|
+
|
|
381
507
|
## 🔄 Error Handling
|
|
382
508
|
|
|
383
509
|
```python
|
|
@@ -392,9 +518,9 @@ except ModuleException as e:
|
|
|
392
518
|
## 🤝 Contributing
|
|
393
519
|
|
|
394
520
|
1. Fork the repository
|
|
395
|
-
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
396
|
-
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
397
|
-
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
521
|
+
2. Create a feature branch (`git checkout -b feature/{base_branch}/amazing-feature`)
|
|
522
|
+
3. Commit your changes (`git commit -m 'feat/chore/fix: Add amazing feature'`)
|
|
523
|
+
4. Push to the branch (`git push origin feature/{base_branch}/amazing-feature`)
|
|
398
524
|
5. Open a Pull Request
|
|
399
525
|
|
|
400
526
|
## 📄 License
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
xpander_sdk/__init__.py,sha256=subqRII3DHqi4FYdWS11fuliCXiOttOrd57m6zTW7pY,2671
|
|
2
2
|
xpander_sdk/consts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
xpander_sdk/consts/api_routes.py,sha256=
|
|
3
|
+
xpander_sdk/consts/api_routes.py,sha256=dKUruLanvprTxZO15fR4OWe6ck8JQ8y64XmUJxsbeJY,2278
|
|
4
4
|
xpander_sdk/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
xpander_sdk/core/module_base.py,sha256=YiUonUBXnXqa9wms5O8C9tEfQeWBJCIZg6xzEorV8gI,5480
|
|
6
6
|
xpander_sdk/core/state.py,sha256=GKGJaMALpTGVV2-iPV3cPrQW4dNdFoZPv3oXBjHDhIY,214
|
|
@@ -8,8 +8,10 @@ xpander_sdk/core/xpander_api_client.py,sha256=pT2Bsis0wZ96B7i6Dm6tcGEgPTkhY3vl9a
|
|
|
8
8
|
xpander_sdk/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
xpander_sdk/exceptions/module_exception.py,sha256=2Urni1QEdzOrCdYSRc5eLpuz8aDlvRcn8KNejo_2nGc,1687
|
|
10
10
|
xpander_sdk/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
xpander_sdk/models/activity.py,sha256=I3CxOzUNbrKwHqynCbm7FJja6vanVkCzwwBwET7qvzA,2085
|
|
11
12
|
xpander_sdk/models/configuration.py,sha256=Un8p3C3p3eMiqKK5VsHaZdWhZTRYHbrw2aPUMV8lJSc,3370
|
|
12
|
-
xpander_sdk/models/
|
|
13
|
+
xpander_sdk/models/deep_planning.py,sha256=pCFV5iNSfT99ap1-09k7oO_DIwXx2vPJ3aVM472xL4w,554
|
|
14
|
+
xpander_sdk/models/events.py,sha256=2vIkuPGAbntN_7xggJRw5sMJ1_EzcXyljxPH0ekISlw,2235
|
|
13
15
|
xpander_sdk/models/frameworks.py,sha256=Ptf4aMjZ44L_x8WsCc5X0kjsJObv4dwgSM61no0aW6E,2937
|
|
14
16
|
xpander_sdk/models/shared.py,sha256=gW88kA_UslNinUjtQKpLVF0sHDZnckwLWexRapxPivU,3125
|
|
15
17
|
xpander_sdk/models/user.py,sha256=_FTG0JO6iTrbcvJp-BBJ6nuj281zhyQB5ldQkBCyYDU,749
|
|
@@ -17,22 +19,22 @@ xpander_sdk/modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
|
|
|
17
19
|
xpander_sdk/modules/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
20
|
xpander_sdk/modules/agents/agents_module.py,sha256=3EhKOIPb4c39GOrNt4zU4V6WbsGj7W_yWwRNSJBKmfc,6419
|
|
19
21
|
xpander_sdk/modules/agents/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
-
xpander_sdk/modules/agents/models/agent.py,sha256=
|
|
22
|
+
xpander_sdk/modules/agents/models/agent.py,sha256=tJXNogRjvwlxzJPzesdHm-NBhMOzDnWImC0ndWhyjx4,14969
|
|
21
23
|
xpander_sdk/modules/agents/models/agent_list.py,sha256=byEayS2uLwDKaVT3lAHltrFocQFKpr8XEwQ6NTEEEMo,4081
|
|
22
24
|
xpander_sdk/modules/agents/models/knowledge_bases.py,sha256=YimpjVJxWe8YTbGMD6oGQOA_YV8ztHQHTTBOaBB44ZM,1037
|
|
23
25
|
xpander_sdk/modules/agents/sub_modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
|
-
xpander_sdk/modules/agents/sub_modules/agent.py,sha256=
|
|
26
|
+
xpander_sdk/modules/agents/sub_modules/agent.py,sha256=HHVz00hrRCFZV9uj8Q5TvZHO_ObijMwQw5Gqdwa_nDY,36298
|
|
25
27
|
xpander_sdk/modules/agents/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
28
|
xpander_sdk/modules/agents/utils/generic.py,sha256=XbG4OeHMQo4gVYCsasMlW_b8OoqS1xL3MlUZSjXivu0,81
|
|
27
29
|
xpander_sdk/modules/backend/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
30
|
xpander_sdk/modules/backend/backend_module.py,sha256=wYghMuNXEtXgoyMXBgbMhgE7wYcbRwXJcpEyybF30kA,18927
|
|
29
31
|
xpander_sdk/modules/backend/frameworks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
|
-
xpander_sdk/modules/backend/frameworks/agno.py,sha256=
|
|
32
|
+
xpander_sdk/modules/backend/frameworks/agno.py,sha256=VDrNb2M2RaKDPjlmc-yQeXJZVDpTifF4zl2xaLXvDeg,32538
|
|
31
33
|
xpander_sdk/modules/backend/frameworks/dispatch.py,sha256=5dP4c37C42U53VjM2kkwIRwEw1i0IN3G0YESHH7J3OE,1557
|
|
32
34
|
xpander_sdk/modules/backend/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
|
-
xpander_sdk/modules/backend/utils/mcp_oauth.py,sha256=
|
|
35
|
+
xpander_sdk/modules/backend/utils/mcp_oauth.py,sha256=a4xQGQwRGf2T9h38Vc9VNUwpIeY9y7Mn6B4D2G3tMQM,4387
|
|
34
36
|
xpander_sdk/modules/events/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
|
-
xpander_sdk/modules/events/events_module.py,sha256=
|
|
37
|
+
xpander_sdk/modules/events/events_module.py,sha256=WJcSdmShGmEhd-Qw0R2fWp4OOlefjLs5_WsQlfJ-UrQ,25317
|
|
36
38
|
xpander_sdk/modules/events/decorators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
39
|
xpander_sdk/modules/events/decorators/on_boot.py,sha256=VGtoQcgs3g5bmx3Ze4QB_-ZwBESATYYVR0oZe35eCww,3076
|
|
38
40
|
xpander_sdk/modules/events/decorators/on_shutdown.py,sha256=rFgChspnLDnZm9FS1K636dvZSQDkeugf2e3M83SDgAY,3127
|
|
@@ -57,15 +59,15 @@ xpander_sdk/modules/tasks/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRk
|
|
|
57
59
|
xpander_sdk/modules/tasks/models/task.py,sha256=B0_fwzQEkRE_pZMSLnWuXsUBMdy8HEIxm1FfRpCQma0,5000
|
|
58
60
|
xpander_sdk/modules/tasks/models/tasks_list.py,sha256=8V1T0vCtGN79qLMPwe37pOA7Wvuf8pbJNOhWL0BPo-8,5126
|
|
59
61
|
xpander_sdk/modules/tasks/sub_modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
60
|
-
xpander_sdk/modules/tasks/sub_modules/task.py,sha256=
|
|
62
|
+
xpander_sdk/modules/tasks/sub_modules/task.py,sha256=RlYe4XAhWeUGk2JwlRC__SWP7OFoym8fnCTluYrhHLg,36135
|
|
61
63
|
xpander_sdk/modules/tasks/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
64
|
xpander_sdk/modules/tasks/utils/files.py,sha256=KqqwSQSrwim2-H3XP5wOadDDfngAyEI034tA7Oon-vc,3631
|
|
63
65
|
xpander_sdk/modules/tools_repository/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
|
-
xpander_sdk/modules/tools_repository/tools_repository_module.py,sha256=
|
|
66
|
+
xpander_sdk/modules/tools_repository/tools_repository_module.py,sha256=HpiOtsJwIeyDqb1499X4FuRUdh8v-mQZQlQ2Zlgq1lY,9557
|
|
65
67
|
xpander_sdk/modules/tools_repository/decorators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
66
68
|
xpander_sdk/modules/tools_repository/decorators/register_tool.py,sha256=ep-BlJHmqvG7zcW6l-hz_V0ZJx3PGfNqdijw6VjUGek,4078
|
|
67
69
|
xpander_sdk/modules/tools_repository/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
68
|
-
xpander_sdk/modules/tools_repository/models/mcp.py,sha256=
|
|
70
|
+
xpander_sdk/modules/tools_repository/models/mcp.py,sha256=qGpaiXKiuXw6gAcK8CW6ek6FkZNbBxDXUf1PWF6Tenw,1863
|
|
69
71
|
xpander_sdk/modules/tools_repository/models/tool_invocation_result.py,sha256=Dhowt_fv8v8xWv7xMRJxo6hA8DawXKbWIrsJFMpt5H4,447
|
|
70
72
|
xpander_sdk/modules/tools_repository/sub_modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
71
73
|
xpander_sdk/modules/tools_repository/sub_modules/tool.py,sha256=YUf267PRXtctpPydpQTTnaO3aliSJwapM3WsdGG06Pw,22365
|
|
@@ -77,8 +79,8 @@ xpander_sdk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
|
|
|
77
79
|
xpander_sdk/utils/env.py,sha256=U_zIhqWgKs5fk2-HXjAaODj4oWMc5dRQ0fvw6fqVcFk,1522
|
|
78
80
|
xpander_sdk/utils/event_loop.py,sha256=kJrN0upgBhyI86tkTdfHeajznrIZl44Rl6WDiDG3GHE,2516
|
|
79
81
|
xpander_sdk/utils/tools.py,sha256=lyFkq2yP7DxBkyXYVlnFRwDhQCvf0fZZMDm5fBycze4,1244
|
|
80
|
-
xpander_sdk-2.0.
|
|
81
|
-
xpander_sdk-2.0.
|
|
82
|
-
xpander_sdk-2.0.
|
|
83
|
-
xpander_sdk-2.0.
|
|
84
|
-
xpander_sdk-2.0.
|
|
82
|
+
xpander_sdk-2.0.161.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
83
|
+
xpander_sdk-2.0.161.dist-info/METADATA,sha256=I0vEmwVDjrE9TM2CKj1HTmCFU35l3Zm5nfhSWX_vMI4,15312
|
|
84
|
+
xpander_sdk-2.0.161.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
85
|
+
xpander_sdk-2.0.161.dist-info/top_level.txt,sha256=UCjnxQpsMy5Zoe7lmRuVDO6DI2V_6PgRFfm4oizRbVs,12
|
|
86
|
+
xpander_sdk-2.0.161.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|