From 86132a88d9779c777e860d039819b923d330e80f Mon Sep 17 00:00:00 2001 From: Wei Zhang Date: Thu, 31 Oct 2024 02:06:51 +0800 Subject: [PATCH] docs(inference): document completion layered traits (#3340) * chore(doc): clear completion layered architecture * chore: fix grammer Co-authored-by: Meng Zhang --------- Co-authored-by: Meng Zhang --- crates/tabby-inference/src/code.rs | 3 +++ crates/tabby/src/services/completion.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/crates/tabby-inference/src/code.rs b/crates/tabby-inference/src/code.rs index 2d420053bf42..d001b870e021 100644 --- a/crates/tabby-inference/src/code.rs +++ b/crates/tabby-inference/src/code.rs @@ -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, stop_condition_factory: StopConditionFactory, diff --git a/crates/tabby/src/services/completion.rs b/crates/tabby/src/services/completion.rs index 86f874fdea7f..b771bf82d909 100644 --- a/crates/tabby/src/services/completion.rs +++ b/crates/tabby/src/services/completion.rs @@ -241,6 +241,9 @@ pub struct DebugData { prompt: Option, } +/// 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,