Extension framework for function tool calling

This commit is contained in:
Cohee
2024-05-25 15:31:57 +03:00
parent 439ef0dc5e
commit a20c6bb01e
5 changed files with 171 additions and 1 deletions

View File

@@ -920,6 +920,11 @@ router.post('/generate', jsonParser, function (request, response) {
controller.abort();
});
if (!isTextCompletion) {
bodyParams['tools'] = request.body.tools;
bodyParams['tool_choice'] = request.body.tool_choice;
}
const requestBody = {
'messages': isTextCompletion === false ? request.body.messages : undefined,
'prompt': isTextCompletion === true ? textPrompt : undefined,