Skip to content

Commit

Permalink
feat: turn on index server if avaiable (TabbyML#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys authored Oct 11, 2023
1 parent 1f9e248 commit 92c1f5a
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions crates/tabby/src/serve/completions/prompt.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{env, sync::Arc};
use std::sync::Arc;

use strfmt::strfmt;
use tracing::{info, warn};
use tracing::warn;

use super::Segments;
use crate::serve::{completions::languages::get_language, search::IndexServer};
Expand All @@ -17,13 +17,6 @@ pub struct PromptBuilder {

impl PromptBuilder {
pub fn new(prompt_template: Option<String>, index_server: Option<Arc<IndexServer>>) -> Self {
let index_server = if env::var("TABBY_ENABLE_PROMPT_REWRITE").is_ok() {
info!("Prompt rewriting is enabled...");
index_server
} else {
None
};

PromptBuilder {
prompt_template,
index_server,
Expand Down

0 comments on commit 92c1f5a

Please sign in to comment.