Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ client = ContextualAI(
)

create_agent_output = client.agents.create(
name="xxx",
name="Example",
)
print(create_agent_output.id)
```
Expand All @@ -58,7 +58,7 @@ client = AsyncContextualAI(

async def main() -> None:
create_agent_output = await client.agents.create(
name="xxx",
name="Example",
)
print(create_agent_output.id)

Expand Down Expand Up @@ -157,7 +157,7 @@ client = ContextualAI()

try:
client.agents.create(
name="xxx",
name="Example",
)
except contextual.APIConnectionError as e:
print("The server could not be reached")
Expand Down Expand Up @@ -202,7 +202,7 @@ client = ContextualAI(

# Or, configure per-request:
client.with_options(max_retries=5).agents.create(
name="xxx",
name="Example",
)
```

Expand All @@ -227,7 +227,7 @@ client = ContextualAI(

# Override per-request:
client.with_options(timeout=5.0).agents.create(
name="xxx",
name="Example",
)
```

Expand Down Expand Up @@ -270,7 +270,7 @@ from contextual import ContextualAI

client = ContextualAI()
response = client.agents.with_raw_response.create(
name="xxx",
name="Example",
)
print(response.headers.get('X-My-Header'))

Expand All @@ -290,7 +290,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi

```python
with client.agents.with_streaming_response.create(
name="xxx",
name="Example",
) as response:
print(response.headers.get("X-My-Header"))

Expand Down
8 changes: 4 additions & 4 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
with pytest.raises(APITimeoutError):
self.client.post(
"/agents",
body=cast(object, dict(name="xxx")),
body=cast(object, dict(name="Example")),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
Expand All @@ -742,7 +742,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
with pytest.raises(APIStatusError):
self.client.post(
"/agents",
body=cast(object, dict(name="xxx")),
body=cast(object, dict(name="Example")),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
Expand Down Expand Up @@ -1503,7 +1503,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
with pytest.raises(APITimeoutError):
await self.client.post(
"/agents",
body=cast(object, dict(name="xxx")),
body=cast(object, dict(name="Example")),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
Expand All @@ -1518,7 +1518,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
with pytest.raises(APIStatusError):
await self.client.post(
"/agents",
body=cast(object, dict(name="xxx")),
body=cast(object, dict(name="Example")),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
Expand Down