codai-sdk 0.7.0__tar.gz → 0.12.0__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 (43) hide show
  1. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/CHANGELOG.md +77 -0
  2. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/PKG-INFO +1 -1
  3. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/pyproject.toml +1 -1
  4. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/__init__.py +10 -1
  5. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/_operations.py +15 -1
  6. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/_types.py +385 -7
  7. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/resources/__init__.py +8 -0
  8. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/resources/core.py +127 -7
  9. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/resources/platform.py +4 -0
  10. codai_sdk-0.12.0/src/codai/resources/prompts.py +51 -0
  11. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/resources/sessions.py +32 -4
  12. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/tests/test_resources.py +169 -1
  13. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  14. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  15. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/.github/dependabot.yml +0 -0
  16. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/.github/pull_request_template.md +0 -0
  17. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/.github/workflows/publish.yml +0 -0
  18. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/.gitignore +0 -0
  19. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/CODE_OF_CONDUCT.md +0 -0
  20. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/CONTRIBUTING.md +0 -0
  21. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/LICENSE +0 -0
  22. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/README.md +0 -0
  23. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/SECURITY.md +0 -0
  24. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/examples/agent.py +0 -0
  25. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/examples/chat.py +0 -0
  26. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/examples/feedback.py +0 -0
  27. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/examples/streaming.py +0 -0
  28. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/scripts/gen-types.py +0 -0
  29. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/scripts/smoke_local.py +0 -0
  30. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/_http.py +0 -0
  31. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/_resolve_types.py +0 -0
  32. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/resources/_base.py +0 -0
  33. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/resources/agents.py +0 -0
  34. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/resources/chat.py +0 -0
  35. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/resources/environments.py +0 -0
  36. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/resources/messages.py +0 -0
  37. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/resources/resolve.py +0 -0
  38. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/resources/responses.py +0 -0
  39. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/src/codai/resources/triggers.py +0 -0
  40. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/tests/conftest.py +0 -0
  41. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/tests/test_http.py +0 -0
  42. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/tests/test_parity.py +0 -0
  43. {codai_sdk-0.7.0 → codai_sdk-0.12.0}/tests/test_resolve.py +0 -0
@@ -6,6 +6,83 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.12.0] - 2026-10-05
10
+
11
+ ### Added
12
+
13
+ - `client.audio.speech_stream(body)` → `POST /v1/audio/speech/stream` (`codai-tts-ro`, Azure neural TTS with
14
+ visemes): generator of `{"type": "start"|"audio"|"viseme"|"word"|"done"|"error", ...}`; `audio` events carry the
15
+ decoded `audio_bytes`. `createSpeechStream` in the parity table.
16
+ - `client.system_one.batch(items, questions, timeout_ms=None, fallback=None)` — the same questions about up to 16
17
+ states in one call; `system_one.create` documents the new `items`, `timeout_ms` and `fallback` fields and the
18
+ `fallback_used` response flag.
19
+ - Ephemeral token scope `live` (realtime + audio) accepted by `tokens.create`.
20
+ - `_types.py` regenerated (`SpeechStreamRequest`, `SpeechStreamEvent`, batch fields on `SystemOneRequest` /
21
+ `SystemOneResponse`).
22
+
23
+ ### Not included
24
+
25
+ - No realtime (WebSocket) helper: the SDK is zero-dependency and the standard library has no WebSocket client, and
26
+ `/v1/realtime` is outside the OpenAPI parity contract. Use `tokens.create("live")` and any WebSocket client against
27
+ `wss://ai.codai.ro/v1/realtime?model=codai-transcribe-live&language=ro&key=<token>` (protocol in the docs,
28
+ gateway → Embeddings, audio & realtime).
29
+
30
+ ## [0.11.0] - 2026-10-02
31
+
32
+ ### Added
33
+
34
+ - `client.devices.revoke_self_key()` — `POST /v1/keys/self/revoke`: the calling API key revokes itself (sign out).
35
+
36
+ ## [0.10.0] - 2026-09-29
37
+
38
+ ### Added
39
+
40
+ - `client.prompts.{list, create, get, update, delete, launch}` — pending prompts (`/v1/prompts/*`):
41
+ ready-to-paste prompts left for a future chat, with `goal_key` supersede, `not_before` reminders
42
+ (`prompt.due` notifications) and `launch` into a new session on a device. `launch` is never retried.
43
+ `_types.py` regenerated (`Prompt`, `PromptCreate`, `PromptPatch`, `PromptCreated`, …).
44
+
45
+ ## [0.9.0] - 2026-09-29
46
+
47
+ ### Added
48
+
49
+ - `client.sessions.dispatch(session_id, *, device_id=..., text=..., mode="send"|"open", turn_id=..., control_id=...)`
50
+ keyword form. `mode="open"` hands the session off — the target only opens it (no user turn), and
51
+ `text`/`turn_id` are dropped. The positional `body` dict still works (keywords override its keys); a
52
+ `send` without `text` now raises `ValueError` client-side instead of a server `400`.
53
+ - Regenerated `src/codai/_types.py`: `SessionDispatchRequest.mode` (`text` now optional),
54
+ `SessionDispatchResponse.mode`, `SessionControl.mode` (`'open'` on handoff controls) and
55
+ `DeviceListItem.online` (seen in the last 2 minutes).
56
+ - `client.images.edit({"prompt": ..., "image": {"b64_json": ..., "mime_type": ...} | [...]})` →
57
+ `POST /v1/images/edits` (JSON body, 1–14 input images; `mask` unsupported). `editImage` in the
58
+ parity table; `EditImageBody` / `CoreImageEditRequest` types.
59
+ - `ImagesResult.mime_types` and `ImagesResult.data_region` (`x-codai-data-region`, `eu` | `global`).
60
+ - `generate()` types gain `reference_images`, `aspect_ratio`, `image_size` and the
61
+ `codai-image-fast` / `codai-image-pro` model ids.
62
+
63
+ ### Changed
64
+
65
+ - `codai-image` is now `gemini-3.1-flash-image` on the Vertex EU endpoint (2.5 is shut down on
66
+ 2026-10-02 and served as `codai-image`). `cost_micro_usd` is usage-based (≈ $0.074 per default
67
+ 1K image) instead of a flat $0.04. The image request floor timeout is 150 s.
68
+
69
+ ## [0.8.0] - 2026-09-29
70
+
71
+ ### Added
72
+
73
+ - `client.images.generate({"prompt": ..., "n"?, "size"?, "negative_prompt"?, "model"?})` →
74
+ `POST /v1/images/generations` (base64 only). Backed by `gemini-2.5-flash-image`; `model`
75
+ defaults to `codai-image` (`imagen-4` / `imagen-4-fast` are legacy aliases). Flat $0.04 per
76
+ returned image, reported as `cost_micro_usd`.
77
+ - EXPERIMENTAL, unaudited (HIDE protocol) agent-output signatures — provenance only, never
78
+ authentication:
79
+ - `EnvironmentTask.output_signature: Optional[EnvironmentTaskOutputSignature]` plus the
80
+ `AgentOutputKey` / `AgentOutputVerifyRequest` / `AgentOutputVerifyResult` types
81
+ (regenerated `src/codai/_types.py`).
82
+ - `client.verify.agent_output_key()` → `GET /v1/verify/agent-output/key` and
83
+ `client.verify.agent_output(payload, signature)` → `POST /v1/verify/agent-output`
84
+ (public; never retried, 503 `signing_disabled` when signing is off).
85
+
9
86
  ## [0.7.0] - 2026-09-27
10
87
 
11
88
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: codai-sdk
3
- Version: 0.7.0
3
+ Version: 0.12.0
4
4
  Summary: Official Python SDK for the codai AI gateway — chat, messages, responses, streaming, agents, sessions, hosts, tasks, account.
5
5
  Project-URL: Homepage, https://codai.ro
6
6
  Project-URL: Repository, https://github.com/codai-ro/codai-sdk-python
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "codai-sdk"
7
- version = "0.7.0"
7
+ version = "0.12.0"
8
8
  description = "Official Python SDK for the codai AI gateway — chat, messages, responses, streaming, agents, sessions, hosts, tasks, account."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -50,12 +50,15 @@ from .resources import (
50
50
  Feedback,
51
51
  Health,
52
52
  Hosts,
53
+ Images,
54
+ ImagesResult,
53
55
  Messages,
54
56
  Models,
55
57
  Notifications,
56
58
  Orgs,
57
59
  PhoneModels,
58
60
  Projects,
61
+ Prompts,
59
62
  Receipts,
60
63
  Resolve,
61
64
  ResolveError,
@@ -67,6 +70,7 @@ from .resources import (
67
70
  Tokens,
68
71
  Tools,
69
72
  Triggers,
73
+ Verify,
70
74
  attestation_statement,
71
75
  verify_attestation_with_keys,
72
76
  verify_resolve_webhook,
@@ -80,6 +84,7 @@ __all__ = [
80
84
  "AgentRunResult",
81
85
  "EphemeralToken",
82
86
  "HttpClient",
87
+ "ImagesResult",
83
88
  "RequestExtensions",
84
89
  "SseFrame",
85
90
  "OPERATION_METHODS",
@@ -96,7 +101,7 @@ __all__ = [
96
101
  "verify_attestation_with_keys",
97
102
  "verify_resolve_webhook",
98
103
  ]
99
- __version__ = "0.7.0"
104
+ __version__ = "0.12.0"
100
105
 
101
106
 
102
107
  class _CallableGroup:
@@ -155,6 +160,7 @@ class Codai:
155
160
 
156
161
  self.messages = Messages(http)
157
162
  self.responses = Responses(http)
163
+ self.images = Images(http)
158
164
  self.audio = Audio(http)
159
165
  self.system_one = SystemOne(http)
160
166
  self.tokens = Tokens(http)
@@ -168,11 +174,14 @@ class Codai:
168
174
  self.orgs = Orgs(http)
169
175
  self.projects = Projects(http)
170
176
  self.environments = Environments(http)
177
+ # EXPERIMENTAL (HIDE, unaudited): verify signed agent outputs — provenance only.
178
+ self.verify = Verify(http)
171
179
  self.account = Account(http)
172
180
  self.receipt = Receipts(http)
173
181
  self.phone_models = PhoneModels(http)
174
182
  self.triggers = Triggers(http)
175
183
  self.notifications = Notifications(http)
184
+ self.prompts = Prompts(http)
176
185
  # codai Resolve lives on its own host; same key, no X-Codai-* defaults.
177
186
  self.resolve = Resolve(
178
187
  HttpClient(
@@ -16,9 +16,12 @@ OPERATION_METHODS: Dict[str, str] = {
16
16
  "createMessage": "messages.create",
17
17
  # Embeddings & Audio
18
18
  "createEmbeddings": "embeddings.create",
19
+ "createImage": "images.generate",
20
+ "editImage": "images.edit",
19
21
  "createSystemOne": "system_one.create",
20
22
  "createTranscription": "audio.transcribe",
21
23
  "createSpeech": "audio.speech",
24
+ "createSpeechStream": "audio.speech_stream",
22
25
  "createEphemeralToken": "tokens.create",
23
26
  # Models
24
27
  "listModels": "models.list",
@@ -64,6 +67,7 @@ OPERATION_METHODS: Dict[str, str] = {
64
67
  "listDevices": "devices.list",
65
68
  "updateDevice": "devices.update",
66
69
  "deleteDevice": "devices.delete",
70
+ "revokeSelfKey": "devices.revoke_self_key",
67
71
  # Hosts
68
72
  "listHosts": "hosts.list",
69
73
  "streamHost": "hosts.stream",
@@ -112,6 +116,8 @@ OPERATION_METHODS: Dict[str, str] = {
112
116
  "listEnvironmentTasks": "environments.tasks.list",
113
117
  "createEnvironmentTask": "environments.tasks.create",
114
118
  "getEnvironmentTask": "environments.tasks.get",
119
+ "getAgentOutputKey": "verify.agent_output_key",
120
+ "verifyAgentOutput": "verify.agent_output",
115
121
  "listTriggers": "triggers.list",
116
122
  "createTrigger": "triggers.create",
117
123
  "updateTrigger": "triggers.update",
@@ -125,6 +131,12 @@ OPERATION_METHODS: Dict[str, str] = {
125
131
  "markNotificationsRead": "notifications.mark_read",
126
132
  "deleteNotification": "notifications.delete",
127
133
  "deleteNotifications": "notifications.delete_many",
134
+ "listPrompts": "prompts.list",
135
+ "createPrompt": "prompts.create",
136
+ "getPrompt": "prompts.get",
137
+ "updatePrompt": "prompts.update",
138
+ "deletePrompt": "prompts.delete",
139
+ "launchPrompt": "prompts.launch",
128
140
  # Account
129
141
  "getAccount": "account.get",
130
142
  "patchAccount": "account.update",
@@ -134,7 +146,9 @@ OPERATION_METHODS: Dict[str, str] = {
134
146
  }
135
147
 
136
148
  # Operations whose SDK method is a generator (SSE-only endpoints).
137
- STREAMING_OPERATIONS: FrozenSet[str] = frozenset({"streamAgentRun", "streamSession", "streamHost"})
149
+ STREAMING_OPERATIONS: FrozenSet[str] = frozenset(
150
+ {"streamAgentRun", "streamSession", "streamHost", "createSpeechStream"}
151
+ )
138
152
 
139
153
  # codai Resolve (``apps/docs/openapi/en/resolve.yaml``) → ``client.resolve.*``.
140
154
  RESOLVE_OPERATION_METHODS: Dict[str, str] = {