UNPKG

@agentica/core

Version:

Agentic AI Library specialized in LLM Function Calling

65 lines (55 loc) 1.57 kB
import type { IHttpResponse } from "@samchon/openapi"; import type { AgenticaOperation } from "../context/AgenticaOperation"; import type { IAgenticaHistoryJson } from "../json/IAgenticaHistoryJson"; import type { AgenticaHistoryBase } from "./AgenticaHistoryBase"; /** * Execute prompt. * * @author Samchon */ export type AgenticaExecuteHistory = | AgenticaExecuteHistory.Class | AgenticaExecuteHistory.Http; export namespace AgenticaExecuteHistory { /** * Class protocol case. */ export interface Class extends Base<"class", AgenticaOperation.Class, unknown> {} /** * HTTP protocol case. */ export interface Http extends Base<"http", AgenticaOperation.Http, IHttpResponse> {} interface Base< Protocol extends "http" | "class", Operation extends AgenticaOperation, Value, > extends AgenticaHistoryBase<"execute", IAgenticaHistoryJson.IExecute> { /** * Protocol of the operation. */ protocol: Protocol; /** * Target operation that has been called. */ operation: Operation; /** * Arguments of the function calling. */ arguments: Record<string, unknown>; /** * Return value. * * If the protocol is "class", the return value of the class function. * * Otherwise "http", the return value is an HTTP response. */ value: Value; /** * Whether the execution was successful or not. * * If the success value is false, it means that an error has * occurred during the execution. */ success: boolean; } }