You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,30 @@
1
1
# Changelog
2
2
3
+
## 0.3.0 (2025-02-26)
4
+
5
+
Full Changelog: [v0.2.0...v0.3.0](https://github.com/ContextualAI/contextual-client-python/compare/v0.2.0...v0.3.0)
6
+
7
+
### Features
8
+
9
+
***api:** update via SDK Studio ([#41](https://github.com/ContextualAI/contextual-client-python/issues/41)) ([4b3ea42](https://github.com/ContextualAI/contextual-client-python/commit/4b3ea42dd9effb3cec4fb078800ca96dc3609617))
10
+
***api:** update via SDK Studio ([#49](https://github.com/ContextualAI/contextual-client-python/issues/49)) ([d54defd](https://github.com/ContextualAI/contextual-client-python/commit/d54defd3a23a488c24cae38bedd86d5721d8a71b))
11
+
***api:** update via SDK Studio ([#50](https://github.com/ContextualAI/contextual-client-python/issues/50)) ([6060be1](https://github.com/ContextualAI/contextual-client-python/commit/6060be19c881d87e5ab7b63bc60f536a6b9e70cc))
12
+
***client:** allow passing `NotGiven` for body ([#46](https://github.com/ContextualAI/contextual-client-python/issues/46)) ([4e2264d](https://github.com/ContextualAI/contextual-client-python/commit/4e2264da0b35d4dcfbf33a77950f0f7d57f1db14))
13
+
14
+
15
+
### Bug Fixes
16
+
17
+
* asyncify on non-asyncio runtimes ([#44](https://github.com/ContextualAI/contextual-client-python/issues/44)) ([3a16763](https://github.com/ContextualAI/contextual-client-python/commit/3a16763381747ee6ccf829fb535927446634d54c))
18
+
***client:** mark some request bodies as optional ([4e2264d](https://github.com/ContextualAI/contextual-client-python/commit/4e2264da0b35d4dcfbf33a77950f0f7d57f1db14))
19
+
20
+
21
+
### Chores
22
+
23
+
***internal:** codegen related update ([#45](https://github.com/ContextualAI/contextual-client-python/issues/45)) ([2651383](https://github.com/ContextualAI/contextual-client-python/commit/26513832dc75629f229493f4718e97a34588fd97))
Copy file name to clipboardExpand all lines: README.md
+25-7Lines changed: 25 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ client = ContextualAI(
30
30
)
31
31
32
32
create_agent_output = client.agents.create(
33
-
name="xxx",
33
+
name="Example",
34
34
)
35
35
print(create_agent_output.id)
36
36
```
@@ -56,7 +56,7 @@ client = AsyncContextualAI(
56
56
57
57
asyncdefmain() -> None:
58
58
create_agent_output =await client.agents.create(
59
-
name="xxx",
59
+
name="Example",
60
60
)
61
61
print(create_agent_output.id)
62
62
@@ -138,6 +138,24 @@ for agent in first_page.agents:
138
138
# Remove `await` for non-async usage.
139
139
```
140
140
141
+
## File uploads
142
+
143
+
Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.
158
+
141
159
## Handling errors
142
160
143
161
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `contextual.APIConnectionError` is raised.
@@ -155,7 +173,7 @@ client = ContextualAI()
155
173
156
174
try:
157
175
client.agents.create(
158
-
name="xxx",
176
+
name="Example",
159
177
)
160
178
except contextual.APIConnectionError as e:
161
179
print("The server could not be reached")
@@ -200,7 +218,7 @@ client = ContextualAI(
200
218
201
219
# Or, configure per-request:
202
220
client.with_options(max_retries=5).agents.create(
203
-
name="xxx",
221
+
name="Example",
204
222
)
205
223
```
206
224
@@ -225,7 +243,7 @@ client = ContextualAI(
225
243
226
244
# Override per-request:
227
245
client.with_options(timeout=5.0).agents.create(
228
-
name="xxx",
246
+
name="Example",
229
247
)
230
248
```
231
249
@@ -268,7 +286,7 @@ from contextual import ContextualAI
0 commit comments