@jackhua/mini-langchain
Version:
A lightweight TypeScript implementation of LangChain with cost optimization features
28 lines • 832 B
TypeScript
/**
* ReAct (Reasoning + Acting) Agent implementation
*/
import { BaseAgent, AgentConfig, AgentStep, AgentExecutionContext } from './base';
/**
* ReAct Agent - Combines reasoning with acting
*/
export declare class ReActAgent extends BaseAgent {
private promptTemplate;
constructor(config: AgentConfig);
/**
* Parse LLM output to extract action or finish
*/
private parseOutput;
/**
* Plan the next action based on current context
*/
plan(context: AgentExecutionContext): Promise<AgentStep>;
/**
* Format history specifically for ReAct format
*/
protected formatHistory(context: AgentExecutionContext): string;
}
/**
* Create a ReAct agent with tools
*/
export declare function createReActAgent(config: AgentConfig): ReActAgent;
//# sourceMappingURL=react.d.ts.map