/** * @module gemini-helpers.mts * * ## MIGRATION to @google/genai * * See migration notes in agent-witness-gemini.mts. */ import { FunctionCallPart, FunctionResponsePart } from "./gemini-types.mjs"; import { Content, FunctionCall } from "@google/genai"; import { IbGib_V1 } from "@ibgib/ts-gib/dist/V1/types.mjs"; import { APIFunctionInfo } from "../../../api/api-types.mjs"; import { PromptInfo } from "../agent-types.mjs"; import { TextSource } from "../agent-constants.mjs"; import { PromptInfoEntryGemini, PromptInfoGemini } from "./gemini-types.mjs"; import { FunctionInfoIbGib_V1 } from "../function-info/function-info-one-file.mjs"; export declare function textSourceToGeminiRole(src: TextSource): string; export declare function isPromptInfoGemini(info: PromptInfo): info is PromptInfoGemini; /** * gemini api-specific helper that maps gemini function call returned from the * model to our API function info interface */ export declare function geminiFunctionCallToAPIFunctionInfo({ functionCall, }: { functionCall: FunctionCall; }): { info: APIFunctionInfo; args: any; }; /** * Takes 0 or more entries and combines them into a single {@link Content} * object that Gemini API expects for `systemInstruction` when using the fn * * @param entries for system instruction, probably from {@link AgentWitnessGemini_V1.systemPromptParts} * @returns undefined if no entries, else single Gemini API Content object with role === "user" and combined parts from {@link systemPromptEntries} */ export declare function systemPromptEntriesToSystemInstructionContent({ systemPromptEntries, }: { systemPromptEntries: PromptInfoEntryGemini[]; }): Content | undefined; /** * helper function (not a guard) that determines if the given ibgib has the * expected shape of a Function Call Request comment (FCR). * * These objects are created when a model requests a function call. * * ATOW (01/2025) these FCRs should include both one or more infos for both * function calls and function responses. */ export declare function isFunctionCallRequestComment({ ibGib }: { ibGib: IbGib_V1; }): boolean; /** * Helper function to create Gemini API FunctionCallPart and FunctionResponsePart * objects from a FunctionInfoIbGib_V1. * * @param {object} arg - Arguments object. * @param {FunctionInfoIbGib_V1} arg.functionInfoIbGib - The FunctionInfoIbGib_V1 instance containing function call details. * @returns {{ call: Part; response: Part }} - An object containing both FunctionCallPart and FunctionResponsePart objects. * @throws {Error} If there's an error during the process, such as missing function name or arguments. */ export declare function getFunctionCallAndResponseParts({ functionInfoIbGib, }: { functionInfoIbGib: FunctionInfoIbGib_V1; }): { call: FunctionCallPart; response: FunctionResponsePart; }; //# sourceMappingURL=gemini-helpers.d.mts.map