| Crates.io | langchainrust |
| lib.rs | langchainrust |
| version | 0.1.1 |
| created_at | 2026-01-05 15:21:45.718192+00 |
| updated_at | 2026-01-18 12:27:25.923494+00 |
| description | A LangChain-inspired framework for building LLM applications in Rust. |
| homepage | https://github.com/atliliw/langchainrust |
| repository | https://github.com/atliliw/langchainrust |
| max_upload_size | |
| id | 2024037 |
| size | 136,447 |
一个受 LangChain 启发的 Rust 框架,用于构建基于大模型(LLM)的应用:提示词模板(Prompt Template)、链式调用(Chains)、工具调用(Tools)、Agent、Memory、检索(Retrieval)等。
详细使用文档:https://github.com/atliliw/langchainrust/blob/main/docs/USAGE.md
PromptTemplate:字符串模板 {var} 替换ChatPromptTemplate:多角色消息模板(system/user/assistant)SimpleMemory:简易历史记录(可用于注入对话上下文)PromptChain:使用 ChatPromptTemplate + LLM 生成输出SequentialChain:串联多个 Chain,并可将 memory 作为 chat_history 注入Tool trait、Calculator、WeatherToolReActAgent + AgentExecutorChatPromptTemplate)cargo add langchainrust
OPENAI_API_KEY)OpenAIConfig.streaming=true 会走流式 API;否则走非流式cargo test
更多用法与示例:
MIT OR Apache-2.0