mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-09 10:54:59 +01:00
zen: fix unified endpoint for codex
This commit is contained in:
@@ -188,6 +188,7 @@ export function fromAnthropicRequest(body: any): CommonRequest {
|
||||
})()
|
||||
|
||||
return {
|
||||
model: body.model,
|
||||
max_tokens: body.max_tokens,
|
||||
temperature: body.temperature,
|
||||
top_p: body.top_p,
|
||||
|
||||
@@ -114,6 +114,7 @@ export function fromOaCompatibleRequest(body: any): CommonRequest {
|
||||
}
|
||||
|
||||
return {
|
||||
model: body.model,
|
||||
max_tokens: body.max_tokens,
|
||||
temperature: body.temperature,
|
||||
top_p: body.top_p,
|
||||
|
||||
@@ -177,6 +177,7 @@ export function fromOpenaiRequest(body: any): CommonRequest {
|
||||
})()
|
||||
|
||||
return {
|
||||
model: body.model,
|
||||
max_tokens: body.max_output_tokens ?? body.max_tokens,
|
||||
temperature: body.temperature,
|
||||
top_p: body.top_p,
|
||||
@@ -310,7 +311,7 @@ export function toOpenaiRequest(body: CommonRequest) {
|
||||
metadata: (body as any).metadata,
|
||||
store: (body as any).store,
|
||||
user: (body as any).user,
|
||||
text: { verbosity: "low" },
|
||||
text: { verbosity: body.model === "gpt-5-codex" ? "medium" : "low" },
|
||||
reasoning: { effort: "medium" },
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ export interface CommonUsage {
|
||||
}
|
||||
|
||||
export interface CommonRequest {
|
||||
model?: string
|
||||
model: string
|
||||
max_tokens?: number
|
||||
temperature?: number
|
||||
top_p?: number
|
||||
|
||||
Reference in New Issue
Block a user