xpander-sdk 1.60.4__py3-none-any.whl → 2.0.155__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/__init__.py +76 -7793
- xpander_sdk/consts/__init__.py +0 -0
- xpander_sdk/consts/api_routes.py +63 -0
- xpander_sdk/core/__init__.py +0 -0
- xpander_sdk/core/module_base.py +164 -0
- xpander_sdk/core/state.py +10 -0
- xpander_sdk/core/xpander_api_client.py +119 -0
- xpander_sdk/exceptions/__init__.py +0 -0
- xpander_sdk/exceptions/module_exception.py +45 -0
- xpander_sdk/models/__init__.py +0 -0
- xpander_sdk/models/activity.py +65 -0
- xpander_sdk/models/configuration.py +92 -0
- xpander_sdk/models/events.py +70 -0
- xpander_sdk/models/frameworks.py +64 -0
- xpander_sdk/models/shared.py +102 -0
- xpander_sdk/models/user.py +21 -0
- xpander_sdk/modules/__init__.py +0 -0
- xpander_sdk/modules/agents/__init__.py +0 -0
- xpander_sdk/modules/agents/agents_module.py +164 -0
- xpander_sdk/modules/agents/models/__init__.py +0 -0
- xpander_sdk/modules/agents/models/agent.py +477 -0
- xpander_sdk/modules/agents/models/agent_list.py +107 -0
- xpander_sdk/modules/agents/models/knowledge_bases.py +33 -0
- xpander_sdk/modules/agents/sub_modules/__init__.py +0 -0
- xpander_sdk/modules/agents/sub_modules/agent.py +953 -0
- xpander_sdk/modules/agents/utils/__init__.py +0 -0
- xpander_sdk/modules/agents/utils/generic.py +2 -0
- xpander_sdk/modules/backend/__init__.py +0 -0
- xpander_sdk/modules/backend/backend_module.py +425 -0
- xpander_sdk/modules/backend/frameworks/__init__.py +0 -0
- xpander_sdk/modules/backend/frameworks/agno.py +627 -0
- xpander_sdk/modules/backend/frameworks/dispatch.py +36 -0
- xpander_sdk/modules/backend/utils/__init__.py +0 -0
- xpander_sdk/modules/backend/utils/mcp_oauth.py +95 -0
- xpander_sdk/modules/events/__init__.py +0 -0
- xpander_sdk/modules/events/decorators/__init__.py +0 -0
- xpander_sdk/modules/events/decorators/on_boot.py +94 -0
- xpander_sdk/modules/events/decorators/on_shutdown.py +94 -0
- xpander_sdk/modules/events/decorators/on_task.py +203 -0
- xpander_sdk/modules/events/events_module.py +629 -0
- xpander_sdk/modules/events/models/__init__.py +0 -0
- xpander_sdk/modules/events/models/deployments.py +25 -0
- xpander_sdk/modules/events/models/events.py +57 -0
- xpander_sdk/modules/events/utils/__init__.py +0 -0
- xpander_sdk/modules/events/utils/generic.py +56 -0
- xpander_sdk/modules/events/utils/git_init.py +32 -0
- xpander_sdk/modules/knowledge_bases/__init__.py +0 -0
- xpander_sdk/modules/knowledge_bases/knowledge_bases_module.py +217 -0
- xpander_sdk/modules/knowledge_bases/models/__init__.py +0 -0
- xpander_sdk/modules/knowledge_bases/models/knowledge_bases.py +11 -0
- xpander_sdk/modules/knowledge_bases/sub_modules/__init__.py +0 -0
- xpander_sdk/modules/knowledge_bases/sub_modules/knowledge_base.py +107 -0
- xpander_sdk/modules/knowledge_bases/sub_modules/knowledge_base_document_item.py +40 -0
- xpander_sdk/modules/knowledge_bases/utils/__init__.py +0 -0
- xpander_sdk/modules/tasks/__init__.py +0 -0
- xpander_sdk/modules/tasks/models/__init__.py +0 -0
- xpander_sdk/modules/tasks/models/task.py +153 -0
- xpander_sdk/modules/tasks/models/tasks_list.py +107 -0
- xpander_sdk/modules/tasks/sub_modules/__init__.py +0 -0
- xpander_sdk/modules/tasks/sub_modules/task.py +887 -0
- xpander_sdk/modules/tasks/tasks_module.py +492 -0
- xpander_sdk/modules/tasks/utils/__init__.py +0 -0
- xpander_sdk/modules/tasks/utils/files.py +114 -0
- xpander_sdk/modules/tools_repository/__init__.py +0 -0
- xpander_sdk/modules/tools_repository/decorators/__init__.py +0 -0
- xpander_sdk/modules/tools_repository/decorators/register_tool.py +108 -0
- xpander_sdk/modules/tools_repository/models/__init__.py +0 -0
- xpander_sdk/modules/tools_repository/models/mcp.py +68 -0
- xpander_sdk/modules/tools_repository/models/tool_invocation_result.py +14 -0
- xpander_sdk/modules/tools_repository/sub_modules/__init__.py +0 -0
- xpander_sdk/modules/tools_repository/sub_modules/tool.py +578 -0
- xpander_sdk/modules/tools_repository/tools_repository_module.py +259 -0
- xpander_sdk/modules/tools_repository/utils/__init__.py +0 -0
- xpander_sdk/modules/tools_repository/utils/generic.py +57 -0
- xpander_sdk/modules/tools_repository/utils/local_tools.py +52 -0
- xpander_sdk/modules/tools_repository/utils/schemas.py +308 -0
- xpander_sdk/utils/__init__.py +0 -0
- xpander_sdk/utils/env.py +44 -0
- xpander_sdk/utils/event_loop.py +67 -0
- xpander_sdk/utils/tools.py +32 -0
- xpander_sdk-2.0.155.dist-info/METADATA +538 -0
- xpander_sdk-2.0.155.dist-info/RECORD +85 -0
- {xpander_sdk-1.60.4.dist-info → xpander_sdk-2.0.155.dist-info}/WHEEL +1 -1
- {xpander_sdk-1.60.4.dist-info → xpander_sdk-2.0.155.dist-info/licenses}/LICENSE +0 -1
- xpander_sdk/_jsii/__init__.py +0 -39
- xpander_sdk/_jsii/xpander-sdk@1.60.4.jsii.tgz +0 -0
- xpander_sdk/py.typed +0 -1
- xpander_sdk-1.60.4.dist-info/METADATA +0 -368
- xpander_sdk-1.60.4.dist-info/RECORD +0 -9
- {xpander_sdk-1.60.4.dist-info → xpander_sdk-2.0.155.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
xpander_sdk/__init__.py,sha256=subqRII3DHqi4FYdWS11fuliCXiOttOrd57m6zTW7pY,2671
|
|
2
|
+
xpander_sdk/consts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
xpander_sdk/consts/api_routes.py,sha256=dKUruLanvprTxZO15fR4OWe6ck8JQ8y64XmUJxsbeJY,2278
|
|
4
|
+
xpander_sdk/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
xpander_sdk/core/module_base.py,sha256=YiUonUBXnXqa9wms5O8C9tEfQeWBJCIZg6xzEorV8gI,5480
|
|
6
|
+
xpander_sdk/core/state.py,sha256=GKGJaMALpTGVV2-iPV3cPrQW4dNdFoZPv3oXBjHDhIY,214
|
|
7
|
+
xpander_sdk/core/xpander_api_client.py,sha256=pT2Bsis0wZ96B7i6Dm6tcGEgPTkhY3vl9aq-_0Rk30E,4121
|
|
8
|
+
xpander_sdk/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
xpander_sdk/exceptions/module_exception.py,sha256=2Urni1QEdzOrCdYSRc5eLpuz8aDlvRcn8KNejo_2nGc,1687
|
|
10
|
+
xpander_sdk/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
xpander_sdk/models/activity.py,sha256=I3CxOzUNbrKwHqynCbm7FJja6vanVkCzwwBwET7qvzA,2085
|
|
12
|
+
xpander_sdk/models/configuration.py,sha256=Un8p3C3p3eMiqKK5VsHaZdWhZTRYHbrw2aPUMV8lJSc,3370
|
|
13
|
+
xpander_sdk/models/events.py,sha256=bkMl1MX43tKKfOx-Mer1hUOjIGywewc5Y8_2ajh4iu8,2177
|
|
14
|
+
xpander_sdk/models/frameworks.py,sha256=Ptf4aMjZ44L_x8WsCc5X0kjsJObv4dwgSM61no0aW6E,2937
|
|
15
|
+
xpander_sdk/models/shared.py,sha256=gW88kA_UslNinUjtQKpLVF0sHDZnckwLWexRapxPivU,3125
|
|
16
|
+
xpander_sdk/models/user.py,sha256=_FTG0JO6iTrbcvJp-BBJ6nuj281zhyQB5ldQkBCyYDU,749
|
|
17
|
+
xpander_sdk/modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
+
xpander_sdk/modules/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
+
xpander_sdk/modules/agents/agents_module.py,sha256=3EhKOIPb4c39GOrNt4zU4V6WbsGj7W_yWwRNSJBKmfc,6419
|
|
20
|
+
xpander_sdk/modules/agents/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
|
+
xpander_sdk/modules/agents/models/agent.py,sha256=tJXNogRjvwlxzJPzesdHm-NBhMOzDnWImC0ndWhyjx4,14969
|
|
22
|
+
xpander_sdk/modules/agents/models/agent_list.py,sha256=byEayS2uLwDKaVT3lAHltrFocQFKpr8XEwQ6NTEEEMo,4081
|
|
23
|
+
xpander_sdk/modules/agents/models/knowledge_bases.py,sha256=YimpjVJxWe8YTbGMD6oGQOA_YV8ztHQHTTBOaBB44ZM,1037
|
|
24
|
+
xpander_sdk/modules/agents/sub_modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
|
+
xpander_sdk/modules/agents/sub_modules/agent.py,sha256=CKMIlytfDStAoCBzOeJp7VGK6Ti5523TLxK60ZxKink,36098
|
|
26
|
+
xpander_sdk/modules/agents/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
27
|
+
xpander_sdk/modules/agents/utils/generic.py,sha256=XbG4OeHMQo4gVYCsasMlW_b8OoqS1xL3MlUZSjXivu0,81
|
|
28
|
+
xpander_sdk/modules/backend/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
|
+
xpander_sdk/modules/backend/backend_module.py,sha256=wYghMuNXEtXgoyMXBgbMhgE7wYcbRwXJcpEyybF30kA,18927
|
|
30
|
+
xpander_sdk/modules/backend/frameworks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
|
+
xpander_sdk/modules/backend/frameworks/agno.py,sha256=E4_z5Po2uQ9rij22NNX5yBgTDIcbBOD7AHpeZTpWA1c,23828
|
|
32
|
+
xpander_sdk/modules/backend/frameworks/dispatch.py,sha256=5dP4c37C42U53VjM2kkwIRwEw1i0IN3G0YESHH7J3OE,1557
|
|
33
|
+
xpander_sdk/modules/backend/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
|
+
xpander_sdk/modules/backend/utils/mcp_oauth.py,sha256=a4xQGQwRGf2T9h38Vc9VNUwpIeY9y7Mn6B4D2G3tMQM,4387
|
|
35
|
+
xpander_sdk/modules/events/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
|
+
xpander_sdk/modules/events/events_module.py,sha256=QQJ9EjCpmyAje4KkYTXXqXpvjQNXDfMkYr6WcBW1ZNg,24290
|
|
37
|
+
xpander_sdk/modules/events/decorators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
|
+
xpander_sdk/modules/events/decorators/on_boot.py,sha256=VGtoQcgs3g5bmx3Ze4QB_-ZwBESATYYVR0oZe35eCww,3076
|
|
39
|
+
xpander_sdk/modules/events/decorators/on_shutdown.py,sha256=rFgChspnLDnZm9FS1K636dvZSQDkeugf2e3M83SDgAY,3127
|
|
40
|
+
xpander_sdk/modules/events/decorators/on_task.py,sha256=G3jk0xzi3pqH96Bbut_GMJKExIlyyMYk4PbKfc6koa4,8551
|
|
41
|
+
xpander_sdk/modules/events/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
|
+
xpander_sdk/modules/events/models/deployments.py,sha256=6uwxFsybrZ-eHeohJzkm2RtQq4Eo_0xjHk7QouvszxU,1335
|
|
43
|
+
xpander_sdk/modules/events/models/events.py,sha256=T_89pq48e7fMIbJcCbtM9Ocb6YKXQP7pbF6VbECiGcI,1550
|
|
44
|
+
xpander_sdk/modules/events/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
|
+
xpander_sdk/modules/events/utils/generic.py,sha256=JsuGSQPRqHYoMC6Ki3isb6405ijZBb1izkghyiq-elk,1812
|
|
46
|
+
xpander_sdk/modules/events/utils/git_init.py,sha256=e5hx7RSq8ea0lhSWr3OsioV78w9DVgxdorVBGJyGlOo,1225
|
|
47
|
+
xpander_sdk/modules/knowledge_bases/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
|
+
xpander_sdk/modules/knowledge_bases/knowledge_bases_module.py,sha256=x-fvEs7dK1rn3bWGjl4a55UOv6T8k5QgS9j0reKlgpg,8778
|
|
49
|
+
xpander_sdk/modules/knowledge_bases/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
|
+
xpander_sdk/modules/knowledge_bases/models/knowledge_bases.py,sha256=pL7VoPhwy1yHQwSB1H5EnRsSCPfc2ItP6UlijieJ9Ho,219
|
|
51
|
+
xpander_sdk/modules/knowledge_bases/sub_modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
52
|
+
xpander_sdk/modules/knowledge_bases/sub_modules/knowledge_base.py,sha256=0HTUYjC4XfPGa0jBd5UiUhDzDDIrL4Rl-2xw884rjkc,5342
|
|
53
|
+
xpander_sdk/modules/knowledge_bases/sub_modules/knowledge_base_document_item.py,sha256=oLQApvsd573ZfYGV7Ji4XB5bNUyUFIeZWPIhZS1DIM4,1815
|
|
54
|
+
xpander_sdk/modules/knowledge_bases/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
|
+
xpander_sdk/modules/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
56
|
+
xpander_sdk/modules/tasks/tasks_module.py,sha256=wOMegfNQ4qoY7PEII5828SjWrP0Jocg2TRsFOaaCmW0,20444
|
|
57
|
+
xpander_sdk/modules/tasks/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
|
+
xpander_sdk/modules/tasks/models/task.py,sha256=B0_fwzQEkRE_pZMSLnWuXsUBMdy8HEIxm1FfRpCQma0,5000
|
|
59
|
+
xpander_sdk/modules/tasks/models/tasks_list.py,sha256=8V1T0vCtGN79qLMPwe37pOA7Wvuf8pbJNOhWL0BPo-8,5126
|
|
60
|
+
xpander_sdk/modules/tasks/sub_modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
61
|
+
xpander_sdk/modules/tasks/sub_modules/task.py,sha256=DcsN9_Lt8jUzEWwNeodnAnt2M9CAk0poEl2KBP15esc,32657
|
|
62
|
+
xpander_sdk/modules/tasks/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
63
|
+
xpander_sdk/modules/tasks/utils/files.py,sha256=KqqwSQSrwim2-H3XP5wOadDDfngAyEI034tA7Oon-vc,3631
|
|
64
|
+
xpander_sdk/modules/tools_repository/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
65
|
+
xpander_sdk/modules/tools_repository/tools_repository_module.py,sha256=HpiOtsJwIeyDqb1499X4FuRUdh8v-mQZQlQ2Zlgq1lY,9557
|
|
66
|
+
xpander_sdk/modules/tools_repository/decorators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
67
|
+
xpander_sdk/modules/tools_repository/decorators/register_tool.py,sha256=ep-BlJHmqvG7zcW6l-hz_V0ZJx3PGfNqdijw6VjUGek,4078
|
|
68
|
+
xpander_sdk/modules/tools_repository/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
69
|
+
xpander_sdk/modules/tools_repository/models/mcp.py,sha256=qGpaiXKiuXw6gAcK8CW6ek6FkZNbBxDXUf1PWF6Tenw,1863
|
|
70
|
+
xpander_sdk/modules/tools_repository/models/tool_invocation_result.py,sha256=Dhowt_fv8v8xWv7xMRJxo6hA8DawXKbWIrsJFMpt5H4,447
|
|
71
|
+
xpander_sdk/modules/tools_repository/sub_modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
72
|
+
xpander_sdk/modules/tools_repository/sub_modules/tool.py,sha256=YUf267PRXtctpPydpQTTnaO3aliSJwapM3WsdGG06Pw,22365
|
|
73
|
+
xpander_sdk/modules/tools_repository/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
|
+
xpander_sdk/modules/tools_repository/utils/generic.py,sha256=m9FRaVGzRUj23tB52rP9K4O-nTsMSt9iwMxMcYsqfiY,1770
|
|
75
|
+
xpander_sdk/modules/tools_repository/utils/local_tools.py,sha256=zp5P8hVnRUJQb-w-2jCEMV5eUB_awmvYfY_rin5qvEw,1875
|
|
76
|
+
xpander_sdk/modules/tools_repository/utils/schemas.py,sha256=EUi35h7CRrOVXV-TH-lyCpOdK5pu1uODDxvGB1JGDXY,13734
|
|
77
|
+
xpander_sdk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
78
|
+
xpander_sdk/utils/env.py,sha256=U_zIhqWgKs5fk2-HXjAaODj4oWMc5dRQ0fvw6fqVcFk,1522
|
|
79
|
+
xpander_sdk/utils/event_loop.py,sha256=kJrN0upgBhyI86tkTdfHeajznrIZl44Rl6WDiDG3GHE,2516
|
|
80
|
+
xpander_sdk/utils/tools.py,sha256=lyFkq2yP7DxBkyXYVlnFRwDhQCvf0fZZMDm5fBycze4,1244
|
|
81
|
+
xpander_sdk-2.0.155.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
82
|
+
xpander_sdk-2.0.155.dist-info/METADATA,sha256=lSJJ6nNbtBRjgstqqxlC31oMzsAifZWajwAHIZnStb0,15312
|
|
83
|
+
xpander_sdk-2.0.155.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
84
|
+
xpander_sdk-2.0.155.dist-info/top_level.txt,sha256=UCjnxQpsMy5Zoe7lmRuVDO6DI2V_6PgRFfm4oizRbVs,12
|
|
85
|
+
xpander_sdk-2.0.155.dist-info/RECORD,,
|
xpander_sdk/_jsii/__init__.py
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
from pkgutil import extend_path
|
|
2
|
-
__path__ = extend_path(__path__, __name__)
|
|
3
|
-
|
|
4
|
-
import abc
|
|
5
|
-
import builtins
|
|
6
|
-
import datetime
|
|
7
|
-
import enum
|
|
8
|
-
import typing
|
|
9
|
-
|
|
10
|
-
import jsii
|
|
11
|
-
import publication
|
|
12
|
-
import typing_extensions
|
|
13
|
-
|
|
14
|
-
import typeguard
|
|
15
|
-
from importlib.metadata import version as _metadata_package_version
|
|
16
|
-
TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])
|
|
17
|
-
|
|
18
|
-
def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any:
|
|
19
|
-
if TYPEGUARD_MAJOR_VERSION <= 2:
|
|
20
|
-
return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore
|
|
21
|
-
else:
|
|
22
|
-
if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]
|
|
23
|
-
pass
|
|
24
|
-
else:
|
|
25
|
-
if TYPEGUARD_MAJOR_VERSION == 3:
|
|
26
|
-
typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore
|
|
27
|
-
typeguard.check_type(value=value, expected_type=expected_type) # type:ignore
|
|
28
|
-
else:
|
|
29
|
-
typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore
|
|
30
|
-
|
|
31
|
-
__jsii_assembly__ = jsii.JSIIAssembly.load(
|
|
32
|
-
"xpander-sdk", "1.60.4", __name__[0:-6], "xpander-sdk@1.60.4.jsii.tgz"
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
__all__ = [
|
|
36
|
-
"__jsii_assembly__",
|
|
37
|
-
]
|
|
38
|
-
|
|
39
|
-
publication.publish()
|
|
Binary file
|
xpander_sdk/py.typed
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,368 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: xpander-sdk
|
|
3
|
-
Version: 1.60.4
|
|
4
|
-
Summary: xpander-sdk
|
|
5
|
-
Home-page: https://github.com/xpander-ai/xpander-sdk.git
|
|
6
|
-
Author: xpander.ai<opensource@xpander.ai>
|
|
7
|
-
License: Apache-2.0
|
|
8
|
-
Project-URL: Source, https://github.com/xpander-ai/xpander-sdk.git
|
|
9
|
-
Classifier: Intended Audience :: Developers
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Classifier: Programming Language :: JavaScript
|
|
12
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
-
Classifier: Typing :: Typed
|
|
18
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
19
|
-
Classifier: License :: OSI Approved
|
|
20
|
-
Requires-Python: ~=3.8
|
|
21
|
-
Description-Content-Type: text/markdown
|
|
22
|
-
License-File: LICENSE
|
|
23
|
-
Requires-Dist: jsii<2.0.0,>=1.108.0
|
|
24
|
-
Requires-Dist: publication>=0.0.3
|
|
25
|
-
Requires-Dist: typeguard<4.3.0,>=2.13.3
|
|
26
|
-
|
|
27
|
-
# Xpander SDK
|
|
28
|
-
|
|
29
|
-
**Xpander Open Source SDK** empowers developers to build intelligent and reliable AI Agents capable of managing complex, multi‑step tasks across diverse systems and platforms. The SDK simplifies challenges like function calling, schema definition, graph enforcement, and prompt group management.
|
|
30
|
-
|
|
31
|
-
With first‑class support for leading LLM providers such as **OpenAI**, **Amazon Bedrock**, **Google Gemini**, **Anthropic Claude**, and **NVIDIA NIM**, the **Xpander SDK** seamlessly integrates into your existing systems.
|
|
32
|
-
|
|
33
|
-

|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
## 📦 Installation
|
|
39
|
-
|
|
40
|
-
Choose your preferred package manager:
|
|
41
|
-
|
|
42
|
-
### npm
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
npm install xpander-sdk
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### pip
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
pip install xpander-sdk
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
## 🚀 Getting Started
|
|
58
|
-
|
|
59
|
-
### Prerequisites
|
|
60
|
-
|
|
61
|
-
1. Sign in to [app.xpander.ai](https://app.xpander.ai) and create (or pick) an **Agent**.
|
|
62
|
-
2. Copy the **Agent Key** and **Agent ID** from the Agent → **Settings** page.
|
|
63
|
-
3. Grab the API key for your preferred LLM provider (e.g. `OPENAI_API_KEY`, `GEMINI_API_KEY`, etc.).
|
|
64
|
-
4. Install the SDK (see above) **and** make sure you have Node.js installed – the SDK runs a tiny Node.js runtime under the hood.
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
## 🏁 Usage Patterns
|
|
70
|
-
|
|
71
|
-
Below are the canonical patterns taken from the official documentation for working with LLMs through the Xpander SDK.
|
|
72
|
-
|
|
73
|
-
### 1. Single Query (Quick Start)
|
|
74
|
-
|
|
75
|
-
```python
|
|
76
|
-
from xpander_sdk import XpanderClient, LLMProvider
|
|
77
|
-
from openai import OpenAI
|
|
78
|
-
from dotenv import load_dotenv
|
|
79
|
-
import os
|
|
80
|
-
|
|
81
|
-
load_dotenv()
|
|
82
|
-
|
|
83
|
-
xpander_client = XpanderClient(api_key=os.getenv("XPANDER_API_KEY"))
|
|
84
|
-
agent = xpander_client.agents.get(agent_id=os.getenv("XPANDER_AGENT_ID"))
|
|
85
|
-
openai_client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
|
|
86
|
-
|
|
87
|
-
# A one‑off prompt handled by the agent + tools
|
|
88
|
-
response = openai_client.chat.completions.create(
|
|
89
|
-
model="gpt-4o",
|
|
90
|
-
messages=agent.messages, # current conversation state
|
|
91
|
-
tools=agent.get_tools(llm_provider=LLMProvider.OPEN_AI),
|
|
92
|
-
tool_choice="auto",
|
|
93
|
-
temperature=0.0,
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
# Let the SDK execute the tool calls & keep state in sync
|
|
97
|
-
agent.process_llm_response(response.model_dump(), llm_provider=LLMProvider.OPEN_AI)
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
> **Tip:** `agent.process_llm_response(...)` is the easiest way to both *store* the assistant message **and** immediately run any tool calls it contains – perfect for serverless single‑turn workflows.
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
### 2. Real‑Time Event Listener (xpander‑utils)
|
|
106
|
-
|
|
107
|
-
```python
|
|
108
|
-
from xpander_utils.events import (
|
|
109
|
-
XpanderEventListener,
|
|
110
|
-
AgentExecutionResult,
|
|
111
|
-
ExecutionStatus,
|
|
112
|
-
AgentExecution,
|
|
113
|
-
|
|
114
|
-
)
|
|
115
|
-
from xpander_sdk import XpanderClient, LLMProvider
|
|
116
|
-
from openai import OpenAI
|
|
117
|
-
from dotenv import load_dotenv
|
|
118
|
-
import os
|
|
119
|
-
|
|
120
|
-
load_dotenv()
|
|
121
|
-
|
|
122
|
-
listener = XpanderEventListener(
|
|
123
|
-
api_key=os.getenv("XPANDER_API_KEY"),
|
|
124
|
-
organization_id=os.getenv("XPANDER_ORG_ID"),
|
|
125
|
-
agent_id=os.getenv("XPANDER_AGENT_ID"),
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
# Optional helper clients (LLM + Agent)
|
|
129
|
-
openai_client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
|
|
130
|
-
xpander_client = XpanderClient(api_key=os.getenv("XPANDER_API_KEY"))
|
|
131
|
-
agent = xpander_client.agents.get(agent_id=os.getenv("XPANDER_AGENT_ID"))
|
|
132
|
-
|
|
133
|
-
def on_execution_request(execution_task: AgentExecution) -> AgentExecutionResult:
|
|
134
|
-
"""Runs each time your cloud Agent triggers an execution request."""
|
|
135
|
-
# (1) Ask the LLM what to do next
|
|
136
|
-
response = openai_client.chat.completions.create(
|
|
137
|
-
model="gpt-4o",
|
|
138
|
-
messages=agent.messages,
|
|
139
|
-
tools=agent.get_tools(llm_provider=LLMProvider.OPEN_AI),
|
|
140
|
-
tool_choice="auto",
|
|
141
|
-
temperature=0.0,
|
|
142
|
-
)
|
|
143
|
-
|
|
144
|
-
# (2) Persist the assistant message *and* execute any tool calls
|
|
145
|
-
agent.process_llm_response(response.model_dump(), llm_provider=LLMProvider.OPEN_AI)
|
|
146
|
-
|
|
147
|
-
# (3) Return the final result back to the platform
|
|
148
|
-
return AgentExecutionResult(
|
|
149
|
-
result=execution_status.result,
|
|
150
|
-
is_success=True if execution_status.status == ExecutionStatus.COMPLETED else False,
|
|
151
|
-
)
|
|
152
|
-
|
|
153
|
-
# Block forever, listening for events via SSE
|
|
154
|
-
listener.register(on_execution_request=on_execution_request)
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
> **Why `xpander-utils`?** The `XpanderEventListener` uses a lightweight Server‑Sent Events (SSE) channel to deliver execution requests to your code with sub‑second latency—perfect for Slack, Teams, and other real‑time chat surfaces. ([pypi.org](https://pypi.org/project/xpander-utils/?utm_source=chatgpt.com))
|
|
158
|
-
|
|
159
|
-
---
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
### 3. Multi‑Step Tasks (Long‑running autonomous workflows)
|
|
163
|
-
|
|
164
|
-
```python
|
|
165
|
-
# Describe a complex objective for the agent
|
|
166
|
-
multi_step_task = """
|
|
167
|
-
Find employees of xpander.ai and their roles.
|
|
168
|
-
Then check their LinkedIn profiles for recent updates.
|
|
169
|
-
"""
|
|
170
|
-
|
|
171
|
-
agent.add_task(multi_step_task) # automatically initialises memory
|
|
172
|
-
|
|
173
|
-
while not agent.is_finished():
|
|
174
|
-
response = openai_client.chat.completions.create(
|
|
175
|
-
model="gpt-4o",
|
|
176
|
-
messages=agent.messages,
|
|
177
|
-
tools=agent.get_tools(llm_provider=LLMProvider.OPEN_AI),
|
|
178
|
-
tool_choice="auto",
|
|
179
|
-
temperature=0.0,
|
|
180
|
-
)
|
|
181
|
-
|
|
182
|
-
agent.process_llm_response(response.model_dump(), llm_provider=LLMProvider.OPEN_AI)
|
|
183
|
-
|
|
184
|
-
# 🚀 Grab the final result once the agent marks itself as finished
|
|
185
|
-
execution_result = agent.retrieve_execution_result()
|
|
186
|
-
print(execution_result.status) # e.g. "SUCCEEDED"
|
|
187
|
-
print(execution_result.result) # your task output
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
This loop lets the LLM break the objective into sub‑steps, call tools, update memory and eventually mark the task as **finished**.
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
### 4. Complete Example – Gemini via the OpenAI‑compatible API
|
|
196
|
-
|
|
197
|
-
```python
|
|
198
|
-
from xpander_sdk import XpanderClient, LLMProvider
|
|
199
|
-
from openai import OpenAI
|
|
200
|
-
from dotenv import load_dotenv
|
|
201
|
-
from os import environ
|
|
202
|
-
|
|
203
|
-
load_dotenv()
|
|
204
|
-
|
|
205
|
-
xpander_client = XpanderClient(api_key=environ["XPANDER_API_KEY"])
|
|
206
|
-
gemini_client = OpenAI(
|
|
207
|
-
api_key=environ["GEMINI_API_KEY"],
|
|
208
|
-
base_url="https://generativelanguage.googleapis.com/v1beta/openai/",
|
|
209
|
-
)
|
|
210
|
-
|
|
211
|
-
agent = xpander_client.agents.get(agent_id=environ["XPANDER_AGENT_ID"])
|
|
212
|
-
agent.add_task("Find employees of xpander.ai.")
|
|
213
|
-
|
|
214
|
-
while not agent.is_finished():
|
|
215
|
-
response = gemini_client.chat.completions.create(
|
|
216
|
-
model="gemini-2.0-flash",
|
|
217
|
-
messages=agent.messages,
|
|
218
|
-
tools=agent.get_tools(llm_provider=LLMProvider.GEMINI_OPEN_AI),
|
|
219
|
-
tool_choice=agent.tool_choice,
|
|
220
|
-
temperature=0.0,
|
|
221
|
-
)
|
|
222
|
-
|
|
223
|
-
agent.add_messages(response.model_dump())
|
|
224
|
-
|
|
225
|
-
tool_calls = XpanderClient.extract_tool_calls(
|
|
226
|
-
llm_response=response.model_dump(),
|
|
227
|
-
llm_provider=LLMProvider.GEMINI_OPEN_AI,
|
|
228
|
-
)
|
|
229
|
-
|
|
230
|
-
agent.run_tools(tool_calls)
|
|
231
|
-
|
|
232
|
-
print(agent.retrieve_execution_result().result)
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
This demo showcases full multi‑step orchestration **without** writing any provider‑specific glue code.
|
|
236
|
-
|
|
237
|
-
---
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
### 5. Local Tools (developer‑executed)
|
|
241
|
-
|
|
242
|
-
Local tools let you register **your own** functions (Python, TS, C#, …) so the LLM can *request* them. **Important:** the SDK does **not** execute local tools for you. Your code must:
|
|
243
|
-
|
|
244
|
-
1. Register the tool schema with `agent.add_local_tools()`.
|
|
245
|
-
2. Inspect each LLM response with `XpanderClient.extract_tool_calls(...)`.
|
|
246
|
-
3. Pick out the pending local calls via `retrieve_pending_local_tool_calls(...)`.
|
|
247
|
-
4. Invoke the matching Python/TS function(s).
|
|
248
|
-
5. Feed a `ToolCallResult` back with `agent.memory.add_tool_call_results([...])`.
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
#### 5‑a. Python quick path
|
|
254
|
-
|
|
255
|
-
```python
|
|
256
|
-
from xpander_sdk import XpanderClient, LLMProvider, ToolCallResult
|
|
257
|
-
from openai import OpenAI
|
|
258
|
-
from local_tools import local_tools_declarations, local_tools_by_name
|
|
259
|
-
|
|
260
|
-
client = XpanderClient(api_key=XPANDER_API_KEY)
|
|
261
|
-
agent = client.agents.get(agent_id=XPANDER_AGENT_ID)
|
|
262
|
-
openai = OpenAI(api_key=OPENAI_API_KEY)
|
|
263
|
-
|
|
264
|
-
# 1️⃣ Tell the agent about your local tools
|
|
265
|
-
agent.add_local_tools(local_tools_declarations)
|
|
266
|
-
|
|
267
|
-
# 2️⃣ Normal chat ‑ the LLM may now reference those tools
|
|
268
|
-
response = openai.chat.completions.create(
|
|
269
|
-
model="gpt-4o",
|
|
270
|
-
messages=agent.messages,
|
|
271
|
-
tools=agent.get_tools(llm_provider=LLMProvider.OPEN_AI),
|
|
272
|
-
tool_choice="auto",
|
|
273
|
-
temperature=0.0,
|
|
274
|
-
)
|
|
275
|
-
|
|
276
|
-
# 3️⃣ Extract *all* tool calls & isolate locals
|
|
277
|
-
all_calls = XpanderClient.extract_tool_calls(response.model_dump(), llm_provider=LLMProvider.OPEN_AI)
|
|
278
|
-
pending_local = XpanderClient.retrieve_pending_local_tool_calls(all_calls)
|
|
279
|
-
|
|
280
|
-
# 4️⃣ Run each local call
|
|
281
|
-
results = []
|
|
282
|
-
for call in pending_local:
|
|
283
|
-
fn = local_tools_by_name[call.name]
|
|
284
|
-
output_payload = fn(**call.payload) # your function runs here
|
|
285
|
-
results.append(
|
|
286
|
-
ToolCallResult(
|
|
287
|
-
function_name=call.name,
|
|
288
|
-
tool_call_id=call.tool_call_id,
|
|
289
|
-
payload=call.payload,
|
|
290
|
-
status_code=200,
|
|
291
|
-
result=output_payload,
|
|
292
|
-
is_success=True,
|
|
293
|
-
is_retryable=False,
|
|
294
|
-
)
|
|
295
|
-
)
|
|
296
|
-
|
|
297
|
-
# 5️⃣ Write the results back so the LLM can continue
|
|
298
|
-
agent.memory.add_tool_call_results(results)
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
#### 5‑b. TypeScript pattern (excerpt from SDK tests)
|
|
302
|
-
|
|
303
|
-
```python
|
|
304
|
-
// localTools array holds { decleration, fn }
|
|
305
|
-
agent.addLocalTools(localToolsDecleration);
|
|
306
|
-
|
|
307
|
-
const response = await openai.chat.completions.create({
|
|
308
|
-
model: 'gpt-4o',
|
|
309
|
-
messages: agent.messages,
|
|
310
|
-
tools: agent.getTools(),
|
|
311
|
-
tool_choice: agent.toolChoice,
|
|
312
|
-
});
|
|
313
|
-
|
|
314
|
-
const toolCalls = XpanderClient.extractToolCalls(response);
|
|
315
|
-
const pendingLocalCalls = XpanderClient.retrievePendingLocalToolCalls(toolCalls);
|
|
316
|
-
|
|
317
|
-
for (const call of pendingLocalCalls) {
|
|
318
|
-
const resultPayload = localToolsByName[call.name](...Object.values(call.payload));
|
|
319
|
-
agent.memory.addToolCallResults([
|
|
320
|
-
new ToolCallResult(
|
|
321
|
-
call.name,
|
|
322
|
-
call.toolCallId,
|
|
323
|
-
call.payload,
|
|
324
|
-
200,
|
|
325
|
-
resultPayload,
|
|
326
|
-
true,
|
|
327
|
-
false,
|
|
328
|
-
),
|
|
329
|
-
]);
|
|
330
|
-
}
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
The LLM will then see the tool responses in its context and proceed to the next reasoning step. This mirrors the official test‑suite workflow.
|
|
334
|
-
|
|
335
|
-
---
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
## 🏆 Best Practices (Provider‑agnostic) (Provider-agnostic) (Provider‑agnostic)
|
|
339
|
-
|
|
340
|
-
1. **Create a task first** – `agent.add_task()` automatically initialises the agent’s memory and system messages.
|
|
341
|
-
2. **Always pass `llm_provider`** when calling `agent.get_tools()` so the SDK can return the correct schema for the target provider.
|
|
342
|
-
3. **Store the raw LLM response** with `agent.add_messages(...)` (or implicitly via `agent.process_llm_response`). The SDK will convert fields as required.
|
|
343
|
-
4. **Extract tool calls with the same provider flag** you used for `get_tools`: `XpanderClient.extract_tool_calls(llm_response, llm_provider=...)`.
|
|
344
|
-
|
|
345
|
-
Following these rules ensures your code works consistently across OpenAI, Claude, Gemini, Bedrock, and more.
|
|
346
|
-
|
|
347
|
-
---
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
## 📚 Further Reading
|
|
351
|
-
|
|
352
|
-
* **Official Documentation:** [https://docs.xpander.ai/userguides/overview/introduction](https://docs.xpander.ai/userguides/overview/introduction)
|
|
353
|
-
* **LLM SDK Guide:** [https://docs.xpander.ai/docs/01-get-started/03-llm-models](https://docs.xpander.ai/docs/01-get-started/03-llm-models)
|
|
354
|
-
* **API Reference:** [https://docs.xpander.ai/api-reference/SDK/getting-started](https://docs.xpander.ai/api-reference/SDK/getting-started)
|
|
355
|
-
|
|
356
|
-
---
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
## ⚙️ Technical Note
|
|
360
|
-
|
|
361
|
-
The library is generated with **Projen** and runs inside a tiny Node.js runtime. Ensure you have a recent **Node.js** version installed for optimal performance.
|
|
362
|
-
|
|
363
|
-
---
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
## 🤝 Contributing
|
|
367
|
-
|
|
368
|
-
We welcome contributions to improve the SDK. Please see our [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to submit improvements and bug fixes.
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
xpander_sdk/__init__.py,sha256=6g6hJLlHwNMJdH20VjScZtLEzJCJw_Vtkh5ao06HMcc,318223
|
|
2
|
-
xpander_sdk/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
3
|
-
xpander_sdk/_jsii/__init__.py,sha256=Qk4Ec4NsdP4ECaIp2PNVt2avY444cTdpPORxtfzXusI,1389
|
|
4
|
-
xpander_sdk/_jsii/xpander-sdk@1.60.4.jsii.tgz,sha256=4w-Qlb0wzWX13HbfDuIV_ES0aeAF1uijN11u0zuA8Vk,1473280
|
|
5
|
-
xpander_sdk-1.60.4.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
6
|
-
xpander_sdk-1.60.4.dist-info/METADATA,sha256=DCH3Zwb1jUlk61-TtHYM6uLHp_b8nCH_fFvrmsvOK9E,12360
|
|
7
|
-
xpander_sdk-1.60.4.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
8
|
-
xpander_sdk-1.60.4.dist-info/top_level.txt,sha256=UCjnxQpsMy5Zoe7lmRuVDO6DI2V_6PgRFfm4oizRbVs,12
|
|
9
|
-
xpander_sdk-1.60.4.dist-info/RECORD,,
|
|
File without changes
|