don't add empty tools array
This commit is contained in:
parent
1ec8c56816
commit
4d030f532f
1 changed files with 5 additions and 2 deletions
|
|
@ -67,7 +67,7 @@ export function toChatBody(
|
|||
},
|
||||
}));
|
||||
|
||||
return {
|
||||
const params: ChatCompletionCreateParams = {
|
||||
messages: messages.map(toChatMessage),
|
||||
model: options.model,
|
||||
max_tokens: options.maxTokens,
|
||||
|
|
@ -77,9 +77,12 @@ export function toChatBody(
|
|||
presence_penalty: options.presencePenalty,
|
||||
stream: options.stream ?? true,
|
||||
stop: options.stop,
|
||||
tools,
|
||||
prediction: options.prediction,
|
||||
};
|
||||
if (tools?.length) {
|
||||
params.tools = tools;
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
export function toCompleteBody(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue