codemie-sdk-python 0.1.717__py3-none-any.whl → 0.1.719__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.
codemie_sdk/__init__.py CHANGED
@@ -93,6 +93,7 @@ from .models.analytics import (
93
93
  SummariesResponse,
94
94
  TabularResponse,
95
95
  UsersListResponse,
96
+ AnalyticsDetailResponse,
96
97
  AnalyticsQueryParams,
97
98
  PaginatedAnalyticsQueryParams,
98
99
  CliAnalyticsQueryParams,
@@ -102,6 +103,7 @@ from .models.analytics import (
102
103
  CliAnalyticsSessionsResponse,
103
104
  CliAnalyticsSessionDetailResponse,
104
105
  CliAnalyticsRepositoriesResponse,
106
+ CliInsightsUserDetailQueryParams,
105
107
  )
106
108
  from .services.customer_config_service import CustomerConfigService
107
109
  from .services.vendor_assistant import VendorAssistantService
@@ -162,6 +164,8 @@ from .models.assistant import (
162
164
  BuiltinSubagent,
163
165
  )
164
166
  from .models.integration import (
167
+ IntegrationListPagination,
168
+ PaginatedIntegrationResponse,
165
169
  TransferMode,
166
170
  TransferItem,
167
171
  TransferSettingsResponse,
@@ -323,6 +327,7 @@ __all__ = [
323
327
  "SummariesResponse",
324
328
  "TabularResponse",
325
329
  "UsersListResponse",
330
+ "AnalyticsDetailResponse",
326
331
  "AnalyticsQueryParams",
327
332
  "PaginatedAnalyticsQueryParams",
328
333
  "CliAnalyticsQueryParams",
@@ -332,6 +337,7 @@ __all__ = [
332
337
  "CliAnalyticsSessionsResponse",
333
338
  "CliAnalyticsSessionDetailResponse",
334
339
  "CliAnalyticsRepositoriesResponse",
340
+ "CliInsightsUserDetailQueryParams",
335
341
  "AnalyticsService",
336
342
  "CustomerConfigService",
337
343
  "MermaidDiagramRequest",
@@ -361,6 +367,8 @@ __all__ = [
361
367
  "SkillPagination",
362
368
  "SkillService",
363
369
  "BuiltinSubagent",
370
+ "IntegrationListPagination",
371
+ "PaginatedIntegrationResponse",
364
372
  "TransferMode",
365
373
  "TransferItem",
366
374
  "TransferSettingsResponse",
@@ -1,7 +1,11 @@
1
1
  """Admin models for managing applications/projects."""
2
2
 
3
+ from datetime import datetime
4
+
3
5
  from pydantic import BaseModel, ConfigDict, Field
4
6
 
7
+ from .llm import ModelStatus, ModelStatusValue
8
+
5
9
 
6
10
  class ApplicationInfo(BaseModel):
7
11
  """Single application entry returned by GET /v1/admin/applications."""
@@ -96,3 +100,97 @@ class AdminUserListResponse(BaseModel):
96
100
  @property
97
101
  def total(self) -> int:
98
102
  return self.pagination.total
103
+
104
+
105
+ class AdminModelCost(BaseModel):
106
+ """Per-token cost of a model in the admin catalog."""
107
+
108
+ model_config = ConfigDict(extra="ignore")
109
+
110
+ input: float
111
+ output: float
112
+
113
+
114
+ class AdminLLMModel(BaseModel):
115
+ """Model entry returned by GET /v1/admin/llm/status."""
116
+
117
+ model_config = ConfigDict(extra="ignore")
118
+
119
+ base_name: str
120
+ label: str
121
+ model_type: str = Field(description="chat, embedding or audio_transcription")
122
+ enabled: bool
123
+ status: ModelStatusValue
124
+ provider: str | None = None
125
+ router_type: str | None = Field(
126
+ default=None,
127
+ description="Set for routers; their status is computed and cannot be changed",
128
+ )
129
+ is_premium: bool | None = None
130
+ multimodal: bool | None = None
131
+ supports_tools: bool | None = None
132
+ supports_image_generation: bool = False
133
+ cost: AdminModelCost | None = None
134
+ updated_by_name: str | None = None
135
+ updated_at: datetime | None = None
136
+
137
+
138
+ class LLMModelStatusUpdate(BaseModel):
139
+ """Result of setting the status of one model."""
140
+
141
+ model_config = ConfigDict(extra="ignore")
142
+
143
+ base_name: str
144
+ status: ModelStatusValue
145
+
146
+
147
+ class LLMModelStatusBulkItem(BaseModel):
148
+ """One requested status change in a bulk update."""
149
+
150
+ model_config = ConfigDict(extra="ignore", use_enum_values=True)
151
+
152
+ base_name: str
153
+ status: ModelStatus
154
+
155
+
156
+ class LLMModelStatusBulkItemResult(BaseModel):
157
+ """Outcome of one item of a bulk status update."""
158
+
159
+ model_config = ConfigDict(extra="ignore")
160
+
161
+ base_name: str
162
+ status: ModelStatusValue
163
+ success: bool
164
+ error: str | None = None
165
+
166
+
167
+ class LLMModelStatusBulkResult(BaseModel):
168
+ """Summary of a bulk status update; every item is processed independently."""
169
+
170
+ model_config = ConfigDict(extra="ignore")
171
+
172
+ total: int
173
+ succeeded: int
174
+ failed: int
175
+ results: list[LLMModelStatusBulkItemResult] = Field(default_factory=list)
176
+
177
+
178
+ class GlobalDefaultLLMModel(BaseModel):
179
+ """Global default model as returned by /v1/admin/llm/default."""
180
+
181
+ model_config = ConfigDict(extra="ignore")
182
+
183
+ saved_base_name: str | None = Field(
184
+ default=None, description="The model an administrator saved, if any"
185
+ )
186
+ updated_by_id: str | None = None
187
+ updated_by_name: str | None = None
188
+ updated_at: datetime | None = None
189
+ effective_base_name: str | None = Field(
190
+ default=None, description="The model the platform actually uses as default"
191
+ )
192
+ source: str | None = None
193
+ temporary_fallback: bool = Field(
194
+ default=False,
195
+ description="True when the saved model is not usable and another one is used",
196
+ )
@@ -1,8 +1,16 @@
1
1
  """Models for analytics-related data structures."""
2
2
 
3
+ import json
3
4
  from typing import Any
4
5
 
5
- from pydantic import BaseModel, ConfigDict, Field
6
+ from pydantic import (
7
+ BaseModel,
8
+ ConfigDict,
9
+ Field,
10
+ field_serializer,
11
+ field_validator,
12
+ model_validator,
13
+ )
6
14
 
7
15
 
8
16
  class ResponseMetadata(BaseModel):
@@ -122,6 +130,19 @@ class UsersListResponse(BaseModel):
122
130
  metadata: ResponseMetadata = Field(description="Response metadata")
123
131
 
124
132
 
133
+ class AnalyticsDetailResponse(BaseModel):
134
+ """Response for analytics detail/drilldown endpoints.
135
+
136
+ ``data`` is intentionally open-ended: each drilldown endpoint returns its own
137
+ sections, so the payload is not typed here.
138
+ """
139
+
140
+ model_config = ConfigDict(extra="ignore")
141
+
142
+ data: dict[str, Any] = Field(description="Detail payload")
143
+ metadata: ResponseMetadata = Field(description="Response metadata")
144
+
145
+
125
146
  class AnalyticsQueryParams(BaseModel):
126
147
  """Query parameters for analytics endpoints."""
127
148
 
@@ -156,6 +177,61 @@ class PaginatedAnalyticsQueryParams(AnalyticsQueryParams):
156
177
  )
157
178
 
158
179
 
180
+ class RunAttributesQueryParams(PaginatedAnalyticsQueryParams):
181
+ """Query parameters of the endpoints that filter by run attributes.
182
+
183
+ Used by ``get_assistants_requests``, ``get_workflows_executions`` and
184
+ ``get_attributes_usage``. Other analytics endpoints do not implement the
185
+ ``attributes`` filter, so it is not part of the shared base class.
186
+ """
187
+
188
+ attributes: str | dict[str, str] | None = Field(
189
+ None,
190
+ description="Run attributes filter: a JSON object of string keys and string "
191
+ "values. A dict is serialized to JSON; a string is sent as it is.",
192
+ )
193
+
194
+ @field_serializer("attributes")
195
+ def _serialize_attributes(self, value: str | dict[str, str] | None) -> str | None:
196
+ """Send a dict as the JSON object the endpoints expect in the query string."""
197
+ if isinstance(value, dict):
198
+ return json.dumps(value)
199
+ return value
200
+
201
+
202
+ class CliInsightsUserDetailQueryParams(AnalyticsQueryParams):
203
+ """Query parameters of the CLI Insights user detail drilldown.
204
+
205
+ The drilldown targets one user through ``user_name`` (and optionally
206
+ ``user_id``), so the shared ``users`` filter is rejected: it could name a
207
+ different user than the one asked for.
208
+ """
209
+
210
+ user_name: str = Field(
211
+ min_length=1, description="User name or e-mail the detail is about"
212
+ )
213
+ user_id: str | None = Field(
214
+ None, description="User id; when set it is checked before the name"
215
+ )
216
+
217
+ @field_validator("user_name", mode="before")
218
+ @classmethod
219
+ def _strip_user_name(cls, value: Any) -> Any:
220
+ """Strip whitespace so a blank name fails the min_length check."""
221
+ if isinstance(value, str):
222
+ return value.strip()
223
+ return value
224
+
225
+ @model_validator(mode="after")
226
+ def _reject_users_filter(self) -> "CliInsightsUserDetailQueryParams":
227
+ if self.users is not None:
228
+ raise ValueError(
229
+ "'users' is not supported for the user detail drilldown; "
230
+ "use 'user_name' and 'user_id' to name the user"
231
+ )
232
+ return self
233
+
234
+
159
235
  # ── CLI Analytics: /v1/analytics/cli-analytics/* ─────────────────────────────
160
236
 
161
237
 
@@ -307,6 +307,10 @@ class Assistant(AssistantBase):
307
307
  system_prompt_history: list[SystemPromptHistory] = Field(default_factory=list)
308
308
  project: str
309
309
  llm_model_type: str | None = None
310
+ effective_llm_model_reason: str | None = Field(
311
+ default=None,
312
+ description="Why the assistant detail shows a different model than the stored one",
313
+ )
310
314
  toolkits: list[ToolKitDetails] = Field(default_factory=list)
311
315
  conversation_starters: list[str] = Field(
312
316
  default_factory=list,
@@ -370,6 +374,7 @@ class Assistant(AssistantBase):
370
374
  interactive_enabled: bool = False
371
375
  enable_image_generation: bool | None = False
372
376
  file_attachment_enabled: bool | None = None
377
+ disabled_context_tools: list[str] = Field(default_factory=list)
373
378
 
374
379
 
375
380
  class AssistantRequestBase(AssistantBase):
@@ -414,6 +419,7 @@ class AssistantRequestBase(AssistantBase):
414
419
  interactive_enabled: bool | None = None
415
420
  enable_image_generation: bool | None = None
416
421
  file_attachment_enabled: bool | None = None
422
+ disabled_context_tools: list[str] | None = None
417
423
 
418
424
 
419
425
  class AssistantCreateRequest(AssistantRequestBase):
@@ -534,6 +540,7 @@ class AssistantVersion(BaseModel):
534
540
  assistant_ids: list[str] = Field(default_factory=list)
535
541
  skill_ids: list[str] | None = None
536
542
  prompt_variables: list[PromptVariable] = Field(default_factory=list)
543
+ disabled_context_tools: list[str] = Field(default_factory=list)
537
544
 
538
545
 
539
546
  class ChatRole(str, Enum):
@@ -619,6 +626,16 @@ class AssistantChatRequest(BaseModel):
619
626
  When false, MCP servers are cached and reused. \
620
627
  If not specified, uses conversation's default setting.",
621
628
  )
629
+ attributes: dict[str, str] | None = Field(
630
+ default=None,
631
+ description="Analytics labels for this run: string keys and string values. \
632
+ Fixed when the conversation starts; the server rejects invalid attributes with 422.",
633
+ )
634
+ save_history: bool | None = Field(
635
+ default=None,
636
+ description="Whether to persist the conversation history. \
637
+ If not specified, the server default (true) applies; false skips saving this interaction.",
638
+ )
622
639
 
623
640
 
624
641
  class AgentMode(str, Enum):
@@ -188,6 +188,7 @@ class ConversationDetails(BaseModel):
188
188
  category: str | None
189
189
  mcp_server_single_usage: bool | None = False
190
190
  finished_at: datetime | None = None
191
+ attributes: dict[str, str] | None = None
191
192
 
192
193
 
193
194
  class ConversationShareRequest(BaseModel):
@@ -85,6 +85,26 @@ class Integration(BaseModel):
85
85
  return dt.isoformat() if dt is not None else None
86
86
 
87
87
 
88
+ class IntegrationListPagination(BaseModel):
89
+ """Pagination block of a combined integrations list response."""
90
+
91
+ model_config = ConfigDict(extra="ignore")
92
+
93
+ page: int
94
+ per_page: int
95
+ total: int
96
+ pages: int
97
+
98
+
99
+ class PaginatedIntegrationResponse(BaseModel):
100
+ """Response of ``GET /v1/settings``: one page of integrations plus its pagination."""
101
+
102
+ model_config = ConfigDict(extra="ignore")
103
+
104
+ data: list[Integration]
105
+ pagination: IntegrationListPagination
106
+
107
+
88
108
  class IntegrationTestRequest(BaseModel):
89
109
  """Model for integration test request."""
90
110
 
codemie_sdk/models/llm.py CHANGED
@@ -1,8 +1,9 @@
1
1
  """Models for LLM service."""
2
2
 
3
3
  from enum import Enum
4
+ from typing import Annotated, Any
4
5
 
5
- from pydantic import BaseModel, Field
6
+ from pydantic import BaseModel, BeforeValidator, Field
6
7
 
7
8
 
8
9
  class LLMProvider(str, Enum):
@@ -15,6 +16,26 @@ class LLMProvider(str, Enum):
15
16
  ANTHROPIC = "anthropic"
16
17
 
17
18
 
19
+ class ModelStatus(str, Enum):
20
+ """Platform-managed status of an LLM model."""
21
+
22
+ ENABLED = "enabled"
23
+ DISABLED = "disabled"
24
+ DEPRECATED = "deprecated"
25
+
26
+
27
+ def _coerce_model_status(value: Any) -> Any:
28
+ """Return a ModelStatus for known values and keep unknown ones as they are."""
29
+ try:
30
+ return ModelStatus(value)
31
+ except ValueError:
32
+ return value
33
+
34
+
35
+ # Response-side status: a status the SDK does not know yet must not fail parsing.
36
+ ModelStatusValue = Annotated[ModelStatus | str, BeforeValidator(_coerce_model_status)]
37
+
38
+
18
39
  class EffortLevel(str, Enum):
19
40
  """Reasoning effort levels, in ascending order."""
20
41
 
@@ -62,3 +83,4 @@ class LLMModel(BaseModel):
62
83
  is_premium: bool | None = None
63
84
  is_router: bool | None = None
64
85
  supports_tools: bool | None = None
86
+ status: ModelStatusValue | None = None
@@ -158,6 +158,7 @@ class WorkflowExecution(BaseModel):
158
158
  created_by: User
159
159
  conversation_id: str | None = None
160
160
  tokens_usage: TokensUsage | None = None
161
+ attributes: dict[str, str] | None = None
161
162
 
162
163
 
163
164
  class WorkflowEvaluationRequest(BaseModel):
@@ -31,3 +31,7 @@ class WorkflowExecutionCreateRequest(BaseModel):
31
31
  tags: list[str] | None = Field(
32
32
  None, description="Tags to attach to the workflow execution trace in Langfuse"
33
33
  )
34
+ attributes: dict[str, str] | None = Field(
35
+ None,
36
+ description="Analytics labels for this execution: string keys and string values",
37
+ )
@@ -1,14 +1,22 @@
1
1
  """Admin service implementation."""
2
2
 
3
+ from urllib.parse import quote
4
+
3
5
  from ..models.admin import (
6
+ AdminLLMModel,
4
7
  AdminUserListItem,
5
8
  AdminUserListResponse,
6
9
  ApplicationCreateRequest,
7
10
  ApplicationCreateResponse,
8
11
  ApplicationsListResponse,
12
+ GlobalDefaultLLMModel,
13
+ LLMModelStatusBulkItem,
14
+ LLMModelStatusBulkResult,
15
+ LLMModelStatusUpdate,
9
16
  LocalUserCreateRequest,
10
17
  LocalUserDetail,
11
18
  )
19
+ from ..models.llm import ModelStatus
12
20
  from ..utils import ApiRequestHandler, TokenSource
13
21
 
14
22
 
@@ -137,3 +145,87 @@ class AdminService:
137
145
  dict,
138
146
  wrap_response=False,
139
147
  )
148
+
149
+ def list_llm_model_statuses(self) -> list[AdminLLMModel]:
150
+ """List the chat and embedding models an administrator can manage.
151
+
152
+ Models the provider reports as unavailable are not listed.
153
+
154
+ Returns:
155
+ Models with their persisted status
156
+ """
157
+ return self._api.get("/v1/admin/llm/status", list[AdminLLMModel])
158
+
159
+ def set_llm_model_status(
160
+ self, base_name: str, status: ModelStatus | str
161
+ ) -> LLMModelStatusUpdate:
162
+ """Set the status of one model.
163
+
164
+ Args:
165
+ base_name: Base name of the model
166
+ status: New status: enabled, disabled or deprecated
167
+
168
+ Returns:
169
+ The base name and the status that was stored
170
+ """
171
+ return self._api.put(
172
+ f"/v1/admin/llm/{quote(base_name, safe='')}/status",
173
+ LLMModelStatusUpdate,
174
+ json_data={"status": ModelStatus(status).value},
175
+ )
176
+
177
+ def bulk_set_llm_model_statuses(
178
+ self, updates: list[LLMModelStatusBulkItem]
179
+ ) -> LLMModelStatusBulkResult:
180
+ """Set the status of several models in one call.
181
+
182
+ Every item is processed on its own: one failing item does not stop the
183
+ others, and its error is reported in the result.
184
+
185
+ Args:
186
+ updates: Up to 100 items, each with a different base name
187
+
188
+ Returns:
189
+ Totals and the per-item results
190
+ """
191
+ return self._api.post(
192
+ "/v1/admin/llm/status/bulk",
193
+ LLMModelStatusBulkResult,
194
+ json_data={"updates": [item.model_dump() for item in updates]},
195
+ )
196
+
197
+ def get_global_default_llm_model(self) -> GlobalDefaultLLMModel:
198
+ """Get the global default model: the saved choice and the effective one."""
199
+ return self._api.get(
200
+ "/v1/admin/llm/default", GlobalDefaultLLMModel, wrap_response=False
201
+ )
202
+
203
+ def set_global_default_llm_model(self, base_name: str) -> GlobalDefaultLLMModel:
204
+ """Save a model as the global default.
205
+
206
+ Args:
207
+ base_name: Base name of a model that is enabled and available
208
+
209
+ Returns:
210
+ The global default after the change
211
+ """
212
+ return self._api.put(
213
+ "/v1/admin/llm/default",
214
+ GlobalDefaultLLMModel,
215
+ json_data={"base_name": base_name},
216
+ wrap_response=False,
217
+ )
218
+
219
+ def reset_global_default_llm_model(self) -> GlobalDefaultLLMModel:
220
+ """Remove the saved global default so the configured one applies again.
221
+
222
+ Returns:
223
+ The global default after the reset
224
+ """
225
+ result = self._api.delete(
226
+ "/v1/admin/llm/default", GlobalDefaultLLMModel, wrap_response=False
227
+ )
228
+ if result is None:
229
+ # The platform may answer 204 No Content; read the state back instead.
230
+ return self.get_global_default_llm_model()
231
+ return result
@@ -3,6 +3,7 @@
3
3
  import json
4
4
 
5
5
  from ..models.analytics import (
6
+ AnalyticsDetailResponse,
6
7
  AnalyticsQueryParams,
7
8
  CliAnalyticsCostResponse,
8
9
  CliAnalyticsQueryParams,
@@ -11,7 +12,9 @@ from ..models.analytics import (
11
12
  CliAnalyticsSessionsQueryParams,
12
13
  CliAnalyticsSessionsResponse,
13
14
  CliAnalyticsUsersResponse,
15
+ CliInsightsUserDetailQueryParams,
14
16
  PaginatedAnalyticsQueryParams,
17
+ RunAttributesQueryParams,
15
18
  SummariesResponse,
16
19
  TabularResponse,
17
20
  UsersListResponse,
@@ -99,12 +102,14 @@ class AnalyticsService:
99
102
 
100
103
  Args:
101
104
  params: Query parameters (filters + pagination); ``assistant_id``
102
- limits the rows to one assistant, ``client_source`` to one client
105
+ limits the rows to one assistant, ``client_source`` to one client,
106
+ ``attributes`` (set on ``RunAttributesQueryParams``) to requests that
107
+ carry those run attributes
103
108
 
104
109
  Returns:
105
110
  TabularResponse with one row per assistant request, newest first,
106
111
  including conversation and request identifiers, tokens, cost,
107
- execution time and status
112
+ execution time, status and the run ``attributes`` column
108
113
  """
109
114
  query_params = params.model_dump(exclude_none=True) if params else {}
110
115
  return self._api.get(
@@ -134,6 +139,54 @@ class AnalyticsService:
134
139
  wrap_response=False,
135
140
  )
136
141
 
142
+ def get_workflows_executions(
143
+ self, params: RunAttributesQueryParams | None = None
144
+ ) -> TabularResponse:
145
+ """Get per-execution workflow analytics, one row per workflow execution.
146
+
147
+ Args:
148
+ params: Query parameters (filters + pagination); ``params.attributes``
149
+ narrows the rows to executions that carry those run attributes
150
+
151
+ Returns:
152
+ TabularResponse with one row per execution, including the run
153
+ ``attributes`` column
154
+ """
155
+ query_params = params.model_dump(exclude_none=True) if params else {}
156
+ return self._api.get(
157
+ "/v1/analytics/workflows-executions",
158
+ TabularResponse,
159
+ params=query_params,
160
+ wrap_response=False,
161
+ )
162
+
163
+ def get_attributes_usage(
164
+ self,
165
+ attribute_key: str | None = None,
166
+ params: RunAttributesQueryParams | None = None,
167
+ ) -> TabularResponse:
168
+ """Get usage grouped by the values of one run attribute key.
169
+
170
+ Args:
171
+ attribute_key: Run attribute key to break usage down by. The server
172
+ requires it; when omitted it answers 422.
173
+ params: Query parameters (filters + pagination); ``params.attributes``
174
+ narrows the rows to runs that also carry those attributes
175
+
176
+ Returns:
177
+ TabularResponse with one row per attribute value (value, conversations,
178
+ workflow_executions, total_tokens, total cost, unique_users, last_used)
179
+ """
180
+ query_params = params.model_dump(exclude_none=True) if params else {}
181
+ if attribute_key is not None:
182
+ query_params["attribute_key"] = attribute_key
183
+ return self._api.get(
184
+ "/v1/analytics/attributes-usage",
185
+ TabularResponse,
186
+ params=query_params,
187
+ wrap_response=False,
188
+ )
189
+
137
190
  def get_tools_usage(
138
191
  self, params: PaginatedAnalyticsQueryParams | None = None
139
192
  ) -> TabularResponse:
@@ -504,6 +557,30 @@ class AnalyticsService:
504
557
  wrap_response=False,
505
558
  )
506
559
 
560
+ def get_cli_insights_user_detail(
561
+ self, params: CliInsightsUserDetailQueryParams
562
+ ) -> AnalyticsDetailResponse:
563
+ """Get the CLI Insights drilldown for one user.
564
+
565
+ Args:
566
+ params: ``user_name`` (required), optional ``user_id`` and the
567
+ dashboard filters (time period or dates, projects); the shared
568
+ ``users`` filter is rejected, name the user with ``user_name``
569
+
570
+ Returns:
571
+ AnalyticsDetailResponse with the user's detail payload
572
+
573
+ Raises:
574
+ requests.HTTPError: 404 when the identifier matches no CodeMie user
575
+ and no activity in the period
576
+ """
577
+ return self._api.get(
578
+ "/v1/analytics/cli-insights-user-detail",
579
+ AnalyticsDetailResponse,
580
+ params=params.model_dump(exclude_none=True),
581
+ wrap_response=False,
582
+ )
583
+
507
584
  def get_users(
508
585
  self, params: AnalyticsQueryParams | None = None
509
586
  ) -> UsersListResponse:
@@ -328,6 +328,9 @@ class AssistantService:
328
328
  toolkits=version.toolkits
329
329
  if hasattr(version, "toolkits")
330
330
  else assistant.toolkits,
331
+ disabled_context_tools=version.disabled_context_tools
332
+ if hasattr(version, "disabled_context_tools")
333
+ else assistant.disabled_context_tools,
331
334
  shared=assistant.shared,
332
335
  is_react=assistant.is_react,
333
336
  is_global=assistant.is_global,
@@ -253,7 +253,10 @@ class ConversationService:
253
253
  # History management methods
254
254
 
255
255
  def upsert_history(
256
- self, conversation_id: str, request: UpsertHistoryRequest
256
+ self,
257
+ conversation_id: str,
258
+ request: UpsertHistoryRequest,
259
+ headers: dict[str, str] | None = None,
257
260
  ) -> UpsertHistoryResponse:
258
261
  """Create or update conversation with history (idempotent upsert).
259
262
 
@@ -263,6 +266,7 @@ class ConversationService:
263
266
  Args:
264
267
  conversation_id: Conversation ID (will be created if doesn't exist)
265
268
  request: History upsert request with messages
269
+ headers: Optional additional HTTP headers (e.g., X-CodeMie-Client)
266
270
 
267
271
  Returns:
268
272
  Upsert response with metadata about operation
@@ -271,6 +275,7 @@ class ConversationService:
271
275
  f"/v1/conversations/{conversation_id}/history",
272
276
  UpsertHistoryResponse,
273
277
  json_data=request.model_dump(mode="json", exclude_none=True),
278
+ extra_headers=headers,
274
279
  )
275
280
 
276
281
  def delete_history(self, conversation_id: str) -> ConversationDetails:
@@ -11,6 +11,7 @@ from ..models.integration import (
11
11
  Integration,
12
12
  IntegrationType,
13
13
  IntegrationTestRequest,
14
+ PaginatedIntegrationResponse,
14
15
  TransferSettingsResponse,
15
16
  TypeOfIntegration,
16
17
  )
@@ -93,6 +94,50 @@ class IntegrationService:
93
94
  self._get_base_path(setting_type), list[Integration], params=params
94
95
  )
95
96
 
97
+ def list_combined(
98
+ self,
99
+ scope: str | None = "all",
100
+ page: int = 0,
101
+ per_page: int = 10,
102
+ filters: dict[str, Any] | str | None = None,
103
+ ) -> PaginatedIntegrationResponse:
104
+ """Get one page of integrations across scopes, newest first.
105
+
106
+ Calls ``GET /v1/settings``. Unlike ``list``, the response keeps its
107
+ pagination block, and ``scope``, ``page`` and ``per_page`` are sent as
108
+ given, without client-side checks, so out-of-range values reach the API.
109
+
110
+ Args:
111
+ scope: ``"all"`` (user and project integrations together), ``"user"``
112
+ or ``"project"``. ``None`` omits the parameter, which the API
113
+ treats as ``"all"``. Any other string is sent unchanged.
114
+ page: Zero-based page number
115
+ per_page: Number of items per page
116
+ filters: Filters to apply, as a dict (sent as JSON) or as a raw
117
+ string sent unchanged
118
+
119
+ Returns:
120
+ The integrations of the page and the pagination of the whole result
121
+
122
+ Raises:
123
+ requests.exceptions.HTTPError: On 422 (unknown scope, page or
124
+ per_page out of range, malformed ``filters``).
125
+ """
126
+ params: dict[str, Any] = {"page": page, "per_page": per_page}
127
+ if scope is not None:
128
+ params["scope"] = scope
129
+ if filters is not None:
130
+ params["filters"] = (
131
+ filters if isinstance(filters, str) else json.dumps(filters)
132
+ )
133
+
134
+ return self._api.get(
135
+ "/v1/settings",
136
+ PaginatedIntegrationResponse,
137
+ params=params,
138
+ wrap_response=False,
139
+ )
140
+
96
141
  def get(
97
142
  self, integration_id: str, setting_type: IntegrationType = IntegrationType.USER
98
143
  ) -> Integration:
@@ -19,13 +19,22 @@ class LLMService:
19
19
  """
20
20
  self._api = ApiRequestHandler(api_domain, token, verify_ssl)
21
21
 
22
- def list(self) -> list[LLMModel]:
22
+ def list(self, include_all: bool = False) -> list[LLMModel]:
23
23
  """Get list of available LLM models.
24
24
 
25
+ Args:
26
+ include_all: Whether to include all models, not only the default set.
27
+ Sent as the ``include_all`` query parameter. Default: False
28
+
25
29
  Returns:
26
30
  List of LLM models
27
31
  """
28
- return self._api.get("/v1/llm_models", list[LLMModel], wrap_response=False)
32
+ return self._api.get(
33
+ "/v1/llm_models",
34
+ list[LLMModel],
35
+ params={"include_all": "true"} if include_all else None,
36
+ wrap_response=False,
37
+ )
29
38
 
30
39
  def list_embeddings(self) -> list[LLMModel]:
31
40
  """Get list of available embeddings models.
@@ -193,6 +193,7 @@ class WorkflowService:
193
193
  headers: dict[str, str] | None = None,
194
194
  tags: list[str] | None = None,
195
195
  file_names: list[str] | None = None,
196
+ attributes: dict[str, str] | None = None,
196
197
  ) -> dict:
197
198
  """Run a workflow with optional input parameters.
198
199
 
@@ -205,6 +206,7 @@ class WorkflowService:
205
206
  headers: Optional additional HTTP headers (e.g., X-* for MCP propagation)
206
207
  tags: Optional tags to attach to the workflow execution trace in Langfuse.
207
208
  file_names: Optional list of file references provided as inputs to the run.
209
+ attributes: Optional analytics labels (string keys and values) fixed for this execution.
208
210
 
209
211
  Returns:
210
212
  dict: Created workflow execution details
@@ -217,6 +219,7 @@ class WorkflowService:
217
219
  propagate_headers=propagate_headers,
218
220
  headers=headers,
219
221
  tags=tags,
222
+ attributes=attributes,
220
223
  )
221
224
 
222
225
  def evaluate(self, workflow_id: str, request: WorkflowEvaluationRequest) -> dict:
@@ -56,6 +56,7 @@ class WorkflowExecutionService:
56
56
  headers: dict[str, str] | None = None,
57
57
  tags: list[str] | None = None,
58
58
  file_names: list[str] | None = None,
59
+ attributes: dict[str, str] | None = None,
59
60
  ) -> dict:
60
61
  """Create a new workflow execution.
61
62
 
@@ -68,6 +69,7 @@ class WorkflowExecutionService:
68
69
  headers: Optional additional HTTP headers (e.g., X-* for MCP propagation)
69
70
  tags: Optional tags to attach to the workflow execution trace in Langfuse.
70
71
  file_names: Optional list of file references provided as inputs to the run.
72
+ attributes: Optional analytics labels (string keys and values) fixed for this execution.
71
73
 
72
74
  Returns:
73
75
  dict: Created workflow execution details
@@ -80,11 +82,12 @@ class WorkflowExecutionService:
80
82
  session_id=session_id,
81
83
  propagate_headers=propagate_headers,
82
84
  tags=tags,
85
+ attributes=attributes,
83
86
  )
84
87
  return self._api.post(
85
88
  f"/v1/workflows/{self._workflow_id}/executions",
86
89
  dict,
87
- json_data=payload.model_dump(),
90
+ json_data=payload.model_dump(exclude_none=True),
88
91
  extra_headers=headers,
89
92
  )
90
93
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codemie-sdk-python
3
- Version: 0.1.717
3
+ Version: 0.1.719
4
4
  Summary: CodeMie SDK for Python
5
5
  License: Apache-2.0
6
6
  Author: CodeMie
@@ -123,6 +123,9 @@ Each LLM model contains:
123
123
  # List available LLM models
124
124
  llm_models = client.llms.list()
125
125
 
126
+ # Include all models, not only the default set
127
+ all_llm_models = client.llms.list(include_all=True)
128
+
126
129
  # List available embedding models
127
130
  embedding_models = client.llms.list_embeddings()
128
131
  ```
@@ -280,6 +283,10 @@ prebuilt_assistant = client.assistants.get_prebuilt_by_slug("assistant-slug")
280
283
  tools = client.assistants.get_tools()
281
284
  ```
282
285
 
286
+ #### Disabled Context Tools
287
+
288
+ `disabled_context_tools` (list of default datasource tool names opted out, e.g. `["search_kb"]`) is available on assistant create/update requests and on `Assistant` / `AssistantVersion` responses (defaults to `[]`). Omit it on update to leave the current value unchanged; pass `[]` to clear it.
289
+
283
290
  #### Prompt Variables Support
284
291
 
285
292
  The SDK supports assistant-level prompt variables that the backend already exposes via the `prompt_variables` field.
@@ -1,4 +1,4 @@
1
- codemie_sdk/__init__.py,sha256=6pVYSyZhWb6AwFFLxQOGEKj7fDhIpDqopTjoRA1gt_Y,12712
1
+ codemie_sdk/__init__.py,sha256=H9AqA2NmHq0_OTSSY3E23gR8j7VDLaxXs3ZSx3MlcfY,12984
2
2
  codemie_sdk/auth/__init__.py,sha256=IksEj223xEZtJ-cQ0AT9L0Bs9psIJ8QNzDXrPTUQ3xQ,126
3
3
  codemie_sdk/auth/credentials.py,sha256=hO0X3EQWZSlIm0ABhiJo4fIIndm2blB0JZWMaWvsuTE,7774
4
4
  codemie_sdk/builders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -12,20 +12,20 @@ codemie_sdk/exceptions.py,sha256=uuzvtvYBMzrNGt7Q4k5RVq0Pd8eJ_tR2tLy3pF2ICDs,114
12
12
  codemie_sdk/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  codemie_sdk/models/a2a.py,sha256=93GGBg4vkrlnuGCtakMLgYtrD9U54Dme9Dm5sJGO2bc,1986
14
14
  codemie_sdk/models/activity_event.py,sha256=KDEzzUEfs1J9ALNo4mLP-Rq7jeTM4g-P4A5A7Z4YjzM,1072
15
- codemie_sdk/models/admin.py,sha256=2UGaO60ZrHHcDcV9thYBVxDyUCvtfPQhs10WswhGFJs,2298
16
- codemie_sdk/models/analytics.py,sha256=Iy9rF9ZzjhdTAMv7n0DvGF6cIjCgRd5jkqFdfswP38Q,10485
17
- codemie_sdk/models/assistant.py,sha256=qrimRnDahHCqBK_iAWfx37s5X2r4oJL4Wragd1rmTZU,31306
15
+ codemie_sdk/models/admin.py,sha256=XG6TlJ88aycnP7UsIl4p9SVop5PbEl1uL3bZtVuw7g8,4981
16
+ codemie_sdk/models/analytics.py,sha256=zL_rcewHwFQQK38rgDXDgcKfLGd9NuDfHMzszv1H_Ts,13101
17
+ codemie_sdk/models/assistant.py,sha256=7B4CdzK8A2sp6P78iuWuvXR2wzBi1mo2e4bqAY4FCW0,32163
18
18
  codemie_sdk/models/categories.py,sha256=eq7_sw-sevNLeWpjaW3N055Xcgbbevs0Bl_rj--maUk,2303
19
19
  codemie_sdk/models/common.py,sha256=ipNNdQlv4Ct1UyIAknjJbrdjjvv0lZJYK6dnPm8wai4,1170
20
- codemie_sdk/models/conversation.py,sha256=jWqpOdgLeD9FTO1inGt-ARe37idukZmlOb-ZEK3mB6w,10276
20
+ codemie_sdk/models/conversation.py,sha256=iuLrwU7idJ_VrMB_xUzoJA7LktsVVHEKzKEWVNs_cz8,10321
21
21
  codemie_sdk/models/cost_center.py,sha256=qny13YLZGFkHfL_vzO85MMKBda-9Z_MwNxZNfMYl7dQ,2629
22
22
  codemie_sdk/models/datasource.py,sha256=jp1Rbx1f0cvgUierU-3ru0xfq7NEpjaB_NBpp7VfCOk,31711
23
23
  codemie_sdk/models/errors.py,sha256=tQXoPUhM2U95NoyTxsSSJws8PQ-Fr3iOQQ8IjJCsx78,11658
24
24
  codemie_sdk/models/file_operation.py,sha256=h5UBCCAbQQGm1EavF0AHn_dNE2t_Cc9be20lv_K5Vo8,722
25
25
  codemie_sdk/models/guardrails.py,sha256=813PRnu9VEF6hoUB-lw5xG_qAZXPic38qL40AwYkSMQ,2114
26
26
  codemie_sdk/models/hosted_application.py,sha256=zf-NfhbRp1jnnPjtMkzkaoOG08MTNPlewAhHC9r-Fhs,8241
27
- codemie_sdk/models/integration.py,sha256=D-SLsLzel0kKj4grUPM6XXu3TtKWjjD8rKttH4gVuYg,3557
28
- codemie_sdk/models/llm.py,sha256=I8yFxmTFAJnfui8GfaJmD1nbUD9b5i9xJAUcbh1Sjj0,1642
27
+ codemie_sdk/models/integration.py,sha256=9drr2veHPbJ7-op6Mya4lFwKBY1AX6HfwgEA8jucTHE,4039
28
+ codemie_sdk/models/llm.py,sha256=K6E8zUEMekc5NxIoQUpTDMfKgYzt1Hb0okOnKubOo_M,2288
29
29
  codemie_sdk/models/marketplace_management.py,sha256=T51fSW0G8RGyBxMBnT_o5D8E00UQaW_Fcq1nw-RGlZY,6396
30
30
  codemie_sdk/models/mcp_config.py,sha256=lqHEYNWW6MhZEx2tMTryVTfq_wThnmMS7vmWxtPkbYM,3792
31
31
  codemie_sdk/models/mermaid.py,sha256=dhRgX-itvfyrt0LUg5pbSo0CTH5PewiegqcZn3hWggU,675
@@ -40,21 +40,21 @@ codemie_sdk/models/vendor_guardrail.py,sha256=dQtuFZXFUs_IUQlnPQth0Sd49Sx9gfDtkA
40
40
  codemie_sdk/models/vendor_knowledgebase.py,sha256=fDj526KDJocx1Tn_B0uP3UQ5e89RMvesExFPwyeqME0,4996
41
41
  codemie_sdk/models/vendor_runtime.py,sha256=CCFmBOV6vHgRvoD_5gRofqG41Wyxtdfy8DHcWkZ3Z5g,6179
42
42
  codemie_sdk/models/vendor_workflow.py,sha256=ysu3anNa2xrSDvZb3zcTZ-_DGXcvJSUcmYIllDYceBo,4926
43
- codemie_sdk/models/workflow.py,sha256=hPdPDX7qyeEjHKXtJDHBvYb-CB4heFqJyDxkZ-V0cXg,7566
44
- codemie_sdk/models/workflow_execution_payload.py,sha256=0nhbiXyZlvbhB2SB6B_T6s2bOKruEVDlQsGan1Siw5U,1224
43
+ codemie_sdk/models/workflow.py,sha256=fg1R878bEd-6qRXvc64TH53pgPCGadUKm9v4l4I3TAQ,7611
44
+ codemie_sdk/models/workflow_execution_payload.py,sha256=q1EClVgMYTiv4KhHaqQfn-4gVf04wWCAYcj863KUmcU,1381
45
45
  codemie_sdk/models/workflow_state.py,sha256=uP1yLYwPpgPc17xpLwjanvlRzK6zT9qMZR-fAkvwFGg,1322
46
46
  codemie_sdk/models/workflow_thoughts.py,sha256=9fE380lMvC23fq677EI_JTk48Nf2jyPg3-mpj9VTx54,579
47
47
  codemie_sdk/models/workflow_transition.py,sha256=axZeiwTo4wzEwZ5GuKphmlRpWmjIuKxV15P_4V1n7LQ,794
48
48
  codemie_sdk/models/workspace.py,sha256=xYnVO1Pnd0l0PSBe2pwP80C2ZvYBc2ESo6OH_G0cOOg,1438
49
49
  codemie_sdk/services/a2a.py,sha256=vxMistimImheSRWWqOP0hy7aiQnv0NjoQnkUchtm73c,1031
50
50
  codemie_sdk/services/activity_event.py,sha256=KoD0DyeqJ0CmQPA4PAXH4uGIAQCgcJbYwDnv-MCckGc,3630
51
- codemie_sdk/services/admin.py,sha256=yk1xdBXDjpdW4OMOdBaURkZhAxak9h-TppKyhStLekc,4006
52
- codemie_sdk/services/analytics.py,sha256=L7-jFUX4z9TQv6Y3Dq3Z89mqpcXpwcZGFP9Ypnyk8hQ,26272
53
- codemie_sdk/services/assistant.py,sha256=Bg1vfsEy_Z3h6339qUgpEJDDmiuhbHp17zZNAdDChbU,37205
51
+ codemie_sdk/services/admin.py,sha256=2pAe6Mud_6DsVCWLiL6inGJ0nS27Er0KneC1Bnr1Zck,7114
52
+ codemie_sdk/services/analytics.py,sha256=8Bi1xv21XDnbypfFwOWkYnRfEoEy5DVNhHBPfjaQ3lU,29305
53
+ codemie_sdk/services/assistant.py,sha256=kBzHfSFC-QbyRWiWE0J9kIL0KuFyWVVCRgUOs0hlkQA,37404
54
54
  codemie_sdk/services/budgets.py,sha256=gEZCxDxoo68U6_DRxLZ0ZUxAKCsSJSsP3kkTQA55X9I,2159
55
55
  codemie_sdk/services/categories.py,sha256=1qd98JCcMNdpbos0O1WpMApT6TurE7OuI7zoYewnwk8,5030
56
56
  codemie_sdk/services/codemie_guardrails.py,sha256=O3yCeIQYG8W7z-sVRR4Cw9UVncqP9lPVNxUSaUZrh7I,2833
57
- codemie_sdk/services/conversation.py,sha256=HWedtlrVXvq4xyAgVNzJ9IZSeHMx4Se5fyp8PPIloEQ,14809
57
+ codemie_sdk/services/conversation.py,sha256=RGgefAlx78p-JvSPmLQQkmnNs0zeuFOjERXOAuC1hlI,14987
58
58
  codemie_sdk/services/cost_center.py,sha256=YewsrVyzIW9N68CaKgM58DB5reMBJQHljyNRxYeTRxM,4036
59
59
  codemie_sdk/services/customer_config_service.py,sha256=XxPjiR9cf5M8qjHuRfovwiEAEk7OERJHLTuCAfBr7BU,4871
60
60
  codemie_sdk/services/datasource.py,sha256=4Glf8pyytMM0kZi41FBIjY_DVCa9brrVMIBAGtU230c,17314
@@ -62,8 +62,8 @@ codemie_sdk/services/dynamic_config.py,sha256=amgSOZ-835r6O_U72sjiFe60rrxJZqJ2L7
62
62
  codemie_sdk/services/export.py,sha256=JFkci7R33hamwJ2rqCGDe6aRGIPKmW7QuZHdJDXp54g,2259
63
63
  codemie_sdk/services/files.py,sha256=ERb6irexO2hIKepUiTw498J0dt0427YNdKrXdcOu9tM,2762
64
64
  codemie_sdk/services/hosted_application.py,sha256=r1VstJmhoqOmx1HsiIrRuefVNzfYwVZxm8Ueqa8RnSs,21001
65
- codemie_sdk/services/integration.py,sha256=n4ggDedJ2GCI5mTgZNfrYE49uzLsp_BKYKMdTBKRX2s,9944
66
- codemie_sdk/services/llm.py,sha256=GQWIi359f99uU4YRnAdpbyae1kXp1G5OpVgJNIIn7-8,1132
65
+ codemie_sdk/services/integration.py,sha256=gwkbH2gPoyRAXJSr2LLeKi2nqlFwJ0NAzwVx7uqKlvk,11678
66
+ codemie_sdk/services/llm.py,sha256=R03Q_JCF-IDTsV7gkjtFo6d_FkKMS6gBnYU2LdnYt_0,1448
67
67
  codemie_sdk/services/marketplace_management.py,sha256=89JEPEg7tdwlFJ1LfKQJRJp4oug_nxMGBIjCf1S4H6U,7991
68
68
  codemie_sdk/services/mcp_configs.py,sha256=bfe0QTrMqE5hEvyUlNMCjTxqL7u0AG7aZloQrtpDml0,3985
69
69
  codemie_sdk/services/mermaid.py,sha256=7cLykdrJVW576raUbON3yhuWnbGaXl8rX1QfVwbu2JE,2246
@@ -80,13 +80,13 @@ codemie_sdk/services/vendor_knowledgebase.py,sha256=p0SWNdBg-zXfaco0edbBUQbp7wgq
80
80
  codemie_sdk/services/vendor_runtime.py,sha256=DxBVyF2cB02u9kM7uESALF4nPdC__wA7V4tCFzRiQGM,7092
81
81
  codemie_sdk/services/vendor_workflow.py,sha256=EJZK0mLhmZ47UZSkxUzELWhVFalJHL3vIrBEQRGG3Zo,12452
82
82
  codemie_sdk/services/webhook.py,sha256=jYPEyJ0Q0IydMF9D2UoURsr6PgdfbKs4fr5L6ix8e94,2531
83
- codemie_sdk/services/workflow.py,sha256=C4GDjF1wUDDh75CpPEo0W_FFvHr8t0KjVonCQ_h0pYU,13269
84
- codemie_sdk/services/workflow_execution.py,sha256=GuI1uBtd1NGvRVHElMsgPBZlIRDP9CK73ISJABkpCs4,7225
83
+ codemie_sdk/services/workflow.py,sha256=uXWao_GwkSu5t0KQagieUKQaQAs_Qwti7c9WveqYKgI,13455
84
+ codemie_sdk/services/workflow_execution.py,sha256=w3TFizoQQWRZJSli7oO_CnqZniTrkkh9INEF3OjF-v8,7428
85
85
  codemie_sdk/services/workflow_execution_state.py,sha256=u1xmGvaHjqvQS5ujhyvJ_Ac7ByjKem2Qe8q0swsmoWw,2045
86
86
  codemie_sdk/services/workspace.py,sha256=eLwZ0fhi1BfOesrXaQlTdOll8q7ENP9b_jb5eybKSVw,5038
87
87
  codemie_sdk/utils/__init__.py,sha256=EzK_UrS5KHmAnE73Hci9LaObB5omjVUhIq4svh0gfwo,137
88
88
  codemie_sdk/utils/http.py,sha256=94PBmIuT646i4B-FHWCZ8YDKybht_glzL1Qnrk0HrRI,16615
89
89
  codemie_sdk/utils/payload.py,sha256=XwIAdPWE3TdetV0bImx1Xkery0Hgm9dU_lAXmf2OSZI,313
90
- codemie_sdk_python-0.1.717.dist-info/METADATA,sha256=kfilcz99S2luoyUXoNt5eZMvMn8Fvhy2mkQ4QDCG73Y,51375
91
- codemie_sdk_python-0.1.717.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
92
- codemie_sdk_python-0.1.717.dist-info/RECORD,,
90
+ codemie_sdk_python-0.1.719.dist-info/METADATA,sha256=_MyZBsU_5bb38ofFBekfcbTP1-nBPjQQHalFQM5ImOQ,51800
91
+ codemie_sdk_python-0.1.719.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
92
+ codemie_sdk_python-0.1.719.dist-info/RECORD,,