llamaindex
Version:
<p align="center"> <img height="100" width="100" alt="LlamaIndex logo" src="https://ts.llamaindex.ai/square.svg" /> </p> <h1 align="center">LlamaIndex.TS</h1> <h3 align="center"> Data framework for your LLM application. </h3>
41 lines (38 loc) • 1.23 kB
text/typescript
import { AgentWorker, TaskHandler, AgentRunner, AgentParamsBase } from '@llamaindex/core/agent';
export * from '@llamaindex/core/agent';
import { JSONValue, JSONObject } from '@llamaindex/core/global';
import { LLM, ChatResponse } from '@llamaindex/core/llms';
type ReACTAgentParams = AgentParamsBase<LLM>;
type BaseReason = {
type: unknown;
};
type ObservationReason = BaseReason & {
type: "observation";
observation: JSONValue;
};
type ActionReason = BaseReason & {
type: "action";
thought: string;
action: string;
input: JSONObject;
};
type ResponseReason = BaseReason & {
type: "response";
thought: string;
response: ChatResponse;
};
type Reason = ObservationReason | ActionReason | ResponseReason;
type ReACTAgentStore = {
reasons: Reason[];
};
declare class ReACTAgentWorker extends AgentWorker<LLM, ReACTAgentStore> {
taskHandler: TaskHandler<LLM<object, object>, ReACTAgentStore>;
}
declare class ReActAgent extends AgentRunner<LLM, ReACTAgentStore> {
constructor(params: ReACTAgentParams);
createStore(): {
reasons: never[];
};
static taskHandler: TaskHandler<LLM, ReACTAgentStore>;
}
export { type ReACTAgentParams, ReACTAgentWorker, ReActAgent };