Expand description
Core traits, types and pipeline plumbing shared by all Swiftide crates.
Most users should depend on the swiftide facade crate, which
re-exports this crate’s public API under swiftide::traits, swiftide::chat_completion,
swiftide::prompt, swiftide::indexing and swiftide::query. Depend on swiftide-core
directly when building your own integration and you only need the contracts.
What lives here:
- Indexing contracts:
Loader,Transformer,BatchableTransformer,ChunkerTransformer,PersistandNodeCache, plusindexing::Nodeandindexing::IndexingStream. - Query contracts:
TransformQuery,Retrieve,TransformResponse,AnswerandEvaluateQuery, plus the query states and search strategies inquerying. - Model contracts:
SimplePrompt,EmbeddingModel,SparseEmbeddingModelandChatCompletion, with chat messages and tool schemas inchat_completion. - Agent contracts:
AgentContext,MessageHistory,ToolExecutor, and prompt templating inprompt.
Re-exports§
pub use crate::agent_traits::AgentContext;pub use crate::agent_traits::MessageHistory;pub use crate::agent_traits::ToolFeedback;pub use type_aliases::*;pub use crate::chat_completion::traits::*;pub use crate::command_output::*;pub use crate::indexing_traits::*;pub use crate::query_traits::*;pub use crate::token_estimation::*;pub use crate::tool_executor::*;pub use crate::indexing_decorators::*;
Modules§
- agent_
traits - chat_
completion - This module enables the implementation of chat completion on LLM providers
- command_
output - Command output that retains stdout and stderr identity in observed order.
- document
- Documents are the main data structure that is retrieved via the query pipeline
- indexing
- indexing_
decorators - indexing_
traits - Traits in Swiftide allow for easy extendability
- metrics
metrics - prelude
- Re-export of commonly used dependencies.
- prompt
- Prompts templating and management
- query_
traits - querying
- statistics
- Pipeline statistics collection for monitoring and observability Pipeline statistics collection
- test_
utils test-utils - token_
estimation - tool_
executor - type_
aliases - util
- Utility functions for Swiftide
Macros§
- assert_
default_ prompt_ snapshot test-utils