@kakaopay-develop/agent-toolkit
Version:
KakaoPay Agent Toolkit
37 lines (33 loc) • 1.27 kB
text/typescript
import OpenAI from 'openai';
type Context = {
cid?: string;
};
type Configuration = {
actions: {
[product: string]: {
[action: string]: boolean;
};
};
context?: Context;
};
type ChatCompletionTool = OpenAI.Chat.Completions.ChatCompletionTool;
type ChatCompletionMessageToolCall = OpenAI.Chat.Completions.ChatCompletionMessageToolCall;
declare class KakaoPayAgentToolkit {
private _kakaopay;
tools: ChatCompletionTool[];
constructor({ secretKey, configuration, }: {
secretKey: string;
configuration: Configuration;
});
getTools(): ChatCompletionTool[];
/**
* Processes a single OpenAI tool call by executing the requested function.
*
* @param {ChatCompletionMessageToolCall} toolCall - The tool call object from OpenAI containing
* function name, arguments, and ID.
* @returns {Promise<ChatCompletionToolMessageParam>} A promise that resolves to a tool message
* object containing the result of the tool execution with the proper format for the OpenAI API.
*/
handleToolCall(toolCall: ChatCompletionMessageToolCall): Promise<OpenAI.Chat.Completions.ChatCompletionToolMessageParam>;
}
export { type Configuration, KakaoPayAgentToolkit };