Skip to content

Commit

Permalink
docs(inference): document completion layered traits (#3340)
Browse files Browse the repository at this point in the history
* chore(doc): clear completion layered architecture

* chore: fix grammer

Co-authored-by: Meng Zhang <[email protected]>

---------

Co-authored-by: Meng Zhang <[email protected]>
  • Loading branch information
zwpaper and wsxiaoys authored Oct 30, 2024
1 parent 5098234 commit 86132a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/tabby-inference/src/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ pub struct CodeGenerationOptions {
pub language: Option<&'static Language>,
}

/// CodeGeneration utilizes the CompletionStream to generate code completions.
/// It employs the StopConditionFactory to maintain a list of stop conditions by language, then
/// reads and decodes the stream, ceasing code generation when a stop condition is met.
pub struct CodeGeneration {
imp: Arc<dyn CompletionStream>,
stop_condition_factory: StopConditionFactory,
Expand Down
3 changes: 3 additions & 0 deletions crates/tabby/src/services/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ pub struct DebugData {
prompt: Option<String>,
}

/// CompletionService enhances the CodeGeneration feature by adding Retrieval Augmented Code Completion capability.
/// It enables the retrieval of pertinent code snippets from the code repository,
/// which are then utilized as prompts for the code generation model.
pub struct CompletionService {
config: CompletionConfig,
engine: Arc<CodeGeneration>,
Expand Down

0 comments on commit 86132a8

Please sign in to comment.