Expand description
§Observability
The crate is instrumented with tracing: every LLM call runs in an llm.generate
span (provider, model, token usage, tool call count, error), embeddings in
embed.documents / embed.query, LLMChain in chain.call, and agent runs in
agent.run with an agent.plan span per step and a tool.call span per tool.
Install any subscriber (tracing-subscriber, OpenTelemetry, Langfuse…) to see them.
Without one, log events are forwarded to the log crate, so
env_logger keeps working.
Re-exports§
pub use url;
Modules§
- agent
- chain
- document_
loaders - embedding
- language_
models - llm
- memory
- output_
parsers - Output parsers.
- prompt
- schemas
- semantic_
router - text_
splitter - tools
- vectorstore
Macros§
- add_
documents - fmt_
message fmt_messageis a utility macro used to create aMessageOrTemplate::Messagevariant.- fmt_
placeholder fmt_placeholderis a utility macro used to create aMessageOrTemplate::MessagesPlaceholdervariant.- fmt_
template fmt_templateis a utility macro used to create aMessageOrTemplate::Templatevariant.- message_
formatter - Example
- prompt_
args prompt_args!is a utility macro used for creating astd::collections::HashMap<String, serde_json::Value>. This HashMap can then be passed as arguments to a function or method.- sequential_
chain - similarity_
search - template_
fstring template_fstringis a utility macro that creates a newPromptTemplatewith FString as the template format.- template_
jinja2 template_jinja2is a utility macro that creates a newPromptTemplatewith Jinja2 as the template format.