node-agency
Version:
A node package for building AI agents
48 lines • 1.65 kB
TypeScript
import OpenAI from "openai";
type Role = "user" | "assistant" | "system";
type TextContent = {
type: "text";
text: string;
};
type ToolUseContent = {
type: "tool_use";
id: string;
name: string;
input: any;
};
type ToolUseResultContent = {
type: "tool_result";
tool_use_id: string;
content: any;
};
type Content = TextContent | ToolUseContent | ToolUseResultContent;
interface Message {
role: Role;
content: Content[] | string;
}
type Messages = Message[];
export declare class Model {
private apiKey;
history: Messages;
selfReflected: number;
parallelToolCalls: boolean;
isManager: boolean;
model: string;
selfReflect: boolean;
constructor(options?: {
parallelToolCalls?: boolean;
ANTHROPIC_API_KEY?: string;
model?: string;
selfReflect?: boolean;
});
call(systemMessage: string, prompt: Message, tools?: OpenAI.Chat.Completions.ChatCompletionTool[], context?: string): Promise<string>;
callStream(systemMessage: string, prompt: {
role: Role;
content: string;
}, callback: (message: string) => void, tools?: any[], context?: string): Promise<AsyncIterableIterator<string>>;
callClaude(systemMessage: string, messages: Messages, tools?: OpenAI.Chat.Completions.ChatCompletionTool[], reflected?: boolean): Promise<Message["content"]>;
processingToolCall(tool_call: ToolUseContent): Promise<Message>;
callClaudeStream(systemMessage: string, messages: Messages, callback: (message: string) => void, tools?: any[]): Promise<AsyncIterableIterator<string>>;
}
export {};
//# sourceMappingURL=claude.d.ts.map