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
21 changes: 21 additions & 0 deletions plugins/abridge/tests/fixtures/anthropic_openai/LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 cc_convert maintainers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
50 changes: 50 additions & 0 deletions plugins/abridge/tests/fixtures/anthropic_openai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Anthropic ↔ OpenAI conversion fixtures

Golden parity fixtures for bidirectional Anthropic Messages ↔ OpenAI
Chat Completions translation, exercised by
`tests/test_anthropic_transform_fixtures.py` against
`agentix.bridge.clients._anthropic_transforms`.

## Origin and license

These files are copied verbatim from the test corpus of
[cc_convert](https://github.com/yitianlian/cc_convert) (a Rust
Anthropic ↔ OpenAI protocol converter), specifically from
`tests/fixtures/` as vendored on this repo's `abridge/gateway-tito`
ref (`sidecars/cc_convert/tests/fixtures/`). Only the fixture data was
copied — no Rust code, no scripts.

cc_convert is dual-licensed **MIT OR Apache-2.0**; we redistribute the
fixtures under the MIT license. The upstream MIT license text is
included alongside this file as [`LICENSE-MIT`](LICENSE-MIT)
(Copyright (c) 2026 cc_convert maintainers).

## Layout

Each subdirectory holds one direction of translation. Files pair up by
the shared `<NN>_<case_name>` suffix:

- `requests/` — Anthropic → OpenAI request translation.
Input `anthropic_<case>.json`, expected output `openai_<case>.json`,
plus `tool_map_<case>.json` recording any sanitized-tool-name
mapping (empty for all cases except `13_long_tool_name`).
- `responses/` — OpenAI → Anthropic response translation.
Input `openai_<case>.json`, expected output `anthropic_<case>.json`,
plus `meta_<case>.json` carrying the `original_model` and the
`tool_map` the reference translator was invoked with.
- `streams/` — OpenAI SSE → Anthropic event-stream translation.
Input `openai_<case>.sse` (Chat Completions chunks), expected output
`anthropic_<case>.jsonl` (one Anthropic stream event per line, in
order).

## Provenance of the goldens

Upstream generated the request goldens with LiteLLM's
`AnthropicAdapter` as the primary parity oracle (cross-referenced
against 1rgs/claude-code-proxy and maxnowack/anthropic-proxy); the
response and stream goldens are hand-curated from the OpenAI Chat
Completions API reference. Some goldens therefore carry LiteLLM
serialization artifacts (explicit `"thinking_blocks": null`,
`"provider_specific_fields": null`, an unconditional empty leading
text block in streams) — the test suite's comparison helpers document
how those are normalized.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"max_tokens": 100,
"messages": [
{
"content": "hello",
"role": "user"
}
],
"model": "gpt-4o-mini"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"max_tokens": 100,
"messages": [
{
"content": "hi",
"role": "user"
}
],
"model": "gpt-4o-mini",
"system": "Be concise."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"max_tokens": 100,
"messages": [
{
"content": "hi",
"role": "user"
}
],
"model": "gpt-4o-mini",
"system": [
{
"cache_control": {
"type": "ephemeral"
},
"text": "rule 1",
"type": "text"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"max_tokens": 100,
"messages": [
{
"content": "hi",
"role": "user"
},
{
"content": "hello!",
"role": "assistant"
},
{
"content": "ok",
"role": "user"
}
],
"model": "gpt-4o-mini"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"max_tokens": 100,
"messages": [
{
"content": [
{
"source": {
"data": "AAAA",
"media_type": "image/png",
"type": "base64"
},
"type": "image"
},
{
"text": "what is this?",
"type": "text"
}
],
"role": "user"
}
],
"model": "gpt-4o-mini"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"max_tokens": 100,
"messages": [
{
"content": [
{
"source": {
"type": "url",
"url": "https://example.com/x.png"
},
"type": "image"
}
],
"role": "user"
}
],
"model": "gpt-4o-mini"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"max_tokens": 100,
"messages": [
{
"content": [
{
"id": "toolu_1",
"input": {
"city": "Paris"
},
"name": "get_weather",
"type": "tool_use"
}
],
"role": "assistant"
}
],
"model": "gpt-4o-mini"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"max_tokens": 100,
"messages": [
{
"content": [
{
"id": "tu_a",
"input": {
"a": 1
},
"name": "f1",
"type": "tool_use"
},
{
"id": "tu_b",
"input": {
"b": 2
},
"name": "f2",
"type": "tool_use"
}
],
"role": "assistant"
}
],
"model": "gpt-4o-mini"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"max_tokens": 100,
"messages": [
{
"content": [
{
"content": "21C",
"tool_use_id": "toolu_1",
"type": "tool_result"
}
],
"role": "user"
}
],
"model": "gpt-4o-mini"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"max_tokens": 100,
"messages": [
{
"content": [
{
"content": "a",
"tool_use_id": "t1",
"type": "tool_result"
},
{
"content": "b",
"tool_use_id": "t2",
"type": "tool_result"
},
{
"content": "c",
"tool_use_id": "t3",
"type": "tool_result"
}
],
"role": "user"
}
],
"model": "gpt-4o-mini"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"max_tokens": 100,
"messages": [
{
"content": [
{
"content": [
{
"text": "see image:",
"type": "text"
},
{
"source": {
"type": "url",
"url": "https://x/y.png"
},
"type": "image"
}
],
"tool_use_id": "t1",
"type": "tool_result"
}
],
"role": "user"
}
],
"model": "gpt-4o-mini"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"max_tokens": 100,
"messages": [
{
"content": "hi",
"role": "user"
}
],
"model": "gpt-4o-mini",
"tools": [
{
"description": "weather lookup",
"input_schema": {
"properties": {
"city": {
"type": "string"
}
},
"required": [
"city"
],
"type": "object"
},
"name": "get_weather"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"max_tokens": 100,
"messages": [
{
"content": "hi",
"role": "user"
}
],
"model": "gpt-4o-mini",
"tools": [
{
"input_schema": {
"type": "object"
},
"name": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"max_tokens": 100,
"messages": [
{
"content": "hi",
"role": "user"
}
],
"model": "gpt-4o-mini",
"tool_choice": {
"type": "any"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"max_tokens": 100,
"messages": [
{
"content": "hi",
"role": "user"
}
],
"model": "gpt-4o-mini",
"tool_choice": {
"name": "f",
"type": "tool"
},
"tools": [
{
"input_schema": {
"type": "object"
},
"name": "f"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"max_tokens": 100,
"messages": [
{
"content": "hi",
"role": "user"
}
],
"metadata": {
"user_id": "u-123"
},
"model": "gpt-4o-mini"
}
Loading
Loading