requests old version of Anthropic API due to breaking SSE changes
This commit is contained in:
parent
6a7f64b037
commit
6598b4df0d
|
@ -99,6 +99,13 @@ function openaiToAnthropic(body: any, req: Request) {
|
|||
throw result.error;
|
||||
}
|
||||
|
||||
// Anthropic has started versioning their API, indicated by an HTTP header
|
||||
// `anthropic-version`. The new June 2023 version is not backwards compatible
|
||||
// with our OpenAI-to-Anthropic transformations so we need to explicitly
|
||||
// request the older version for now. 2023-01-01 will be removed in September.
|
||||
// https://docs.anthropic.com/claude/reference/versioning
|
||||
req.headers["anthropic-version"] = "2023-01-01";
|
||||
|
||||
const { messages, ...rest } = result.data;
|
||||
const prompt =
|
||||
result.data.messages
|
||||
|
|
Loading…
Reference in New Issue