swiftide_integrations/lib.rs
1//! Integrations with LLM providers, embedding models, storage backends and other services.
2//!
3//! Every integration sits behind its own cargo feature (for example `openai`, `anthropic`,
4//! `ollama`, `qdrant`, `pgvector`, `lancedb`, `redis`, `tree-sitter`, `fastembed`, `scraping`),
5//! so only what you enable gets compiled. Each one implements the traits from `swiftide-core`,
6//! such as `ChatCompletion`, `SimplePrompt`, `EmbeddingModel`, `Persist`, `Retrieve` or `Loader`,
7//! which makes it usable from indexing pipelines, query pipelines and agents alike.
8//!
9//! The [`swiftide`](https://docs.rs/swiftide) facade re-exports this crate as
10//! `swiftide::integrations` and forwards the same feature names.
11//!
12//! Guides: [integrations](https://swiftide.rs/integrations/) and
13//! [models](https://swiftide.rs/models/).
14//!
15//! ```no_run
16//! # #[cfg(feature = "openai")]
17//! # fn build() -> anyhow::Result<()> {
18//! let openai_client = swiftide_integrations::openai::OpenAI::builder()
19//! .default_embed_model("text-embedding-3-small")
20//! .default_prompt_model("gpt-4o")
21//! .build()?;
22//! # Ok(())
23//! # }
24//! ```
25// show feature flags in the generated documentation
26// https://doc.rust-lang.org/rustdoc/unstable-features.html#extensions-to-the-doc-attribute
27#![cfg_attr(docsrs, feature(doc_cfg))]
28#![cfg_attr(docsrs, doc(auto_cfg))]
29#![doc(html_logo_url = "https://github.com/bosun-ai/swiftide/raw/master/images/logo.png")]
30
31#[cfg(feature = "anthropic")]
32pub mod anthropic;
33#[cfg(feature = "aws-bedrock")]
34pub mod aws_bedrock_v2;
35#[cfg(feature = "dashscope")]
36pub mod dashscope;
37#[cfg(feature = "duckdb")]
38pub mod duckdb;
39#[cfg(feature = "fastembed")]
40pub mod fastembed;
41#[cfg(feature = "fluvio")]
42pub mod fluvio;
43#[cfg(feature = "gemini")]
44pub mod gemini;
45#[cfg(feature = "groq")]
46pub mod groq;
47#[cfg(feature = "kafka")]
48pub mod kafka;
49#[cfg(feature = "lancedb")]
50pub mod lancedb;
51#[cfg(feature = "ollama")]
52pub mod ollama;
53#[cfg(feature = "open-router")]
54pub mod open_router;
55#[cfg(feature = "openai")]
56pub mod openai;
57#[cfg(feature = "parquet")]
58pub mod parquet;
59#[cfg(feature = "pgvector")]
60pub mod pgvector;
61#[cfg(feature = "qdrant")]
62pub mod qdrant;
63#[cfg(feature = "redb")]
64pub mod redb;
65#[cfg(feature = "redis")]
66pub mod redis;
67#[cfg(feature = "scraping")]
68pub mod scraping;
69#[cfg(feature = "tiktoken")]
70pub mod tiktoken;
71#[cfg(feature = "tree-sitter")]
72pub mod treesitter;