UNPKG

@promptbook/remote-server

Version:

Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action

56 lines (55 loc) 2.04 kB
import type { Promisable } from 'type-fest'; import type { Identification } from '../../../remote-server/socket-types/_subtypes/Identification'; import type { string_app_id } from '../../../types/string_token'; import type { string_url } from '../../../types/string_url'; import type { chococake } from '../../../utils/organization/really_any'; import type { CacheLlmToolsOptions } from '../utils/cache/CacheLlmToolsOptions'; import type { LlmExecutionToolsWithTotalUsage } from '../utils/count-total-usage/LlmExecutionToolsWithTotalUsage'; /** * Options for provide Llm tools for wizard or Cli. */ type ProvideLlmToolsForWizardOrCliOptions = { /** * If true, user will be always prompted for login * * Note: This is used in `ptbk login` command */ isLoginloaded?: true; } & Pick<CacheLlmToolsOptions, 'isCacheReloaded'> & ({ /** * Use local keys and execute LLMs directly */ readonly strategy: 'BRING_YOUR_OWN_KEYS'; } | { /** * Do not use local keys but login to Promptbook server and execute LLMs there */ readonly strategy: 'REMOTE_SERVER'; /** * URL of the remote server * * @default `DEFAULT_REMOTE_SERVER_URL` */ readonly remoteServerUrl?: string_url; /** * Identifier of the application which will be passed to the remote server identification * * Note: This can be some id or some semantic name like "email-agent" */ readonly appId: string_app_id; /** * * * Note: When login prompt fails, `process.exit(1)` is called */ loginPrompt(): Promisable<Identification<chococake>>; }); /** * Returns LLM tools for CLI * * Note: `$` is used to indicate that this function is not a pure function - it uses filesystem to access `.env` file and also writes this .env file * * @private within the repository - for CLI utils */ export declare function $provideLlmToolsForWizardOrCli(options?: ProvideLlmToolsForWizardOrCliOptions): Promise<LlmExecutionToolsWithTotalUsage>; export {};