Skip to content

Commit

Permalink
docs(swiftide): documentation improvements and cleanup (#176)
Browse files Browse the repository at this point in the history
- **chore: remove ingestion stream**
- **Documentation and grammar**
  • Loading branch information
timonv authored Jul 15, 2024
1 parent 73d5fa3 commit b95b395
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 94 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ indexing::Pipeline::from_loader(FileLoader::new(".").with_extensions(&["rs"]))
.await?;
```

_You can find more examples in [/examples](https://github.com/bosun-ai/swiftide/tree/master/examples)_

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## Features
Expand Down
4 changes: 2 additions & 2 deletions swiftide/src/indexing/indexing_stream.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![allow(clippy::from_over_into)]
#![cfg(not(tarpaulin_include))]
//! This module defines the `IndexingStream` type, which is used for handling asynchronous streams of `Node` items in the indexing pipeline.

//! This module defines the `IndexingStream` type, which is used internally by a pipeline for handling asynchronous streams of `Node` items in the indexing pipeline.
use anyhow::Result;
use futures_util::stream::{self, Stream};
Expand Down Expand Up @@ -73,7 +74,6 @@ impl IndexingStream {
}
}

// NOTE: Can we really guarantee that the iterator will outlive the stream?
pub fn iter<I>(iter: I) -> Self
where
I: IntoIterator<Item = Result<Node>> + Send + 'static,
Expand Down
10 changes: 6 additions & 4 deletions swiftide/src/indexing/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Default for Pipeline {
}

impl Pipeline {
/// Creates an `Pipeline` from a given loader.
/// Creates a `Pipeline` from a given loader.
///
/// # Arguments
///
Expand All @@ -53,7 +53,7 @@ impl Pipeline {
}
}

/// Creates an `Pipeline` from a given stream.
/// Creates a `Pipeline` from a given stream.
///
/// # Arguments
///
Expand All @@ -69,7 +69,8 @@ impl Pipeline {
}
}

/// Sets the concurrency level for the pipeline.
/// Sets the concurrency level for the pipeline. By default the concurrency is set to the
/// number of cpus.
///
/// # Arguments
///
Expand All @@ -84,7 +85,8 @@ impl Pipeline {
self
}

/// Sets the embed mode for the pipeline.
/// Sets the embed mode for the pipeline. The embed mode controls what (combination) fields of a [`Node`]
/// be embedded with a vector when transforming with [`crate::transformers::Embed`]
///
/// See also [`super::node::EmbedMode`].
///
Expand Down
85 changes: 0 additions & 85 deletions swiftide/src/ingestion/ingestion_stream.rs

This file was deleted.

2 changes: 1 addition & 1 deletion swiftide/src/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub enum PromptTemplate {
}

impl<'tmpl> PromptTemplate {
/// Creates a reference to a template stored in the repository
/// Creates a reference to a template already stored in the repository
pub fn from_compiled_template_name(name: impl Into<String>) -> PromptTemplate {
PromptTemplate::CompiledTemplate(name.into())
}
Expand Down
7 changes: 5 additions & 2 deletions swiftide/src/transformers/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
//! Various transformers for chunking, embedding and transforming data
//!
//! These transformers are generic over their implementation. In most cases you will also need
//! to enable integrations.
//! These transformers are generic over their implementation and many require an
//! [`crate::integrations`] to be configured.
//!
//! Transformers that prompt have a default prompt configured. Prompts can be customized
//! and tailored, supporting Jinja style templating based on [`terra`]. See [`crate::prompt::Prompt`] and [`crate::prompt::PromptTemplate`]
#[cfg(feature = "tree-sitter")]
pub mod chunk_code;
Expand Down

0 comments on commit b95b395

Please sign in to comment.