node-agency
Version:
A node package for building AI agents
27 lines • 988 B
TypeScript
import OpenAI from "openai";
import { Model as OpenAIModel } from "./models/openai";
import { Model as OllamaModel } from "./models/ollama";
import { Model as ClaudeModel } from "./models/claude";
import { VectorStore } from "./utils";
type AgentProps = {
role: string;
goal: string;
tools?: OpenAI.Chat.Completions.ChatCompletionTool[];
model?: OpenAIModel | ClaudeModel;
} | {
role: string;
goal: string;
tools?: never;
model?: OllamaModel;
};
type VectorStoreType = ReturnType<typeof VectorStore> | null;
declare const Agent: ({ role, goal, tools, model }: AgentProps) => {
role: string;
goal: string;
model: OpenAIModel | ClaudeModel | OllamaModel;
memory: (store: VectorStoreType) => void;
execute: (prompt: string, workerTools?: OpenAI.Chat.Completions.ChatCompletionTool[]) => Promise<string>;
executeStream: (prompt: string) => Promise<AsyncIterableIterator<string>>;
};
export { Agent };
//# sourceMappingURL=agent.d.ts.map