tweak: transform
This commit is contained in:
parent
ce4b246cc0
commit
4ce5ee161a
1 changed files with 4 additions and 4 deletions
|
|
@ -22,8 +22,8 @@ export namespace ProviderTransform {
|
||||||
model: Provider.Model,
|
model: Provider.Model,
|
||||||
options: Record<string, unknown>,
|
options: Record<string, unknown>,
|
||||||
): ModelMessage[] {
|
): ModelMessage[] {
|
||||||
// Strip openai itemId metadata when store=false to avoid sending stale IDs
|
// Strip openai itemId metadata following what codex does
|
||||||
if (model.api.npm === "@ai-sdk/openai" && options.store === false) {
|
if (model.api.npm === "@ai-sdk/openai" || options.store === false) {
|
||||||
msgs = msgs.map((msg) => {
|
msgs = msgs.map((msg) => {
|
||||||
if (!Array.isArray(msg.content)) return msg
|
if (!Array.isArray(msg.content)) return msg
|
||||||
const content = msg.content.map((part) => {
|
const content = msg.content.map((part) => {
|
||||||
|
|
@ -486,8 +486,8 @@ export namespace ProviderTransform {
|
||||||
}): Record<string, any> {
|
}): Record<string, any> {
|
||||||
const result: Record<string, any> = {}
|
const result: Record<string, any> = {}
|
||||||
|
|
||||||
// all codex plans MUST use store = false
|
// openai and providers using openai package should set store to false by default.
|
||||||
if (input.model.providerID === "openai" && input.auth?.type === "oauth") {
|
if (input.model.providerID === "openai" || input.model.api.npm === "@ai-sdk/openai") {
|
||||||
result["store"] = false
|
result["store"] = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue