codemie-sdk-python 0.1.52__py3-none-any.whl → 0.1.258__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of codemie-sdk-python might be problematic. Click here for more details.
- codemie_sdk/__init__.py +114 -2
- codemie_sdk/auth/credentials.py +5 -4
- codemie_sdk/client/client.py +66 -5
- codemie_sdk/models/__init__.py +0 -0
- codemie_sdk/models/assistant.py +137 -12
- codemie_sdk/models/conversation.py +169 -0
- codemie_sdk/models/datasource.py +81 -1
- codemie_sdk/models/file_operation.py +25 -0
- codemie_sdk/models/integration.py +23 -2
- codemie_sdk/models/vendor_assistant.py +187 -0
- codemie_sdk/models/vendor_guardrail.py +152 -0
- codemie_sdk/models/vendor_knowledgebase.py +151 -0
- codemie_sdk/models/vendor_workflow.py +145 -0
- codemie_sdk/models/workflow.py +4 -4
- codemie_sdk/models/workflow_execution_payload.py +21 -0
- codemie_sdk/models/workflow_state.py +6 -3
- codemie_sdk/models/workflow_thoughts.py +26 -0
- codemie_sdk/services/assistant.py +261 -3
- codemie_sdk/services/conversation.py +90 -0
- codemie_sdk/services/datasource.py +81 -6
- codemie_sdk/services/files.py +82 -0
- codemie_sdk/services/integration.py +21 -1
- codemie_sdk/services/vendor_assistant.py +364 -0
- codemie_sdk/services/vendor_guardrail.py +375 -0
- codemie_sdk/services/vendor_knowledgebase.py +270 -0
- codemie_sdk/services/vendor_workflow.py +330 -0
- codemie_sdk/services/webhook.py +41 -0
- codemie_sdk/services/workflow.py +26 -2
- codemie_sdk/services/workflow_execution.py +54 -6
- codemie_sdk/utils/http.py +43 -35
- codemie_sdk_python-0.1.258.dist-info/METADATA +1404 -0
- codemie_sdk_python-0.1.258.dist-info/RECORD +45 -0
- codemie_sdk_python-0.1.52.dist-info/METADATA +0 -809
- codemie_sdk_python-0.1.52.dist-info/RECORD +0 -29
- {codemie_sdk_python-0.1.52.dist-info → codemie_sdk_python-0.1.258.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"""Models for vendor knowledge base settings."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from enum import Enum
|
|
5
|
+
from typing import Optional, List
|
|
6
|
+
|
|
7
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
8
|
+
|
|
9
|
+
from .vendor_assistant import PaginationInfo, TokenPagination
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class VendorKnowledgeBaseSetting(BaseModel):
|
|
13
|
+
"""Model representing a vendor knowledge base setting."""
|
|
14
|
+
|
|
15
|
+
model_config = ConfigDict(extra="ignore")
|
|
16
|
+
|
|
17
|
+
setting_id: str = Field(..., description="Unique identifier for the setting")
|
|
18
|
+
setting_name: str = Field(..., description="Name of the setting")
|
|
19
|
+
project: str = Field(..., description="Project associated with the setting")
|
|
20
|
+
entities: List[str] = Field(
|
|
21
|
+
default_factory=list, description="List of entities associated with the setting"
|
|
22
|
+
)
|
|
23
|
+
invalid: Optional[bool] = Field(None, description="Whether the setting is invalid")
|
|
24
|
+
error: Optional[str] = Field(
|
|
25
|
+
None, description="Error message if the setting is invalid"
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class VendorKnowledgeBaseSettingsResponse(BaseModel):
|
|
30
|
+
"""Response model for vendor knowledge base settings list."""
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(extra="ignore")
|
|
33
|
+
|
|
34
|
+
data: List[VendorKnowledgeBaseSetting] = Field(
|
|
35
|
+
..., description="List of vendor knowledge base settings"
|
|
36
|
+
)
|
|
37
|
+
pagination: PaginationInfo = Field(..., description="Pagination information")
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class VendorKnowledgeBaseStatus(str, Enum):
|
|
41
|
+
"""Status of vendor knowledge base."""
|
|
42
|
+
|
|
43
|
+
PREPARED = "PREPARED"
|
|
44
|
+
NOT_PREPARED = "NOT_PREPARED"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class VendorKnowledgeBase(BaseModel):
|
|
48
|
+
"""Model representing a vendor knowledge base."""
|
|
49
|
+
|
|
50
|
+
model_config = ConfigDict(extra="ignore")
|
|
51
|
+
|
|
52
|
+
id: str = Field(..., description="Unique identifier for the knowledge base")
|
|
53
|
+
name: str = Field(..., description="Name of the knowledge base")
|
|
54
|
+
status: VendorKnowledgeBaseStatus = Field(
|
|
55
|
+
..., description="Status of the knowledge base"
|
|
56
|
+
)
|
|
57
|
+
description: Optional[str] = Field(
|
|
58
|
+
None, description="Description of the knowledge base"
|
|
59
|
+
)
|
|
60
|
+
updatedAt: datetime = Field(
|
|
61
|
+
..., description="Last update timestamp", alias="updatedAt"
|
|
62
|
+
)
|
|
63
|
+
aiRunId: Optional[str] = Field(
|
|
64
|
+
None,
|
|
65
|
+
description="AI run ID if the knowledge base is installed",
|
|
66
|
+
alias="aiRunId",
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class VendorKnowledgeBasesResponse(BaseModel):
|
|
71
|
+
"""Response model for vendor knowledge bases list."""
|
|
72
|
+
|
|
73
|
+
model_config = ConfigDict(extra="ignore")
|
|
74
|
+
|
|
75
|
+
data: List[VendorKnowledgeBase] = Field(
|
|
76
|
+
..., description="List of vendor knowledge bases"
|
|
77
|
+
)
|
|
78
|
+
pagination: TokenPagination = Field(
|
|
79
|
+
..., description="Token-based pagination information"
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class VendorKnowledgeBaseDetail(BaseModel):
|
|
84
|
+
"""Model representing detailed information about a vendor knowledge base."""
|
|
85
|
+
|
|
86
|
+
model_config = ConfigDict(extra="ignore")
|
|
87
|
+
|
|
88
|
+
id: str = Field(..., description="Unique identifier for the knowledge base")
|
|
89
|
+
name: str = Field(..., description="Name of the knowledge base")
|
|
90
|
+
description: Optional[str] = Field(
|
|
91
|
+
None, description="Description of the knowledge base"
|
|
92
|
+
)
|
|
93
|
+
type: str = Field(..., description="Type of knowledge base (e.g., VECTOR)")
|
|
94
|
+
status: VendorKnowledgeBaseStatus = Field(
|
|
95
|
+
..., description="Status of the knowledge base"
|
|
96
|
+
)
|
|
97
|
+
embeddingModel: str = Field(
|
|
98
|
+
...,
|
|
99
|
+
description="Embedding model used by the knowledge base",
|
|
100
|
+
alias="embeddingModel",
|
|
101
|
+
)
|
|
102
|
+
kendraIndexArn: Optional[str] = Field(
|
|
103
|
+
None, description="Kendra index ARN if applicable", alias="kendraIndexArn"
|
|
104
|
+
)
|
|
105
|
+
createdAt: datetime = Field(
|
|
106
|
+
..., description="Creation timestamp", alias="createdAt"
|
|
107
|
+
)
|
|
108
|
+
updatedAt: datetime = Field(
|
|
109
|
+
..., description="Last update timestamp", alias="updatedAt"
|
|
110
|
+
)
|
|
111
|
+
aiRunId: Optional[str] = Field(
|
|
112
|
+
None,
|
|
113
|
+
description="AI run ID if the knowledge base is installed",
|
|
114
|
+
alias="aiRunId",
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class VendorKnowledgeBaseInstallRequest(BaseModel):
|
|
119
|
+
"""Model for a single knowledge base installation request."""
|
|
120
|
+
|
|
121
|
+
model_config = ConfigDict(extra="ignore")
|
|
122
|
+
|
|
123
|
+
id: str = Field(..., description="Knowledge base ID to install")
|
|
124
|
+
setting_id: str = Field(..., description="Vendor setting ID")
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class VendorKnowledgeBaseInstallSummary(BaseModel):
|
|
128
|
+
"""Model for knowledge base installation summary."""
|
|
129
|
+
|
|
130
|
+
model_config = ConfigDict(extra="ignore")
|
|
131
|
+
|
|
132
|
+
knowledgeBaseId: str = Field(..., description="Installed knowledge base ID")
|
|
133
|
+
aiRunId: str = Field(..., description="AI run ID for the installation")
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
class VendorKnowledgeBaseInstallResponse(BaseModel):
|
|
137
|
+
"""Response model for knowledge base installation."""
|
|
138
|
+
|
|
139
|
+
model_config = ConfigDict(extra="ignore")
|
|
140
|
+
|
|
141
|
+
summary: List[VendorKnowledgeBaseInstallSummary] = Field(
|
|
142
|
+
..., description="List of installation summaries"
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
class VendorKnowledgeBaseUninstallResponse(BaseModel):
|
|
147
|
+
"""Response model for knowledge base uninstallation."""
|
|
148
|
+
|
|
149
|
+
model_config = ConfigDict(extra="ignore")
|
|
150
|
+
|
|
151
|
+
success: bool = Field(..., description="Whether the uninstallation was successful")
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"""Models for vendor workflow settings."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from enum import Enum
|
|
5
|
+
from typing import Optional, List
|
|
6
|
+
|
|
7
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
8
|
+
|
|
9
|
+
from .vendor_assistant import PaginationInfo, TokenPagination
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class VendorWorkflowSetting(BaseModel):
|
|
13
|
+
"""Model representing a vendor workflow setting."""
|
|
14
|
+
|
|
15
|
+
model_config = ConfigDict(extra="ignore")
|
|
16
|
+
|
|
17
|
+
setting_id: str = Field(..., description="Unique identifier for the setting")
|
|
18
|
+
setting_name: str = Field(..., description="Name of the setting")
|
|
19
|
+
project: str = Field(..., description="Project associated with the setting")
|
|
20
|
+
entities: List[str] = Field(
|
|
21
|
+
default_factory=list, description="List of entities associated with the setting"
|
|
22
|
+
)
|
|
23
|
+
invalid: Optional[bool] = Field(None, description="Whether the setting is invalid")
|
|
24
|
+
error: Optional[str] = Field(
|
|
25
|
+
None, description="Error message if the setting is invalid"
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class VendorWorkflowSettingsResponse(BaseModel):
|
|
30
|
+
"""Response model for vendor workflow settings list."""
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(extra="ignore")
|
|
33
|
+
|
|
34
|
+
data: List[VendorWorkflowSetting] = Field(
|
|
35
|
+
..., description="List of vendor workflow settings"
|
|
36
|
+
)
|
|
37
|
+
pagination: PaginationInfo = Field(..., description="Pagination information")
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class VendorWorkflowStatus(str, Enum):
|
|
41
|
+
"""Status of vendor workflow."""
|
|
42
|
+
|
|
43
|
+
PREPARED = "PREPARED"
|
|
44
|
+
NOT_PREPARED = "NOT_PREPARED"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class VendorWorkflow(BaseModel):
|
|
48
|
+
"""Model representing a vendor workflow."""
|
|
49
|
+
|
|
50
|
+
model_config = ConfigDict(extra="ignore")
|
|
51
|
+
|
|
52
|
+
id: str = Field(..., description="Unique identifier for the workflow")
|
|
53
|
+
name: str = Field(..., description="Name of the workflow")
|
|
54
|
+
status: VendorWorkflowStatus = Field(..., description="Status of the workflow")
|
|
55
|
+
description: Optional[str] = Field(None, description="Description of the workflow")
|
|
56
|
+
version: str = Field(..., description="Version of the workflow")
|
|
57
|
+
createdAt: datetime = Field(
|
|
58
|
+
..., description="Creation timestamp", alias="createdAt"
|
|
59
|
+
)
|
|
60
|
+
updatedAt: datetime = Field(
|
|
61
|
+
..., description="Last update timestamp", alias="updatedAt"
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class VendorWorkflowsResponse(BaseModel):
|
|
66
|
+
"""Response model for vendor workflows list."""
|
|
67
|
+
|
|
68
|
+
model_config = ConfigDict(extra="ignore")
|
|
69
|
+
|
|
70
|
+
data: List[VendorWorkflow] = Field(..., description="List of vendor workflows")
|
|
71
|
+
pagination: TokenPagination = Field(
|
|
72
|
+
..., description="Token-based pagination information"
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class VendorWorkflowAlias(BaseModel):
|
|
77
|
+
"""Model representing a vendor workflow alias."""
|
|
78
|
+
|
|
79
|
+
model_config = ConfigDict(extra="ignore")
|
|
80
|
+
|
|
81
|
+
id: str = Field(..., description="Unique identifier for the alias")
|
|
82
|
+
name: str = Field(..., description="Name of the alias")
|
|
83
|
+
status: VendorWorkflowStatus = Field(..., description="Status of the alias")
|
|
84
|
+
description: Optional[str] = Field(None, description="Description of the alias")
|
|
85
|
+
version: str = Field(..., description="Version of the alias")
|
|
86
|
+
createdAt: datetime = Field(
|
|
87
|
+
..., description="Creation timestamp", alias="createdAt"
|
|
88
|
+
)
|
|
89
|
+
updatedAt: datetime = Field(
|
|
90
|
+
..., description="Last update timestamp", alias="updatedAt"
|
|
91
|
+
)
|
|
92
|
+
aiRunId: Optional[str] = Field(
|
|
93
|
+
None, description="AI run ID if the alias is installed", alias="aiRunId"
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class VendorWorkflowAliasesResponse(BaseModel):
|
|
98
|
+
"""Response model for vendor workflow aliases list."""
|
|
99
|
+
|
|
100
|
+
model_config = ConfigDict(extra="ignore")
|
|
101
|
+
|
|
102
|
+
data: List[VendorWorkflowAlias] = Field(
|
|
103
|
+
..., description="List of vendor workflow aliases"
|
|
104
|
+
)
|
|
105
|
+
pagination: TokenPagination = Field(
|
|
106
|
+
..., description="Token-based pagination information"
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class VendorWorkflowInstallRequest(BaseModel):
|
|
111
|
+
"""Model for a single workflow installation request."""
|
|
112
|
+
|
|
113
|
+
model_config = ConfigDict(extra="ignore")
|
|
114
|
+
|
|
115
|
+
id: str = Field(..., description="Workflow ID to install")
|
|
116
|
+
flowAliasId: str = Field(..., description="Flow alias ID to use for the workflow")
|
|
117
|
+
setting_id: str = Field(..., description="Vendor setting ID")
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
class VendorWorkflowInstallSummary(BaseModel):
|
|
121
|
+
"""Model for workflow installation summary."""
|
|
122
|
+
|
|
123
|
+
model_config = ConfigDict(extra="ignore")
|
|
124
|
+
|
|
125
|
+
flowId: str = Field(..., description="Installed workflow ID")
|
|
126
|
+
flowAliasId: str = Field(..., description="Flow alias ID used for installation")
|
|
127
|
+
aiRunId: str = Field(..., description="AI run ID for the installation")
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class VendorWorkflowInstallResponse(BaseModel):
|
|
131
|
+
"""Response model for workflow installation."""
|
|
132
|
+
|
|
133
|
+
model_config = ConfigDict(extra="ignore")
|
|
134
|
+
|
|
135
|
+
summary: List[VendorWorkflowInstallSummary] = Field(
|
|
136
|
+
..., description="List of installation summaries"
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
class VendorWorkflowUninstallResponse(BaseModel):
|
|
141
|
+
"""Response model for workflow uninstallation."""
|
|
142
|
+
|
|
143
|
+
model_config = ConfigDict(extra="ignore")
|
|
144
|
+
|
|
145
|
+
success: bool = Field(..., description="Whether the uninstallation was successful")
|
codemie_sdk/models/workflow.py
CHANGED
|
@@ -59,9 +59,9 @@ class Workflow(BaseModel):
|
|
|
59
59
|
mode: WorkflowMode = WorkflowMode.SEQUENTIAL
|
|
60
60
|
shared: bool = False
|
|
61
61
|
icon_url: Optional[str] = None
|
|
62
|
-
created_date: datetime = Field(None, alias="date")
|
|
63
|
-
update_date: datetime = Field(None)
|
|
64
|
-
created_by: User
|
|
62
|
+
created_date: Optional[datetime] = Field(None, alias="date")
|
|
63
|
+
update_date: Optional[datetime] = Field(None)
|
|
64
|
+
created_by: Optional[User] = None
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
class ExecutionStatus(str, Enum):
|
|
@@ -84,6 +84,6 @@ class WorkflowExecution(BaseModel):
|
|
|
84
84
|
status: ExecutionStatus = Field(alias="overall_status")
|
|
85
85
|
created_date: datetime = Field(alias="date")
|
|
86
86
|
prompt: str
|
|
87
|
-
updated_date: Optional[datetime] =
|
|
87
|
+
updated_date: Optional[datetime] = Field(alias="update_date")
|
|
88
88
|
created_by: User
|
|
89
89
|
tokens_usage: Optional[TokensUsage] = None
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""Workflow execution payload models."""
|
|
2
|
+
|
|
3
|
+
from typing import Optional, Union
|
|
4
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class WorkflowExecutionCreateRequest(BaseModel):
|
|
8
|
+
"""Request model for workflow execution creation."""
|
|
9
|
+
|
|
10
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
11
|
+
|
|
12
|
+
user_input: Optional[Union[str, dict, list, int, float, bool]] = Field(
|
|
13
|
+
None, description="User input for the workflow execution"
|
|
14
|
+
)
|
|
15
|
+
file_name: Optional[str] = Field(
|
|
16
|
+
None, description="File name associated with the workflow execution"
|
|
17
|
+
)
|
|
18
|
+
propagate_headers: bool = Field(
|
|
19
|
+
default=False,
|
|
20
|
+
description="Enable propagation of X-* HTTP headers to MCP servers during tool execution",
|
|
21
|
+
)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from datetime import datetime
|
|
4
4
|
from enum import Enum
|
|
5
|
-
from typing import Optional
|
|
5
|
+
from typing import List, Optional
|
|
6
6
|
|
|
7
7
|
from pydantic import BaseModel, ConfigDict
|
|
8
8
|
|
|
@@ -24,9 +24,11 @@ class WorkflowExecutionStateThought(BaseModel):
|
|
|
24
24
|
model_config = ConfigDict(populate_by_name=True)
|
|
25
25
|
|
|
26
26
|
id: str
|
|
27
|
-
|
|
28
|
-
created_at: datetime
|
|
27
|
+
execution_state_id: str
|
|
29
28
|
parent_id: Optional[str] = None
|
|
29
|
+
author_name: str
|
|
30
|
+
author_type: str
|
|
31
|
+
date: datetime
|
|
30
32
|
|
|
31
33
|
|
|
32
34
|
class WorkflowExecutionState(BaseModel):
|
|
@@ -41,6 +43,7 @@ class WorkflowExecutionState(BaseModel):
|
|
|
41
43
|
status: WorkflowExecutionStatusEnum = WorkflowExecutionStatusEnum.NOT_STARTED
|
|
42
44
|
started_at: Optional[datetime] = None
|
|
43
45
|
completed_at: Optional[datetime] = None
|
|
46
|
+
thoughts: Optional[List[WorkflowExecutionStateThought]] = None
|
|
44
47
|
|
|
45
48
|
|
|
46
49
|
class WorkflowExecutionStateOutput(BaseModel):
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Workflow execution thoughts models."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from typing import List, Optional
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, ConfigDict
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class WorkflowExecutionThought(BaseModel):
|
|
10
|
+
"""Model for workflow execution thought."""
|
|
11
|
+
|
|
12
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
13
|
+
|
|
14
|
+
id: str
|
|
15
|
+
execution_state_id: str
|
|
16
|
+
parent_id: Optional[str] = None
|
|
17
|
+
author_name: str
|
|
18
|
+
author_type: str
|
|
19
|
+
input_text: str
|
|
20
|
+
content: str
|
|
21
|
+
date: datetime
|
|
22
|
+
children: List["WorkflowExecutionThought"] = []
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# Update forward references for recursive model
|
|
26
|
+
WorkflowExecutionThought.model_rebuild()
|