import { Ib, TransformResult } from '@ibgib/ts-gib/dist/types.mjs'; import { IbGibData_V1, IbGibRel8ns_V1, IbGib_V1 } from '@ibgib/ts-gib/dist/V1/types.mjs'; import { IbGibSpaceAny } from '@ibgib/core-gib/dist/witness/space/space-base-v1.mjs'; import { MetaspaceService } from '@ibgib/core-gib/dist/witness/space/metaspace/metaspace-types.mjs'; import { AgentAPI } from '../agent-types.mjs'; /** * used as a rel8nName to link a Function Call Request (FCR) comment ibgib to * the actual function call info ibgibs that represent each FCR. */ export declare const FUNCTION_INFO_REL8N_NAME = "function_info"; export declare const FUNCTION_INFO_ATOM = "function_info"; /** * @interface FunctionInfoIbInfo - Type for parsed function info ib. * Used by parseFunctionInfoIb */ export interface FunctionInfoIbInfo { atom: string; timestampInTicks: string; model: string; api: AgentAPI; agentId: string; } /** * builds the function info ibgib's ib based on given {@link data} * @see {@link parseFunctionInfoIb} */ export declare function getFunctionInfoIb({ data, }: { /** function info data, should be valid */ data: FunctionInfoData_V1; }): string; /** * @returns parsed info from an ib * @see {@link getFunctionInfoIb} */ export declare function parseFunctionInfoIb({ ib, }: { ib: Ib; }): FunctionInfoIbInfo; /** * Validates a `FunctionInfoIb` and returns a list of any errors. * * @param {object} arg - Options for validating the `ib`. * @param {string} arg.ib - `ib` to validate. * @returns {string[]} - list of validation errors or an empty array if valid. */ export declare function validateFunctionInfoIb({ ib, }: { ib: Ib; }): string[]; /** * Information required when creating an info ibgib. * * ATOW (01/2025) Note that this does NOT save the ibgib in any spaces. */ export interface CreateFunctionInfoIbGibArgs { /** * raw string of the function call requested by the model. */ fnRawRequest: string; /** * which api (e.g. 'gemini') was used when generating the function call * request. * @see {@link model} * @see {@link FunctionInfoData_V1.api} */ api: AgentAPI; /** * model that generated the request * @see {@link api} * @see {@link FunctionInfoData_V1.model} */ model: string; /** * id of the agent that this will be associated with */ agentId: string; /** * name of the function. * * in gemini, this should be provided easily and we shouldn't need a regex for it. */ fnName: string; /** * parsed args from the raw request string */ fnArgs: any; /** * the result of a successful functionImpl, otherwise undefined. * @see {@link FunctionInfoData_V1.fnResult} */ fnResult?: any; /** * flag that indicates if the function completed successfully. * @see {@link FunctionInfoData_V1.fnComplete} */ fnComplete?: boolean; /** * This is the error msg if there was an error actually parsing the raw * function info. * @see {@link execErrorMsg} */ parseErrorMsg?: string; /** * This is the error msg if there was an error actually executing the * function. * @see {@link parseErrorMsg} */ execErrorMsg?: string; /** * corresponds to whether or not the model wanted to be notified upon function completion/error. * @see {@link FunctionInfoData_V1.repromptWithResult} */ repromptWithResult?: boolean; /** * should we save the newly created ibgib and its dependency graph? * @see {@link metaspace} */ saveInSpace?: boolean; /** * if {@link saveInSpace}, this is the required metaspace to handle saving. * @see {@link space} */ metaspace?: MetaspaceService; /** * if {@link saveInSpace}, this is the required space in which to save. * @see {@link metaspace} */ space?: IbGibSpaceAny; } /** * Creates a new FunctionInfoIbGib_V1 object. * * @param {object} arg - Arguments for creating the new ibgib * @returns {Promise} A promise that resolves to the new FunctionInfoIbGib_V1 object. * @throws {Error} If there is an error during ibgib creation. */ export declare function createFunctionInfoIbGib(arg: CreateFunctionInfoIbGibArgs): Promise>; /** * @interface FunctionInfoData_V1 * Data interface for a function call. */ export interface FunctionInfoData_V1 extends IbGibData_V1 { /** * which model generated this function request. */ model: string; /** * Which api was used to generate this function request. */ api: AgentAPI; /** * This is the raw JSON string that was returned from the LLM function call */ fnRawRequest: string; /** * name of the function. * * in gemini, this should be provided easily and we shouldn't need a regex for it. */ fnName: string; /** * parsed args from the raw request string */ fnArgs: any; /** * The results of the called function. If the function implementation called * returns void/Promise then this should remain undefined. */ fnResult?: any; /** * Was the functionImpl completed without issue? If it returned void, this * should be set to true, but this may be used for other workflows in the * future. */ fnComplete?: boolean; /** * Is the function call request intended to have its result reprompted to the model * upon function completion or error? */ repromptWithResult?: boolean; } /** * @interface FunctionInfoRel8ns_V1 - Rel8ns interface for function info ibgibs. * Extends {@link IbGibRel8ns_V1} */ export interface FunctionInfoRel8ns_V1 extends IbGibRel8ns_V1 { } /** * @interface FunctionInfoIbGib_V1 - Interface for ibgibs of individual function calls. * Extends {@link IbGib_V1} with {@link FunctionInfoData_V1} and {@link FunctionInfoRel8ns_V1} */ export interface FunctionInfoIbGib_V1 extends IbGib_V1 { } //# sourceMappingURL=function-info-one-file.d.mts.map