MissingToolsConversionStrategy

Determines how the tool calls which are present in the prompt, but whose definitions are not present in the request, are converted when sending to the Model.

Missing tool definitions usually occur when different sets of tools are used between stages/subgraphs, and the same prompt history is used without compression.

Inheritors

Constructors

Link copied to clipboard
constructor(format: ToolCallDescriber)

Types

Link copied to clipboard

Replace all real tool call and response messages with their dumps to the specified format, and use them as plaintext messages.

Link copied to clipboard

Replace only missing real tool call and response messages with their dumps to the specified format, and use them as plaintext messages. The tool calls whose definitions are not missing, will be left as real tool calls and responses.

Functions

Link copied to clipboard

Converts the given message by formatting specific types of tool-related messages (e.g., Message.Tool.Call and Message.Tool.Result) into descriptive messages. If the message is not a tool-related message, it remains unchanged.

Link copied to clipboard
abstract fun convertPrompt(prompt: Prompt, tools: List<ToolDescriptor>): Prompt

Converts a given Prompt by applying modifications based on the provided list of ToolDescriptor.