UNPKG

@promptbook/openai

Version:

Promptbook: Turn your company's scattered knowledge into AI ready books

67 lines (66 loc) 2.19 kB
import { TODO_any } from '../../_packages/types.index'; /** * Prompt parameter key used to pass hidden runtime context to tool execution. * * @private internal runtime wiring for commitment tools */ export declare const TOOL_RUNTIME_CONTEXT_PARAMETER = "promptbookToolRuntimeContext"; /** * Hidden argument key used to pass runtime context into individual tool calls. * * @private internal runtime wiring for commitment tools */ export declare const TOOL_RUNTIME_CONTEXT_ARGUMENT = "__promptbookToolRuntimeContext"; /** * User geolocation payload shared with tools through hidden runtime context. * * @private internal runtime wiring for commitment tools */ export type UserLocationRuntimeContext = { permission?: 'granted' | 'denied' | 'unavailable'; latitude?: number; longitude?: number; accuracyMeters?: number; altitudeMeters?: number | null; headingDegrees?: number | null; speedMetersPerSecond?: number | null; timestamp?: string; }; /** * Runtime context shape shared across commitment tools. * * @private internal runtime wiring for commitment tools */ export type ToolRuntimeContext = { memory?: { enabled?: boolean; userId?: number; username?: string; agentId?: string; agentName?: string; isTeamConversation?: boolean; isPrivateMode?: boolean; }; userLocation?: UserLocationRuntimeContext; }; /** * Parses unknown runtime context payload into a normalized object. * * @private internal runtime wiring for commitment tools */ export declare function parseToolRuntimeContext(rawValue: unknown): ToolRuntimeContext | null; /** * Reads runtime context attached to tool call arguments. * * @private internal runtime wiring for commitment tools */ export declare function readToolRuntimeContextFromToolArgs(args: Record<string, TODO_any>): ToolRuntimeContext | null; /** * Serializes runtime context for prompt parameters. * * @private internal runtime wiring for commitment tools */ export declare function serializeToolRuntimeContext(context: ToolRuntimeContext): string; /** * Note: [💞] Ignore a discrepancy between file name and entity name */