xpander-sdk 2.0.187__tar.gz → 2.0.189__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.
Files changed (111) hide show
  1. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/PKG-INFO +1 -1
  2. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/setup.py +1 -1
  3. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/consts/api_routes.py +7 -0
  4. xpander_sdk-2.0.189/src/xpander_sdk/models/generic.py +27 -0
  5. xpander_sdk-2.0.189/src/xpander_sdk/models/notifications.py +98 -0
  6. xpander_sdk-2.0.189/src/xpander_sdk/models/orchestrations.py +230 -0
  7. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/agents/models/agent.py +7 -4
  8. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/agents/sub_modules/agent.py +10 -1
  9. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/backend/frameworks/agno.py +2 -2
  10. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tasks/models/task.py +3 -14
  11. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tasks/sub_modules/task.py +7 -4
  12. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/utils/agents/compactization_agent.py +0 -1
  13. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk.egg-info/PKG-INFO +1 -1
  14. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk.egg-info/SOURCES.txt +3 -0
  15. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/LICENSE +0 -0
  16. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/README.md +0 -0
  17. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/pyproject.toml +0 -0
  18. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/setup.cfg +0 -0
  19. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/__init__.py +0 -0
  20. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/consts/__init__.py +0 -0
  21. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/core/__init__.py +0 -0
  22. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/core/module_base.py +0 -0
  23. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/core/state.py +0 -0
  24. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/core/xpander_api_client.py +0 -0
  25. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/exceptions/__init__.py +0 -0
  26. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/exceptions/module_exception.py +0 -0
  27. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/models/__init__.py +0 -0
  28. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/models/activity.py +0 -0
  29. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/models/compactization.py +0 -0
  30. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/models/configuration.py +0 -0
  31. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/models/deep_planning.py +0 -0
  32. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/models/events.py +0 -0
  33. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/models/frameworks.py +0 -0
  34. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/models/shared.py +0 -0
  35. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/models/user.py +0 -0
  36. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/__init__.py +0 -0
  37. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/agents/__init__.py +0 -0
  38. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/agents/agents_module.py +0 -0
  39. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/agents/models/__init__.py +0 -0
  40. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/agents/models/agent_list.py +0 -0
  41. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/agents/models/knowledge_bases.py +0 -0
  42. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/agents/sub_modules/__init__.py +0 -0
  43. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/agents/utils/__init__.py +0 -0
  44. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/agents/utils/generic.py +0 -0
  45. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/backend/__init__.py +0 -0
  46. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/backend/backend_module.py +0 -0
  47. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/backend/decorators/__init__.py +0 -0
  48. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/backend/decorators/on_auth_event.py +0 -0
  49. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/backend/events_registry.py +0 -0
  50. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/backend/frameworks/__init__.py +0 -0
  51. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/backend/frameworks/dispatch.py +0 -0
  52. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/backend/utils/__init__.py +0 -0
  53. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/backend/utils/mcp_oauth.py +0 -0
  54. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/events/__init__.py +0 -0
  55. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/events/decorators/__init__.py +0 -0
  56. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/events/decorators/on_boot.py +0 -0
  57. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/events/decorators/on_shutdown.py +0 -0
  58. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/events/decorators/on_task.py +0 -0
  59. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/events/decorators/on_tool.py +0 -0
  60. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/events/events_module.py +0 -0
  61. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/events/models/__init__.py +0 -0
  62. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/events/models/deployments.py +0 -0
  63. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/events/models/events.py +0 -0
  64. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/events/utils/__init__.py +0 -0
  65. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/events/utils/generic.py +0 -0
  66. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/events/utils/git_init.py +0 -0
  67. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/knowledge_bases/__init__.py +0 -0
  68. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/knowledge_bases/knowledge_bases_module.py +0 -0
  69. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/knowledge_bases/models/__init__.py +0 -0
  70. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/knowledge_bases/models/knowledge_bases.py +0 -0
  71. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/knowledge_bases/sub_modules/__init__.py +0 -0
  72. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/knowledge_bases/sub_modules/knowledge_base.py +0 -0
  73. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/knowledge_bases/sub_modules/knowledge_base_document_item.py +0 -0
  74. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/knowledge_bases/utils/__init__.py +0 -0
  75. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tasks/__init__.py +0 -0
  76. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tasks/models/__init__.py +0 -0
  77. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tasks/models/tasks_list.py +0 -0
  78. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tasks/sub_modules/__init__.py +0 -0
  79. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tasks/tasks_module.py +0 -0
  80. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tasks/utils/__init__.py +0 -0
  81. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tasks/utils/files.py +0 -0
  82. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tools_repository/__init__.py +0 -0
  83. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tools_repository/decorators/__init__.py +0 -0
  84. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tools_repository/decorators/register_tool.py +0 -0
  85. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tools_repository/models/__init__.py +0 -0
  86. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tools_repository/models/mcp.py +0 -0
  87. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tools_repository/models/tool_invocation_result.py +0 -0
  88. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tools_repository/sub_modules/__init__.py +0 -0
  89. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tools_repository/sub_modules/tool.py +0 -0
  90. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tools_repository/tools_repository_module.py +0 -0
  91. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tools_repository/utils/__init__.py +0 -0
  92. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tools_repository/utils/generic.py +0 -0
  93. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tools_repository/utils/local_tools.py +0 -0
  94. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/modules/tools_repository/utils/schemas.py +0 -0
  95. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/utils/__init__.py +0 -0
  96. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/utils/agents/__init__.py +0 -0
  97. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/utils/env.py +0 -0
  98. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/utils/event_loop.py +0 -0
  99. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/utils/generic.py +0 -0
  100. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk/utils/tools.py +0 -0
  101. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk.egg-info/dependency_links.txt +0 -0
  102. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk.egg-info/requires.txt +0 -0
  103. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/src/xpander_sdk.egg-info/top_level.txt +0 -0
  104. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/tests/test_agents_module.py +0 -0
  105. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/tests/test_api_client.py +0 -0
  106. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/tests/test_backend_module.py +0 -0
  107. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/tests/test_boot_shutdown_handlers.py +0 -0
  108. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/tests/test_configuration.py +0 -0
  109. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/tests/test_knowledge_bases_module.py +0 -0
  110. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/tests/test_tasks_module.py +0 -0
  111. {xpander_sdk-2.0.187 → xpander_sdk-2.0.189}/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.187
3
+ Version: 2.0.189
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
@@ -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.187",
8
+ version="2.0.189",
9
9
  author="xpanderAI",
10
10
  author_email="dev@xpander.ai",
11
11
  description="xpander.ai Backend-as-a-service for AI Agents - SDK",
@@ -55,6 +55,13 @@ and deleting resources.
55
55
 
56
56
  # Tools
57
57
  GetOrInvokeToolById = "/tools/{tool_id}"
58
+ InvokeCustomAgentTool = "/tools/{connector_id}/{tool_id}"
59
+ ExecuteCodeInSandbox = "/tools/{task_id}/xp-code-executor"
60
+
61
+ # HITL (Human-in-the-Loop)
62
+ HITLRequest = "/hitl/request"
63
+ HITLApprove = "/hitl/{task_id}/approve"
64
+ HITLReject = "/hitl/{task_id}/reject"
58
65
 
59
66
  def __str__(self) -> str:
60
67
  return str(self.value)
@@ -0,0 +1,27 @@
1
+ from enum import Enum
2
+ from typing import Optional
3
+
4
+ from xpander_sdk.models.shared import XPanderSharedModel
5
+
6
+ class LLMCredentialsKeyType(str, Enum):
7
+ XPander = "xpander"
8
+ Custom = "custom"
9
+
10
+ class LLMCredentials(XPanderSharedModel):
11
+ name: str
12
+ description: Optional[str] = None
13
+ value: str
14
+
15
+ class LLMModelProvider(Enum):
16
+ OpenAI = "openai"
17
+ NvidiaNIM = "nim"
18
+ AmazonBedrock = "amazon_bedrock"
19
+ HuggingFace = "huggingFace"
20
+ FriendliAI = "friendlyAI"
21
+ Anthropic = "anthropic"
22
+ GoogleGemini = "gemini"
23
+ Fireworks = "fireworks"
24
+ GoogleAIStudio = "google_ai_studio"
25
+ Helicone = "helicone"
26
+ OpenRouter = "open_router"
27
+ Nebius = "nebius"
@@ -0,0 +1,98 @@
1
+ """Models for notification configurations and credentials.
2
+
3
+ This module provides data models for configuring various notification channels
4
+ including email, Slack, and webhooks, along with their authentication details.
5
+ """
6
+
7
+ from typing import Dict, List, Literal, Optional, Union
8
+
9
+ from xpander_sdk.models.shared import XPanderSharedModel
10
+
11
+ class SlackCredentials(XPanderSharedModel):
12
+ """Slack API authentication credentials.
13
+
14
+ Attributes:
15
+ authed_user_id: Authenticated user's Slack ID.
16
+ access_token: OAuth access token for API calls.
17
+ client_id: Slack app client ID.
18
+ client_secret: Slack app client secret.
19
+ verification_token: Token for verifying requests from Slack.
20
+ signing_secret: Secret for validating webhook signatures.
21
+ app_configuration_token: Token for app configuration.
22
+ app_configuration_refresh_token: Refresh token for app configuration.
23
+ """
24
+
25
+ authed_user_id: Optional[str] = None
26
+ access_token: Optional[str] = None
27
+ client_id: Optional[str] = None
28
+ client_secret: Optional[str] = None
29
+ verification_token: Optional[str] = None
30
+ signing_secret: Optional[str] = None
31
+ app_configuration_token: Optional[str] = None
32
+ app_configuration_refresh_token: Optional[str] = None
33
+
34
+ class NotificationSettingsBase(XPanderSharedModel):
35
+ """Base class for notification settings with common customization fields.
36
+
37
+ Attributes:
38
+ subject_suffix: Optional suffix to append to notification subjects.
39
+ body_prefix: Optional prefix to prepend to notification bodies.
40
+ """
41
+
42
+ subject_suffix: Optional[str] = None
43
+ body_prefix: Optional[str] = None
44
+
45
+ class EmailNotificationSettings(NotificationSettingsBase):
46
+ """Configuration for email notifications.
47
+
48
+ Attributes:
49
+ to: List of recipient email addresses.
50
+ """
51
+
52
+ to: List[str]
53
+
54
+ class SlackNotificationSettings(NotificationSettingsBase):
55
+ """Configuration for Slack notifications.
56
+
57
+ Attributes:
58
+ channels: List of Slack channel IDs or names to post to.
59
+ credentials: Slack API authentication credentials.
60
+ """
61
+
62
+ channels: List[str]
63
+ credentials: SlackCredentials
64
+
65
+ class WebhookNotificationSettings(NotificationSettingsBase):
66
+ """Configuration for webhook notifications.
67
+
68
+ Attributes:
69
+ url: Target webhook URL to POST notification data.
70
+ headers: Optional HTTP headers to include in the webhook request.
71
+ """
72
+
73
+ url: str
74
+ headers: Optional[Dict[str, str]] = {}
75
+
76
+ NotificationType = Literal["email", "slack", "webhook"]
77
+ """Supported notification channel types."""
78
+
79
+ NotificationDetails = Union[
80
+ EmailNotificationSettings,
81
+ SlackNotificationSettings,
82
+ WebhookNotificationSettings,
83
+ ]
84
+ """Union type for all notification detail configurations."""
85
+
86
+
87
+ class NotificationSettings(XPanderSharedModel):
88
+ """Configuration for event-based notifications.
89
+
90
+ Attributes:
91
+ on_success: Notifications to send when an operation succeeds.
92
+ Maps notification types to a list of notification configurations.
93
+ on_error: Notifications to send when an operation fails.
94
+ Maps notification types to a list of notification configurations.
95
+ """
96
+
97
+ on_success: Optional[Dict[NotificationType, List[NotificationDetails]]] = {}
98
+ on_error: Optional[Dict[NotificationType, List[NotificationDetails]]] = {}
@@ -0,0 +1,230 @@
1
+ """Models for orchestration workflows and node definitions.
2
+
3
+ This module provides data models for building and managing orchestration workflows,
4
+ including various node types, execution strategies, and control flow conditions.
5
+ """
6
+
7
+ from enum import Enum
8
+ from typing import Dict, List, Literal, Optional, Union
9
+ from uuid import uuid4
10
+
11
+ from pydantic import Field
12
+
13
+ from xpander_sdk.models.generic import (
14
+ LLMCredentials,
15
+ LLMCredentialsKeyType,
16
+ LLMModelProvider,
17
+ )
18
+ from xpander_sdk.models.shared import OutputFormat
19
+ from xpander_sdk.models.notifications import NotificationDetails
20
+ from xpander_sdk.models.shared import XPanderSharedModel
21
+
22
+ class OrchestrationNodeType(str, Enum):
23
+ """Types of nodes available in an orchestration workflow.
24
+
25
+ Attributes:
26
+ CustomFunction: Node that executes a custom function.
27
+ Code: Node that executes arbitrary code.
28
+ Agent: Node that invokes an AI agent.
29
+ Orchestration: Node that references another orchestration.
30
+ Classifier: Node that classifies inputs using LLM.
31
+ Wait: Node that pauses execution until a condition is met.
32
+ """
33
+
34
+ CustomFunction = "custom_function"
35
+ Code = "code"
36
+ Agent = "agent"
37
+ Orchestration = "orchestration"
38
+ Classifier = "classifier"
39
+ Wait = "wait"
40
+
41
+ class OrchestrationConditionType(str, Enum):
42
+ """Types of conditions for orchestration control flow.
43
+
44
+ Attributes:
45
+ Regex: Condition based on regular expression matching.
46
+ Contains: Condition based on substring containment.
47
+ """
48
+
49
+ Regex = "regex"
50
+ Contains = "contains"
51
+
52
+ class OrchestrationWaitNodeType(str, Enum):
53
+ """Types of wait nodes in orchestration workflows.
54
+
55
+ Attributes:
56
+ Webhook: Wait for an external webhook call.
57
+ HITL: Wait for human-in-the-loop interaction.
58
+ """
59
+
60
+ Webhook = "webhook"
61
+ HITL = "hitl"
62
+
63
+ class OrchestrationCondition(XPanderSharedModel):
64
+ """Condition for controlling orchestration flow.
65
+
66
+ Attributes:
67
+ type: Type of condition (regex or contains).
68
+ term: The pattern or string to match against.
69
+ """
70
+
71
+ type: OrchestrationConditionType
72
+ term: str
73
+
74
+ class OrchestrationRetryStrategy(XPanderSharedModel):
75
+ """Strategy for retrying failed orchestration nodes.
76
+
77
+ Attributes:
78
+ enabled: Whether retry is enabled for this node.
79
+ max_retries: Maximum number of retry attempts. Defaults to 3.
80
+ """
81
+
82
+ enabled: Optional[bool] = False
83
+ max_retries: Optional[int] = 3
84
+
85
+ class OrchestrationIterativeStrategy(XPanderSharedModel):
86
+ """Strategy for iteratively executing orchestration nodes.
87
+
88
+ Attributes:
89
+ enabled: Whether iterative execution is enabled.
90
+ max_iterations: Maximum number of iterations. Defaults to 3.
91
+ end_condition: Optional condition to stop iteration early.
92
+ """
93
+
94
+ enabled: Optional[bool] = False
95
+ max_iterations: Optional[int] = 3
96
+ end_condition: Optional[OrchestrationCondition] = None
97
+
98
+ class OrchestrationStopStrategy(XPanderSharedModel):
99
+ """Strategy for stopping orchestration execution.
100
+
101
+ Attributes:
102
+ enabled: Whether the stop strategy is enabled.
103
+ stop_on_failure: Whether to stop the entire orchestration on node failure.
104
+ stop_on_condition: Optional condition that will stop execution if met.
105
+ """
106
+
107
+ enabled: Optional[bool] = False
108
+ stop_on_failure: Optional[bool] = True
109
+ stop_on_condition: Optional[OrchestrationCondition] = None
110
+
111
+ class OrchestrationClassifierNodeLLMSettings(XPanderSharedModel):
112
+ """LLM configuration for classifier nodes.
113
+
114
+ Attributes:
115
+ model_provider: The LLM provider to use. Defaults to OpenAI.
116
+ model_name: Specific model identifier. Defaults to "gpt-5.2".
117
+ llm_credentials_key: Key identifier for stored credentials.
118
+ llm_credentials_key_type: Type of credential key storage. Defaults to XPander.
119
+ llm_credentials: Direct credential object if not using stored credentials.
120
+ """
121
+
122
+ model_provider: Optional[LLMModelProvider] = LLMModelProvider.OpenAI
123
+ model_name: Optional[str] = "gpt-5.2"
124
+ llm_credentials_key: Optional[str] = None
125
+ llm_credentials_key_type: Optional[LLMCredentialsKeyType] = (
126
+ LLMCredentialsKeyType.XPander
127
+ )
128
+ llm_credentials: Optional[LLMCredentials] = None
129
+
130
+ class OrchestrationPointerNode(XPanderSharedModel):
131
+ """Node that references an external asset (agent, function, or orchestration).
132
+
133
+ Attributes:
134
+ asset_id: Unique identifier of the asset to execute.
135
+ type: Type of asset being referenced.
136
+ output_type: Expected output format. Defaults to Text.
137
+ output_schema: JSON schema for structured output validation.
138
+ """
139
+
140
+ asset_id: str
141
+ type: Literal[
142
+ OrchestrationNodeType.Agent,
143
+ OrchestrationNodeType.CustomFunction,
144
+ OrchestrationNodeType.Orchestration,
145
+ ]
146
+
147
+ output_type: Optional[OutputFormat] = OutputFormat.Text
148
+ output_schema: Optional[Dict] = None
149
+
150
+ class OrchestrationClassifierNode(XPanderSharedModel):
151
+ """Node that uses LLM to classify or transform inputs.
152
+
153
+ Attributes:
154
+ output_type: Expected output format. Defaults to Text.
155
+ output_schema: JSON schema for structured output validation.
156
+ instructions: Classification or transformation instructions for the LLM.
157
+ examples: Example inputs/outputs to guide the LLM behavior.
158
+ settings: LLM configuration settings.
159
+ """
160
+
161
+ output_type: Optional[OutputFormat] = OutputFormat.Text
162
+ output_schema: Optional[Dict] = None
163
+ instructions: Optional[str] = None
164
+ examples: Optional[List[str]] = []
165
+ settings: OrchestrationClassifierNodeLLMSettings
166
+
167
+ class OrchestrationCodeNode(XPanderSharedModel):
168
+ """Node that executes arbitrary code.
169
+
170
+ Attributes:
171
+ code: The code string to execute.
172
+ """
173
+
174
+ code: str
175
+
176
+ class OrchestrationWaitNode(XPanderSharedModel):
177
+ """Node that pauses execution until an external event occurs.
178
+
179
+ Attributes:
180
+ type: Type of wait event (webhook or human-in-the-loop).
181
+ definition: Notification configuration for triggering continuation.
182
+ """
183
+
184
+ type: Literal[OrchestrationWaitNodeType.Webhook, OrchestrationWaitNodeType.HITL]
185
+ definition: NotificationDetails
186
+
187
+ class OrchestrationNode(XPanderSharedModel):
188
+ """A node in an orchestration workflow.
189
+
190
+ Represents a single execution unit in an orchestration with control flow,
191
+ execution strategies, and a specific node type definition.
192
+
193
+ Attributes:
194
+ id: Unique identifier for the node. Auto-generated if not provided.
195
+ next_node_ids: List of IDs of the next nodes to execute in the workflow (supports branching).
196
+ name: Human-readable name for the node.
197
+ description: Detailed description of the node's purpose.
198
+ condition: Conditional logic for executing this node.
199
+ retry_strategy: Strategy for retrying failed executions.
200
+ iterative_strategy: Strategy for iterative execution.
201
+ stop_strategy: Strategy for stopping the workflow.
202
+ definition: The actual node implementation (code, classifier, pointer, or wait).
203
+ input_type: Expected input format. Defaults to Text.
204
+ input_schema: JSON schema for structured input validation.
205
+ input_instructions: Instructions to use for structured input.
206
+ """
207
+
208
+ id: str = Field(default_factory=lambda: str(uuid4()))
209
+ next_node_ids: List[str] = Field(default_factory=list)
210
+ name: Optional[str] = None
211
+ description: Optional[str] = None
212
+ condition: Optional[OrchestrationCondition] = None
213
+ retry_strategy: Optional[OrchestrationRetryStrategy] = Field(
214
+ default_factory=OrchestrationRetryStrategy
215
+ )
216
+ iterative_strategy: Optional[OrchestrationIterativeStrategy] = Field(
217
+ default_factory=OrchestrationIterativeStrategy
218
+ )
219
+ stop_strategy: Optional[OrchestrationStopStrategy] = Field(
220
+ default_factory=OrchestrationStopStrategy
221
+ )
222
+ definition: Union[
223
+ OrchestrationCodeNode,
224
+ OrchestrationClassifierNode,
225
+ OrchestrationPointerNode,
226
+ OrchestrationWaitNode,
227
+ ]
228
+ input_type: Optional[OutputFormat] = OutputFormat.Text
229
+ input_schema: Optional[Dict] = None
230
+ input_instructions: Optional[str] = None
@@ -10,6 +10,7 @@ from enum import Enum
10
10
  from typing import Dict, List, Literal, Optional, Type
11
11
  from pydantic import BaseModel, computed_field
12
12
 
13
+ from xpander_sdk.models.orchestrations import OrchestrationIterativeStrategy, OrchestrationRetryStrategy, OrchestrationStopStrategy
13
14
  from xpander_sdk.models.shared import XPanderSharedModel
14
15
  from xpander_sdk.modules.tools_repository.models.mcp import MCPServerDetails
15
16
 
@@ -420,12 +421,14 @@ class AgentType(str, Enum):
420
421
  Regular: Standard agent for individual task execution.
421
422
  A2A: Agent that is used via A2A protocol.
422
423
  Curl: Custom Agent that is used via curl.
424
+ Orchestration: marks the agent as an Orchestration object.
423
425
  """
424
426
 
425
427
  Manager = "manager"
426
428
  Regular = "regular"
427
429
  A2A = "a2a"
428
430
  Curl = "curl"
431
+ Orchestration = "orchestration"
429
432
 
430
433
 
431
434
  @dataclass
@@ -471,7 +474,7 @@ class AgentOutput(BaseModel):
471
474
  is_markdown: Optional[bool] = False
472
475
  use_json_mode: Optional[bool] = False
473
476
 
474
- class LLMCredentials(XPanderSharedModel):
475
- name: str
476
- description: Optional[str] = None
477
- value: str
477
+ class TaskLevelStrategies(XPanderSharedModel):
478
+ retry_strategy: Optional[OrchestrationRetryStrategy] = None
479
+ iterative_strategy: Optional[OrchestrationIterativeStrategy] = None
480
+ stop_strategy: Optional[OrchestrationStopStrategy] = None
@@ -19,6 +19,8 @@ from xpander_sdk.core.xpander_api_client import APIClient
19
19
  from xpander_sdk.exceptions.module_exception import ModuleException
20
20
  from xpander_sdk.models.configuration import Configuration
21
21
  from xpander_sdk.models.frameworks import AgnoSettings, Framework
22
+ from xpander_sdk.models.notifications import NotificationSettings
23
+ from xpander_sdk.models.orchestrations import OrchestrationNode
22
24
  from xpander_sdk.modules.agents.utils.generic import get_db_schema_name
23
25
  from xpander_sdk.modules.knowledge_bases.models.knowledge_bases import (
24
26
  KnowledgeBaseSearchResult,
@@ -39,9 +41,10 @@ from xpander_sdk.modules.agents.models.agent import (
39
41
  AgentStatus,
40
42
  AgentType,
41
43
  DatabaseConnectionString,
42
- LLMCredentials,
43
44
  LLMReasoningEffort,
45
+ TaskLevelStrategies,
44
46
  )
47
+ from xpander_sdk.models.generic import LLMCredentials
45
48
  from xpander_sdk.modules.agents.models.knowledge_bases import AgentKnowledgeBase
46
49
  from xpander_sdk.modules.knowledge_bases.knowledge_bases_module import KnowledgeBases
47
50
  from xpander_sdk.modules.knowledge_bases.sub_modules.knowledge_base import KnowledgeBase
@@ -165,6 +168,9 @@ class Agent(XPanderSharedModel):
165
168
  llm_credentials: Optional[LLMCredentials]
166
169
  expected_output: Optional[str]
167
170
  agno_settings: Optional[AgnoSettings]
171
+ orchestration_nodes: Optional[List[OrchestrationNode]] = []
172
+ notification_settings: Optional[NotificationSettings] = {}
173
+ task_level_strategies: Optional[TaskLevelStrategies] = None
168
174
 
169
175
  Example:
170
176
  >>> agent = Agent(id="agent123", name="Example Agent")
@@ -209,6 +215,9 @@ class Agent(XPanderSharedModel):
209
215
  llm_credentials: Optional[LLMCredentials] = None
210
216
  expected_output: Optional[str] = ""
211
217
  agno_settings: Optional[AgnoSettings] = AgnoSettings()
218
+ orchestration_nodes: Optional[List[OrchestrationNode]] = []
219
+ notification_settings: Optional[NotificationSettings] = {}
220
+ task_level_strategies: Optional[TaskLevelStrategies] = None
212
221
 
213
222
  _connection_string: Optional[DatabaseConnectionString] = None
214
223
 
@@ -571,7 +571,7 @@ def _configure_deep_planning_guidance(args: Dict[str, Any], agent: Agent, task:
571
571
  plan_str = task.deep_planning.model_dump_json() if task.deep_planning and task.deep_planning.enabled and len(task.deep_planning.tasks) != 0 else "No execution plan, please generate"
572
572
  args["additional_context"] += f" \n Current execution plan: {plan_str}"
573
573
 
574
- def _load_llm_model(agent: Agent, override: Optional[Dict[str, Any]]) -> Any:
574
+ def _load_llm_model(agent: Agent, override: Optional[Dict[str, Any]] = {}) -> Any:
575
575
  """
576
576
  Load and configure the appropriate LLM model based on the agent's provider configuration.
577
577
 
@@ -801,7 +801,7 @@ def _configure_agentic_memory(
801
801
  args["memory_manager"] = MemoryManager(delete_memories=True,clear_memories=True)
802
802
  args["enable_agentic_memory"] = agent.agno_settings.agentic_memory
803
803
 
804
- if agent_memories_enabled:
804
+ if agent_memories_enabled and not agent.is_a_team:
805
805
  args["add_culture_to_context"] = True
806
806
 
807
807
  if agent.agno_settings.agentic_culture:
@@ -39,26 +39,15 @@ class AgentExecutionStatus(str, Enum):
39
39
  Stopped = "stopped"
40
40
 
41
41
 
42
- class HumanInTheLoop(BaseModel):
42
+ class HumanInTheLoopRequest(BaseModel):
43
43
  """
44
44
  Model representing human-in-the-loop approval records for tasks.
45
45
 
46
46
  Attributes:
47
- operation_id (str): Unique identifier of the operation requiring approval.
48
- approved_by (Optional[str]): User who approved the operation.
49
- rejected_by (Optional[str]): User who rejected the operation.
50
- title (Optional[str]): Title/subject of the approval request.
51
- description (Optional[str]): Detailed description of the approval.
52
- content (str): Content or action that requires approval.
47
+ wait_node_id (str): The id of the node that triggered this HITL.
53
48
  """
54
49
 
55
- operation_id: str
56
- approved_by: Optional[str] = None
57
- rejected_by: Optional[str] = None
58
- title: Optional[str] = None
59
- description: Optional[str] = None
60
- content: str
61
-
50
+ wait_node_id: str
62
51
 
63
52
  class AgentExecutionInput(BaseModel):
64
53
  """
@@ -67,7 +67,7 @@ from xpander_sdk.modules.events.utils.generic import get_events_base, get_events
67
67
  from xpander_sdk.modules.tasks.models.task import (
68
68
  AgentExecutionInput,
69
69
  AgentExecutionStatus,
70
- HumanInTheLoop,
70
+ HumanInTheLoopRequest,
71
71
  ExecutionMetricsReport,
72
72
  PendingECARequest,
73
73
  TaskReportRequest,
@@ -97,7 +97,7 @@ class TaskUpdateEvent(XPanderSharedModel):
97
97
  task_id: str
98
98
  organization_id: str
99
99
  time: datetime
100
- data: TaskUpdateEventData
100
+ data: Any
101
101
 
102
102
 
103
103
  class Task(XPanderSharedModel):
@@ -125,7 +125,7 @@ class Task(XPanderSharedModel):
125
125
  sub_executions (Optional[List[str]]): List of sub-execution IDs.
126
126
  is_manually_stopped (Optional[bool]): Flag indicating if the task was manually stopped.
127
127
  payload_extension (Optional[dict]): Additional data for the task.
128
- hitl_request (Optional[HumanInTheLoop]): Human-in-the-loop request state.
128
+ hitl_request (Optional[HumanInTheLoopRequest]): Human-in-the-loop request state.
129
129
  pending_eca_request (Optional[PendingECARequest]): Pending ECA request, if any.
130
130
  source (Optional[str]): Source information of the task.
131
131
  output_format (Optional[OutputFormat]): Desired output format of the task.
@@ -137,6 +137,7 @@ class Task(XPanderSharedModel):
137
137
  triggering_agent_id (Optional[str]): Optional triggering agent id.
138
138
  title (Optional[str]): Optional task title.
139
139
  deep_planning: Optional[DeepPlanning] = Field(default_factory=DeepPlanning)
140
+ execution_attempts: Optional[int] = 1
140
141
 
141
142
  Example:
142
143
  >>> task = Task.load(task_id="task_123")
@@ -171,12 +172,13 @@ class Task(XPanderSharedModel):
171
172
  sub_executions: Optional[List[str]] = []
172
173
  is_manually_stopped: Optional[bool] = False
173
174
  payload_extension: Optional[dict] = None
174
- hitl_request: Optional[HumanInTheLoop] = None
175
+ hitl_request: Optional[HumanInTheLoopRequest] = None
175
176
  pending_eca_request: Optional[PendingECARequest] = None
176
177
  source: Optional[str] = None
177
178
  output_format: Optional[OutputFormat] = None
178
179
  output_schema: Optional[Dict] = None
179
180
  events_streaming: Optional[bool] = False
181
+ is_orchestration: Optional[bool] = False
180
182
  additional_context: Optional[str] = None
181
183
  expected_output: Optional[str] = (None,)
182
184
  mcp_servers: Optional[List[MCPServerDetails]] = ([],)
@@ -185,6 +187,7 @@ class Task(XPanderSharedModel):
185
187
  think_mode: Optional[ThinkMode] = ThinkMode.Default
186
188
  disable_attachment_injection: Optional[bool] = False
187
189
  deep_planning: Optional[DeepPlanning] = Field(default_factory=DeepPlanning)
190
+ execution_attempts: Optional[int] = 1
188
191
 
189
192
  # metrics
190
193
  tokens: Optional[Tokens] = None
@@ -12,7 +12,6 @@ from xpander_sdk.modules.backend.backend_module import Backend
12
12
  from xpander_sdk.modules.backend.utils.mcp_oauth import push_event
13
13
  from xpander_sdk.modules.tasks.sub_modules.task import TaskUpdateEvent
14
14
  from xpander_sdk.utils.event_loop import run_sync
15
- from xpander_sdk.utils.generic import get_current_timestamp
16
15
 
17
16
  if TYPE_CHECKING:
18
17
  from xpander_sdk.modules.tasks.sub_modules.task import Task
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xpander-sdk
3
- Version: 2.0.187
3
+ Version: 2.0.189
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
@@ -23,6 +23,9 @@ src/xpander_sdk/models/configuration.py
23
23
  src/xpander_sdk/models/deep_planning.py
24
24
  src/xpander_sdk/models/events.py
25
25
  src/xpander_sdk/models/frameworks.py
26
+ src/xpander_sdk/models/generic.py
27
+ src/xpander_sdk/models/notifications.py
28
+ src/xpander_sdk/models/orchestrations.py
26
29
  src/xpander_sdk/models/shared.py
27
30
  src/xpander_sdk/models/user.py
28
31
  src/xpander_sdk/modules/__init__.py
File without changes
File without changes
File without changes