UNPKG

@promptbook/remote-client

Version:

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

61 lines (60 loc) 2.96 kB
import type { AvailableModel } from '../../execution/AvailableModel'; import type { LlmExecutionTools } from '../../execution/LlmExecutionTools'; import type { string_agent_name } from '../../types/string_agent_name'; import type { string_model_name } from '../../types/string_model_name'; import type { string_system_message } from '../../types/string_prompt'; import type { string_url_image } from '../../types/string_url_image'; import type { AgentModelRequirements } from './AgentModelRequirements'; import type { CreateAgentModelRequirementsOptions } from './CreateAgentModelRequirementsOptions'; import type { string_book } from './string_book'; /** * Creates model requirements for an agent based on its source. * * There are 2 similar functions: * - `parseAgentSource` which is a lightweight parser for agent source, it parses basic information and its purpose is to be quick and synchronous. The commitments there are hardcoded. * - `createAgentModelRequirements` which is an asynchronous function that creates model requirements it applies each commitment one by one and works asynchronous. * * @param agentSource - Book describing the agent. * @param modelName - Optional override for the agent's model. * @param availableModels - Models that could fulfill the agent. * @param llmTools - Execution tools used when selecting a best model. * @param options - Optional hooks such as the agent reference resolver. * * @public exported from `@promptbook/core` */ export declare function createAgentModelRequirements(agentSource: string_book, modelName?: string_model_name, availableModels?: readonly AvailableModel[], llmTools?: LlmExecutionTools, options?: CreateAgentModelRequirementsOptions): Promise<AgentModelRequirements>; /** * Extracts MCP servers from agent source * * @param agentSource The agent source string that may contain `USE MCP` commitments. * @returns Array of MCP server identifiers * * @private TODO: [🧠] Maybe should be public */ export declare function extractMcpServers(agentSource: string_book): string[]; /** * Creates a system message for an agent based on its source * * @deprecated Use createAgentModelRequirements instead * * @private */ export declare function createAgentSystemMessage(agentSource: string_book): Promise<string_system_message>; /** * Extracts the agent name from the first non-empty line of the agent source. * * @deprecated Use parseAgentSource instead * * @private */ export declare function extractAgentName(agentSource: string_book): string_agent_name; /** * Extracts the profile image URL from agent source or returns default avatar fallback * * @param agentSource The agent source string that may contain META IMAGE line * @returns Profile image URL (from source or default avatar fallback) * @deprecated Use parseAgentSource instead * * @private */ export declare function extractAgentProfileImage(agentSource: string_book): string_url_image | null;