UNPKG

@promptbook/browser

Version:

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

28 lines (27 loc) 1.65 kB
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools'; import type { string_markdown_text, string_title } from '../../types/typeAliases'; 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). * * @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 * * Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`. * * @public exported from `@promptbook/core` */ export declare function joinLlmExecutionTools(title: string_title & string_markdown_text, ...llmExecutionTools: ReadonlyArray<LlmExecutionTools>): MultipleLlmExecutionTools; /** * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one * TODO: [👷‍♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook */