..
This commit is contained in:
@@ -155,6 +155,12 @@ export const transformOpenAIToGoogleAI: APIFormatTransformer<
|
||||
stops.push(...Array.from(foundNames).map((name) => `\n${name}:`));
|
||||
stops = [...new Set(stops)].slice(0, 5);
|
||||
|
||||
// Handle thinking budget from the original request
|
||||
let thinkingConfig = undefined;
|
||||
if (body.generationConfig?.thinkingConfig || body.thinkingConfig) {
|
||||
thinkingConfig = body.generationConfig?.thinkingConfig || body.thinkingConfig;
|
||||
}
|
||||
|
||||
return {
|
||||
model: req.body.model,
|
||||
stream: rest.stream,
|
||||
@@ -166,6 +172,7 @@ export const transformOpenAIToGoogleAI: APIFormatTransformer<
|
||||
topP: rest.top_p,
|
||||
topK: 40, // openai schema doesn't have this, google ai defaults to 40
|
||||
temperature: rest.temperature,
|
||||
...(thinkingConfig ? { thinkingConfig } : {})
|
||||
},
|
||||
safetySettings: [
|
||||
{ category: "HARM_CATEGORY_HARASSMENT", threshold: "BLOCK_NONE" },
|
||||
|
||||
Reference in New Issue
Block a user