Skip to content
Open
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
2 changes: 0 additions & 2 deletions src/upstream/translator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ export function openaiToAnthropic(body: any): any {
format: {
type: "json_schema",
schema: fmt.json_schema.schema,
name: fmt.json_schema.name,
},
};
} else if (fmt.type === "json_object") {
Expand Down Expand Up @@ -580,7 +579,6 @@ export function responsesToAnthropic(body: any): any {
format: {
type: "json_schema",
schema: fmt.schema,
name: fmt.name,
},
};
} else if (fmt.type === "json_object") {
Expand Down
6 changes: 5 additions & 1 deletion tests/unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,11 @@ test("openaiToAnthropic translates response_format json_schema", () => {
},
});
assert.equal(result.output_config.format.type, "json_schema");
assert.equal(result.output_config.format.name, "test");
// Anthropic's Messages API rejects an extra `name` field here with
// "Extra inputs are not permitted" (verified against the live API) --
// unlike OpenAI's json_schema format, Anthropic's output_config.format
// only accepts { type, schema }.
assert.equal(result.output_config.format.name, undefined);
});

test("openaiToAnthropic translates tool role messages", () => {
Expand Down