@kakaopay-develop/agent-toolkit
Version:
KakaoPay Agent Toolkit
87 lines (80 loc) • 2.17 kB
text/typescript
import { z } from 'zod';
import * as axios from 'axios';
type Context = {
cid?: string;
};
type Configuration = {
actions: {
[product: string]: {
[action: string]: boolean;
};
};
context?: Context;
};
declare class KakaoPayClient {
private client;
constructor(secretKey: string);
post<T>(url: string, data?: any): Promise<axios.AxiosResponse<T>>;
}
type Tool = {
method: string;
name: string;
description: string;
parameters: z.ZodObject<any, any, any, any>;
actions: {
[key: string]: {
[action: string]: boolean;
};
};
execute: (_client: KakaoPayClient, _context: Context, _params: any) => Promise<any>;
};
declare class KakaoPayAPI {
kakaoPayClient: KakaoPayClient;
context: Context;
tools: Tool[];
constructor(secretKey: string, context?: Context);
run(method: string, arg: any): Promise<string>;
}
interface BedrockTool {
toolSpec: {
name: string;
description: string;
inputSchema: {
json: any;
};
};
}
interface BedrockToolBlock {
toolUseId: string;
name: string;
input: any;
}
interface BedrockToolResult {
toolUseId: string;
content: Array<{
text: string;
}>;
}
declare class KakaoPayAgentToolkit {
private _kakaopay;
tools: BedrockTool[];
constructor({ secretKey, configuration, }: {
secretKey: string;
configuration: Configuration;
});
getTools(): BedrockTool[];
/**
* Processes a single Bedrock tool call by executing the requested function.
*
* @param {BedrockToolBlock} toolCall - The tool call object from Bedrock containing
* function name, arguments, and tool use ID.
* @returns {Promise<BedrockToolResult>} A promise that resolves to a tool result
* object containing the result of the tool execution with the proper format for Bedrock.
*/
handleToolCall(toolCall: BedrockToolBlock): Promise<BedrockToolResult>;
/**
* Get KakaoPay API instance for direct access
*/
getKakaoPayAPI(): KakaoPayAPI;
}
export { KakaoPayAgentToolkit };