temporary fix for max output token
This commit is contained in:
@@ -97,7 +97,7 @@ export namespace Provider {
|
|||||||
Array.isArray(msg.content) && msg.content.some((part: any) => part.type === "image_url"),
|
Array.isArray(msg.content) && msg.content.some((part: any) => part.type === "image_url"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch { }
|
||||||
const headers: Record<string, string> = {
|
const headers: Record<string, string> = {
|
||||||
...init.headers,
|
...init.headers,
|
||||||
...copilot.HEADERS,
|
...copilot.HEADERS,
|
||||||
@@ -283,26 +283,26 @@ export namespace Provider {
|
|||||||
cost:
|
cost:
|
||||||
!model.cost && !existing?.cost
|
!model.cost && !existing?.cost
|
||||||
? {
|
? {
|
||||||
input: 0,
|
input: 0,
|
||||||
output: 0,
|
output: 0,
|
||||||
cache_read: 0,
|
cache_read: 0,
|
||||||
cache_write: 0,
|
cache_write: 0,
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
cache_read: 0,
|
cache_read: 0,
|
||||||
cache_write: 0,
|
cache_write: 0,
|
||||||
...existing?.cost,
|
...existing?.cost,
|
||||||
...model.cost,
|
...model.cost,
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
...existing?.options,
|
...existing?.options,
|
||||||
...model.options,
|
...model.options,
|
||||||
},
|
},
|
||||||
limit: model.limit ??
|
limit: model.limit ??
|
||||||
existing?.limit ?? {
|
existing?.limit ?? {
|
||||||
context: 0,
|
context: 0,
|
||||||
output: 0,
|
output: 0,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
parsed.models[modelID] = parsedModel
|
parsed.models[modelID] = parsedModel
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -322,9 +322,9 @@ export namespace Session {
|
|||||||
for (const child of await children(sessionID)) {
|
for (const child of await children(sessionID)) {
|
||||||
await remove(child.id, false)
|
await remove(child.id, false)
|
||||||
}
|
}
|
||||||
await unshare(sessionID).catch(() => {})
|
await unshare(sessionID).catch(() => { })
|
||||||
await Storage.remove(`session/info/${sessionID}`).catch(() => {})
|
await Storage.remove(`session/info/${sessionID}`).catch(() => { })
|
||||||
await Storage.removeDir(`session/message/${sessionID}/`).catch(() => {})
|
await Storage.removeDir(`session/message/${sessionID}/`).catch(() => { })
|
||||||
state().sessions.delete(sessionID)
|
state().sessions.delete(sessionID)
|
||||||
state().messages.delete(sessionID)
|
state().messages.delete(sessionID)
|
||||||
if (emitEvent) {
|
if (emitEvent) {
|
||||||
@@ -523,7 +523,7 @@ export namespace Session {
|
|||||||
sessionID: input.sessionID,
|
sessionID: input.sessionID,
|
||||||
abort: new AbortController().signal,
|
abort: new AbortController().signal,
|
||||||
messageID: userMsg.id,
|
messageID: userMsg.id,
|
||||||
metadata: async () => {},
|
metadata: async () => { },
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
return [
|
return [
|
||||||
@@ -632,7 +632,7 @@ export namespace Session {
|
|||||||
|
|
||||||
// mark session as updated
|
// mark session as updated
|
||||||
// used for session list sorting (indicates when session was most recently interacted with)
|
// used for session list sorting (indicates when session was most recently interacted with)
|
||||||
await update(input.sessionID, (_draft) => {})
|
await update(input.sessionID, (_draft) => { })
|
||||||
|
|
||||||
if (isLocked(input.sessionID)) {
|
if (isLocked(input.sessionID)) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
@@ -712,7 +712,7 @@ export namespace Session {
|
|||||||
draft.title = title.trim()
|
draft.title = title.trim()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => { })
|
||||||
}
|
}
|
||||||
|
|
||||||
const agent = await Agent.get(inputAgent)
|
const agent = await Agent.get(inputAgent)
|
||||||
@@ -927,7 +927,7 @@ export namespace Session {
|
|||||||
},
|
},
|
||||||
maxRetries: 3,
|
maxRetries: 3,
|
||||||
activeTools: Object.keys(tools).filter((x) => x !== "invalid"),
|
activeTools: Object.keys(tools).filter((x) => x !== "invalid"),
|
||||||
maxOutputTokens: outputLimit,
|
maxOutputTokens: model.info.id.startsWith("gpt-5") ? undefined : outputLimit,
|
||||||
abortSignal: abort.signal,
|
abortSignal: abort.signal,
|
||||||
stopWhen: stepCountIs(1000),
|
stopWhen: stepCountIs(1000),
|
||||||
providerOptions: {
|
providerOptions: {
|
||||||
|
|||||||
Reference in New Issue
Block a user