mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-31 22:32:28 +00:00
fix: provider option transforms (#3331)
This commit is contained in:
@@ -15,6 +15,7 @@ import { Token } from "../util/token"
|
||||
import { Log } from "../util/log"
|
||||
import { SessionLock } from "./lock"
|
||||
import { NamedError } from "../util/error"
|
||||
import { ProviderTransform } from "@/provider/transform"
|
||||
|
||||
export namespace SessionCompaction {
|
||||
const log = Log.create({ service: "session.compaction" })
|
||||
@@ -143,9 +144,7 @@ export namespace SessionCompaction {
|
||||
const stream = streamText({
|
||||
maxRetries: 10,
|
||||
model: model.language,
|
||||
providerOptions: {
|
||||
[model.npm === "@ai-sdk/openai" ? "openai" : model.providerID]: model.info.options,
|
||||
},
|
||||
providerOptions: ProviderTransform.providerOptions(model.npm, model.providerID, model.info.options),
|
||||
abortSignal: signal,
|
||||
onError(error) {
|
||||
log.error("stream error", {
|
||||
|
||||
@@ -282,10 +282,7 @@ export namespace SessionPrompt {
|
||||
OUTPUT_TOKEN_MAX,
|
||||
),
|
||||
abortSignal: abort.signal,
|
||||
providerOptions: {
|
||||
[model.npm === "@ai-sdk/openai" || model.npm === "@ai-sdk/azure" ? "openai" : model.providerID]:
|
||||
params.options,
|
||||
},
|
||||
providerOptions: ProviderTransform.providerOptions(model.npm, model.providerID, params.options),
|
||||
stopWhen: stepCountIs(1),
|
||||
temperature: params.temperature,
|
||||
topP: params.topP,
|
||||
@@ -1822,9 +1819,7 @@ export namespace SessionPrompt {
|
||||
}
|
||||
generateText({
|
||||
maxOutputTokens: small.info.reasoning ? 1500 : 20,
|
||||
providerOptions: {
|
||||
[small.providerID]: options,
|
||||
},
|
||||
providerOptions: ProviderTransform.providerOptions(small.npm, small.providerID, options),
|
||||
messages: [
|
||||
...SystemPrompt.title(small.providerID).map(
|
||||
(x): ModelMessage => ({
|
||||
|
||||
Reference in New Issue
Block a user