Update OpenAI dependency
This commit is contained in:
parent
8ed2e758f8
commit
23ceca5cd3
8 changed files with 250 additions and 81 deletions
|
@ -1,4 +1,4 @@
|
|||
import { ChatCompletionFunctions, ChatCompletionRequestMessage, ChatCompletionRequestMessageFunctionCall } from "openai";
|
||||
import { ChatCompletionCreateParams, ChatCompletionMessage, ChatCompletionMessageParam } from "openai/resources/chat";
|
||||
|
||||
import { config } from "./index";
|
||||
|
||||
|
@ -13,6 +13,9 @@ type OpenAIFunctionRequestData<T extends nameTypeMap> = {
|
|||
[name in keyof T]: T[name];
|
||||
};
|
||||
|
||||
type ChatCompletionFunctions = ChatCompletionCreateParams.Function;
|
||||
type ChatCompletionFunctionCall = ChatCompletionMessage.FunctionCall;
|
||||
|
||||
/**
|
||||
* Represents the function that can be ran by the OpenAI model
|
||||
*/
|
||||
|
@ -61,7 +64,7 @@ export default class FunctionManager {
|
|||
return rvalue;
|
||||
}
|
||||
|
||||
public handleFunction(request: ChatCompletionRequestMessageFunctionCall): ChatCompletionRequestMessage {
|
||||
public handleFunction(request: ChatCompletionFunctionCall): ChatCompletionMessageParam {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let parsedArguments: any;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue