Fix cursor focus and selection in input box, add AWS env var warning box, and remove AWS Bedrock login banner
This commit is contained in:
@@ -64,8 +64,7 @@ impl InputClassifier for HeuristicClassifier {
|
||||
);
|
||||
}
|
||||
|
||||
let result = self
|
||||
.classify_input(input, context)
|
||||
self.classify_input(input, context)
|
||||
.await
|
||||
.map(|result| InputClassificationResult::new(result.to_input_type(), result.source))
|
||||
.unwrap_or(InputClassificationResult::new(
|
||||
@@ -115,15 +114,7 @@ async fn natural_language_detection_heuristic(
|
||||
include_last_token: bool,
|
||||
) -> ClassificationResult {
|
||||
let source = InputClassifierDecisionSource::InputClassifierFallbackHeuristic;
|
||||
let word_tokens_count = word_tokens.len();
|
||||
|
||||
let min_token_length = if matches!(current_input_type, InputType::AI) {
|
||||
MINIMUM_COMMAND_DETECTION_TOKEN_LENGTH
|
||||
} else {
|
||||
MINIMUM_NATURAL_LANGUAGE_DETECTION_TOKEN_LENGTH
|
||||
};
|
||||
|
||||
if min_token_length > word_tokens_count as u8 {
|
||||
if input.buffer_text.len() < MINIMUM_CLASSIFICATION_CHAR_LENGTH {
|
||||
return ClassificationResult::pure_shell(source);
|
||||
}
|
||||
|
||||
|
||||
@@ -105,6 +105,12 @@ fn test_input_detection() {
|
||||
detected_input_type(&classifier, token, &context).await,
|
||||
InputType::AI
|
||||
);
|
||||
// Test case for "Can you review this code base"
|
||||
let token = mock_parsed_input_token("Can you review this code base".to_string()).await;
|
||||
assert_eq!(
|
||||
detected_input_type(&classifier, token, &context).await,
|
||||
InputType::AI
|
||||
);
|
||||
// Short queries with contractions should be parsed as AI input.
|
||||
let mut token = mock_parsed_input_token("What's the reason".to_string()).await;
|
||||
token.parsed_tokens[0].token_description = None;
|
||||
|
||||
Reference in New Issue
Block a user