tweak: adjust variant logic for muse (#36079)
This commit is contained in:
parent
518772c2ba
commit
2e43d41af0
2 changed files with 29 additions and 1 deletions
|
|
@ -207,6 +207,13 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
|
||||||
},
|
},
|
||||||
options: { headerTimeout: OPENAI_HEADER_TIMEOUT_DEFAULT },
|
options: { headerTimeout: OPENAI_HEADER_TIMEOUT_DEFAULT },
|
||||||
}),
|
}),
|
||||||
|
meta: () =>
|
||||||
|
Effect.succeed({
|
||||||
|
autoload: false,
|
||||||
|
async getModel(sdk: any, modelID: string, _options?: Record<string, any>) {
|
||||||
|
return sdk.responses(modelID)
|
||||||
|
},
|
||||||
|
}),
|
||||||
xai: () =>
|
xai: () =>
|
||||||
Effect.succeed({
|
Effect.succeed({
|
||||||
autoload: false,
|
autoload: false,
|
||||||
|
|
|
||||||
|
|
@ -884,6 +884,18 @@ export function variants(model: Provider.Model): Record<string, Record<string, a
|
||||||
)
|
)
|
||||||
case "@ai-sdk/amazon-bedrock/mantle":
|
case "@ai-sdk/amazon-bedrock/mantle":
|
||||||
case "@ai-sdk/openai": {
|
case "@ai-sdk/openai": {
|
||||||
|
if (model.providerID === "meta") {
|
||||||
|
return Object.fromEntries(
|
||||||
|
OPENAI_EFFORTS.map((effort) => [
|
||||||
|
effort,
|
||||||
|
{
|
||||||
|
reasoningEffort: effort,
|
||||||
|
reasoningSummary: "auto",
|
||||||
|
include: INCLUDE_ENCRYPTED_REASONING,
|
||||||
|
},
|
||||||
|
]),
|
||||||
|
)
|
||||||
|
}
|
||||||
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/openai
|
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/openai
|
||||||
const efforts = openaiReasoningEfforts(model.api.id, model.release_date)
|
const efforts = openaiReasoningEfforts(model.api.id, model.release_date)
|
||||||
return Object.fromEntries(
|
return Object.fromEntries(
|
||||||
|
|
@ -1128,11 +1140,20 @@ export function options(input: {
|
||||||
|
|
||||||
if (
|
if (
|
||||||
input.providerOptions?.setCacheKey !== false &&
|
input.providerOptions?.setCacheKey !== false &&
|
||||||
(input.model.providerID === "openai" || input.model.api.npm === "@ai-sdk/xai" || input.providerOptions?.setCacheKey)
|
(input.model.providerID === "openai" ||
|
||||||
|
input.model.api.npm === "@ai-sdk/openai" ||
|
||||||
|
input.model.api.npm === "@ai-sdk/xai" ||
|
||||||
|
input.providerOptions?.setCacheKey)
|
||||||
) {
|
) {
|
||||||
result["promptCacheKey"] = input.sessionID
|
result["promptCacheKey"] = input.sessionID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (input.model.providerID === "meta" && input.model.api.npm === "@ai-sdk/openai") {
|
||||||
|
result["reasoningEffort"] = "high"
|
||||||
|
result["reasoningSummary"] = "auto"
|
||||||
|
result["include"] = INCLUDE_ENCRYPTED_REASONING
|
||||||
|
}
|
||||||
|
|
||||||
if (input.model.api.npm === "@ai-sdk/google" || input.model.api.npm === "@ai-sdk/google-vertex") {
|
if (input.model.api.npm === "@ai-sdk/google" || input.model.api.npm === "@ai-sdk/google-vertex") {
|
||||||
if (input.model.capabilities.reasoning) {
|
if (input.model.capabilities.reasoning) {
|
||||||
result["thinkingConfig"] = {
|
result["thinkingConfig"] = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue