Skip to content

Commit b89330c

Browse files
authored
revert oai max tokens prop (#1093)
* revert oai max tokens prop * fix startswith
1 parent 62ad0b4 commit b89330c

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

srv/adapter/openai.ts

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export const handleOAI: ModelAdapter = async function* (opts) {
4141
stream: (gen.streamResponse && kind !== 'summary') ?? defaultPresets.openai.streamResponse,
4242
temperature: gen.temp ?? defaultPresets.openai.temp,
4343
max_tokens: maxResponseLength,
44-
max_completion_tokens: maxResponseLength,
4544
top_p: gen.topP ?? 1,
4645
stop: [`\n${handle}:`].concat(gen.stopSequences!),
4746
}

srv/adapter/template-chat-payload.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export async function toChatMessages(
6464
for (let i = 0; i < history.length; i++) {
6565
const line = history[i]
6666
const original = opts.lines[i]
67-
const role = original.startsWith(sender) ? 'user' : 'assistant'
67+
const role = original?.startsWith(sender) ? 'user' : 'assistant'
6868
messages.push({ role, content: line })
6969
}
7070

0 commit comments

Comments
 (0)