Rebrand to Galaxy, major improvements to Bedrock support, still needs some TLC though
This commit is contained in:
@@ -66,7 +66,7 @@ fn get_binary_confidence_color(is_correct: bool, is_low_confidence: bool) -> Str
|
||||
"\x1b[31m".to_string() // Red for incorrect
|
||||
}
|
||||
}
|
||||
use warp_completer::{ParsedTokensSnapshot, util::parse_current_commands_and_tokens};
|
||||
use galaxy_completer::{ParsedTokensSnapshot, util::parse_current_commands_and_tokens};
|
||||
|
||||
#[cfg(feature = "fasttext")]
|
||||
use input_classifier::FasttextClassifier;
|
||||
|
||||
@@ -52,7 +52,7 @@ impl FasttextClassifier {
|
||||
impl InputClassifier for FasttextClassifier {
|
||||
async fn detect_input_type(
|
||||
&self,
|
||||
input: warp_completer::ParsedTokensSnapshot,
|
||||
input: galaxy_completer::ParsedTokensSnapshot,
|
||||
context: &Context,
|
||||
) -> InputType {
|
||||
let word_tokens = parse_query_into_tokens(input.buffer_text.as_str());
|
||||
@@ -80,7 +80,7 @@ impl InputClassifier for FasttextClassifier {
|
||||
|
||||
async fn classify_input(
|
||||
&self,
|
||||
input: warp_completer::ParsedTokensSnapshot,
|
||||
input: galaxy_completer::ParsedTokensSnapshot,
|
||||
context: &Context,
|
||||
) -> anyhow::Result<ClassificationResult> {
|
||||
if let Ok(classification_result) =
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::borrow::Cow;
|
||||
use async_trait::async_trait;
|
||||
use itertools::Itertools as _;
|
||||
use natural_language_detection::natural_language_words_score;
|
||||
use warp_completer::ParsedTokensSnapshot;
|
||||
use galaxy_completer::ParsedTokensSnapshot;
|
||||
|
||||
use crate::{
|
||||
ClassificationResult, Context, InputClassifier, InputType,
|
||||
@@ -61,7 +61,7 @@ impl InputClassifier for HeuristicClassifier {
|
||||
|
||||
async fn classify_input(
|
||||
&self,
|
||||
input: warp_completer::ParsedTokensSnapshot,
|
||||
input: galaxy_completer::ParsedTokensSnapshot,
|
||||
context: &Context,
|
||||
) -> anyhow::Result<super::ClassificationResult> {
|
||||
let word_tokens = parse_query_into_tokens(input.buffer_text.as_str());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use warp_completer::util::parse_current_commands_and_tokens;
|
||||
use galaxy_completer::util::parse_current_commands_and_tokens;
|
||||
|
||||
use crate::{Context, test_utils::CompletionContext};
|
||||
|
||||
|
||||
@@ -24,13 +24,13 @@ pub use onnx::{Model as OnnxModel, OnnxClassifier};
|
||||
pub trait InputClassifier: 'static + Send + Sync {
|
||||
async fn detect_input_type(
|
||||
&self,
|
||||
input: warp_completer::ParsedTokensSnapshot,
|
||||
input: galaxy_completer::ParsedTokensSnapshot,
|
||||
context: &Context,
|
||||
) -> InputType;
|
||||
|
||||
async fn classify_input(
|
||||
&self,
|
||||
input: warp_completer::ParsedTokensSnapshot,
|
||||
input: galaxy_completer::ParsedTokensSnapshot,
|
||||
context: &Context,
|
||||
) -> anyhow::Result<ClassificationResult>;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ use candle_core::{IndexOp as _, Tensor};
|
||||
use candle_onnx::onnx::ModelProto;
|
||||
use prost::Message as _;
|
||||
use tokenizers::Tokenizer;
|
||||
use warp_completer::ParsedTokensSnapshot;
|
||||
use galaxy_completer::ParsedTokensSnapshot;
|
||||
|
||||
use super::ClassificationResult;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ use std::borrow::Cow;
|
||||
use anyhow::Result;
|
||||
use async_trait::async_trait;
|
||||
use rust_embed::RustEmbed;
|
||||
use warp_completer::ParsedTokensSnapshot;
|
||||
use galaxy_completer::ParsedTokensSnapshot;
|
||||
|
||||
use crate::{
|
||||
ClassificationResult, Context, InputClassifier, InputType,
|
||||
@@ -119,7 +119,7 @@ impl InputClassifier for OnnxClassifier {
|
||||
|
||||
async fn classify_input(
|
||||
&self,
|
||||
input: warp_completer::ParsedTokensSnapshot,
|
||||
input: galaxy_completer::ParsedTokensSnapshot,
|
||||
_context: &Context,
|
||||
) -> anyhow::Result<ClassificationResult> {
|
||||
// If we ever panicked while running inference, we should fall back to the heuristic classifier.
|
||||
|
||||
@@ -6,7 +6,7 @@ use ort::{
|
||||
};
|
||||
use parking_lot::Mutex;
|
||||
use tokenizers::Tokenizer;
|
||||
use warp_completer::ParsedTokensSnapshot;
|
||||
use galaxy_completer::ParsedTokensSnapshot;
|
||||
|
||||
use super::ClassificationResult;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::{collections::HashSet, sync::Arc};
|
||||
|
||||
use smol_str::SmolStr;
|
||||
use warp_completer::{
|
||||
use galaxy_completer::{
|
||||
completer::{GeneratorContext, PathCompletionContext},
|
||||
signatures::CommandRegistry,
|
||||
};
|
||||
@@ -20,7 +20,7 @@ impl CompletionContext {
|
||||
}
|
||||
}
|
||||
|
||||
impl warp_completer::completer::CompletionContext for CompletionContext {
|
||||
impl galaxy_completer::completer::CompletionContext for CompletionContext {
|
||||
fn top_level_commands(&self) -> Box<dyn Iterator<Item = &str> + '_> {
|
||||
Box::new(self.command_registry.registered_commands())
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::collections::HashSet;
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
use natural_language_detection::check_if_token_has_shell_syntax;
|
||||
use warp_completer::ParsedTokensSnapshot;
|
||||
use galaxy_completer::ParsedTokensSnapshot;
|
||||
|
||||
/// The percentage of input tokens that can be described by our completion engine before
|
||||
/// we consider the input as a shell command. This could be tuned.
|
||||
|
||||
Reference in New Issue
Block a user