UNPKG

@future-agi/sdk

Version:

We help GenAI teams maintain high-accuracy for their Models in production.

82 lines 3.5 kB
import { APIKeyAuth, APIKeyAuthConfig } from '../api/auth'; import { PromptTemplate, Variables } from './types'; import { PromptLabels } from './labels'; /** * Main Prompt client – allows programmatic CRUD and execution of prompt templates. */ export declare class Prompt extends APIKeyAuth { template?: PromptTemplate; private _pendingLabel?; /** * List all prompt templates (raw JSON payload). */ static listTemplates(options?: APIKeyAuthConfig): Promise<Record<string, any>>; /** * Convenience: fetch template by exact name. */ static getTemplateByName(name: string, { label, version, ...options }?: APIKeyAuthConfig & { label?: string; version?: string; }): Promise<PromptTemplate>; /** * Delete template by name (helper). */ static deleteTemplateByName(name: string, options?: APIKeyAuthConfig): Promise<boolean>; /** Set default version for a template by name (class helper). */ static setDefaultVersion(templateName: string, version: string, options?: APIKeyAuthConfig): Promise<Record<string, any>>; /** List versions and labels for a template by name or id. */ static getTemplateLabels(args?: APIKeyAuthConfig & { template_name?: string; template_id?: string; }): Promise<Record<string, any>>; /** Assign label to template/version using only names. */ static assignLabelToTemplateVersion(templateName: string, version: string, label: string, options?: APIKeyAuthConfig): Promise<Record<string, any>>; /** Remove label by name from template/version using only names. */ static removeLabelFromTemplateVersion(templateName: string, version: string, label: string, options?: APIKeyAuthConfig): Promise<Record<string, any>>; constructor(template?: PromptTemplate, options?: APIKeyAuthConfig); /** * Create a new draft prompt template. */ open(): Promise<Prompt>; private _createNewDraft; /** Fetch raw version history (array of objects) */ private _fetchTemplateVersionHistory; /** Public: list full version history */ listTemplateVersions(): Promise<any[]>; /** Internal draft-status helper */ private _currentVersionIsDraft; /** Apply selected fields from another PromptTemplate to current */ private _applyTemplateUpdates; /** Save current draft state to backend */ saveCurrentDraft(): Promise<boolean>; /** Commit current draft version */ commitCurrentVersion(message?: string, set_default?: boolean): Promise<boolean>; /** Commit current draft if needed then open a new draft version */ createNewVersion({ template, commit_message, set_default, }?: { template?: PromptTemplate; commit_message?: string; set_default?: boolean; }): Promise<Prompt>; /** Accessor: label service for instance operations */ labels(): PromptLabels; /** * Execution support removed – this SDK variant focuses solely on template management. */ /** * Delete the current template. */ delete(): Promise<boolean>; private _prepareMessages; /** Compile the template messages with provided variables. * Replaces {{var}} occurrences in string contents; preserves structured contents. */ compile(variables?: Variables): Array<{ role: string; content: string | any[]; }>; } declare const _default: { Prompt: typeof Prompt; }; export default _default; //# sourceMappingURL=client.d.ts.map