UNPKG

@promptbook/remote-client

Version:

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

25 lines (24 loc) 1.46 kB
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools'; import type { string_markdown_text } from '../../types/string_markdown'; import type { string_title } from '../../types/string_title'; import { MultipleLlmExecutionTools } from './MultipleLlmExecutionTools'; /** * Joins multiple LLM Execution Tools into one. * * This function takes a list of `LlmExecutionTools` and returns a single unified * `MultipleLlmExecutionTools` object. It provides failover and aggregation logic: * * 1. **Failover**: When a model call is made, it tries providers in the order they were provided. * If the first provider doesn't support the requested model or fails, it tries the next one. * 2. **Aggregation**: `listModels` returns a combined list of all models available from all providers. * 3. **Empty case**: If no tools are provided, it logs a warning (as Promptbook requires LLMs to function). * * Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`. * * @param title - A descriptive title for this collection of joined tools * @param llmExecutionTools - An array of execution tools to be joined * @returns A single unified execution tool wrapper * * @public exported from `@promptbook/core` */ export declare function joinLlmExecutionTools(title: string_title & string_markdown_text, ...llmExecutionTools: ReadonlyArray<LlmExecutionTools>): MultipleLlmExecutionTools;