Skip to main content

Crate lc_shared

Crate lc_shared 

Source
Expand description

Shared types for the langchainrust workspace.

This crate contains types that are needed by multiple sub-crates, breaking circular dependencies:

  • Tool types (ToolCall, FunctionCall, ToolCallResult): needed by both lc-schema (Message uses ToolCall) and lc-core (tool definitions).

  • Document types (Document, VectorDocument, SearchResult, ChunkDocument): needed by both lc-vector-stores and lc-rag.

  • Splitter types (TextSplitter, RecursiveCharacterSplitter): needed by both lc-vector-stores and lc-rag.

Re-exports§

pub use json_repair::parse_tolerant_json;
pub use json_repair::repair_json;
pub use json_repair::JsonRepairError;

Modules§

document
json_repair
Tolerant JSON parsing for LLM outputs.
splitter
tools

Structs§

ChunkDocument
Chunk document (split document fragment).
Document
Document structure.
FunctionCall
Function call inside a ToolCall
RecursiveCharacterSplitter
Recursive character splitter
SearchResult
Search result.
ToolCall
Tool call from LLM response
ToolCallResult
Tool call result to send back to LLM
VectorDocument
Vector document with embedding.

Traits§

TextSplitter
Text splitter trait