Crate llm_toolkit

Crate llm_toolkit 

Source
Expand description

‘llm-toolkit’ - A low-level Rust toolkit for the LLM last mile problem.

This library provides a set of sharp, reliable, and unopinionated “tools” for building robust LLM-powered applications in Rust. It focuses on solving the common and frustrating problems that occur at the boundary between a strongly-typed Rust application and the unstructured, often unpredictable string-based responses from LLM APIs.

Re-exports§

pub use extract::FlexibleExtractor;
pub use extract::MarkdownCodeBlockExtractor;
pub use intent::frame::IntentFrame;
pub use intent::IntentError;
pub use intent::IntentExtractor;
pub use intent::PromptBasedExtractor;Deprecated
pub use multimodal::ImageData;
pub use prompt::PromptPart;
pub use prompt::PromptSetError;
pub use prompt::ToPrompt;
pub use prompt::ToPromptFor;
pub use prompt::ToPromptSet;

Modules§

extract
intent
Traits and implementations for extracting structured intents from LLM responses.
multimodal
Multimodal support for prompts, including image data handling.
prompt
A trait and macros for powerful, type-safe prompt generation.

Macros§

prompt
Creates a prompt string from a template and key-value pairs.

Functions§

extract_json
Extracts a JSON string from a raw LLM response string.
extract_markdown_block
Extracts content from any Markdown code block in the text.
extract_markdown_block_with_lang
Extracts content from a Markdown code block with a specific language.