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
13 changes: 13 additions & 0 deletions tests/unit/test_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,19 @@ async def test_message_returns_typed(self, mock_rest: Any) -> None:
assert result.id == "msg-1"
assert mock.last.url.endswith("/api/v1/messages")

async def test_message_serializes_container(self, mock_rest: Any) -> None:
mock = mock_rest(status=200, body=MESSAGE_RESPONSE)
client = AsyncOtariClient(api_base="http://localhost:8000", api_key="vk")

await client.message(
model="anthropic:claude-5-sonnet",
messages=[{"role": "user", "content": "Hi"}],
max_tokens=8,
container="container_123",
)

assert mock.last.json_body["container"] == "container_123"

async def test_message_with_response_metadata_exposes_request_id(self, mock_rest: Any) -> None:
mock_rest(
status=200,
Expand Down
13 changes: 13 additions & 0 deletions tests/unit/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,19 @@ def test_returns_typed_message_response(self, mock_rest: Any) -> None:
assert body["max_tokens"] == 64
assert body["model"] == "anthropic:claude-3-5-sonnet"

def test_serializes_container(self, mock_rest: Any) -> None:
mock = mock_rest(status=200, body=MESSAGE_RESPONSE)
client = OtariClient(api_base="http://localhost:8000", api_key="vk")

client.message(
model="anthropic:claude-5-sonnet",
messages=[{"role": "user", "content": "Hi"}],
max_tokens=64,
container="container_123",
)

assert mock.last.json_body["container"] == "container_123"

def test_with_response_metadata_exposes_request_id(self, mock_rest: Any) -> None:
mock_rest(
status=200,
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading