Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Dec 20, 2024
1 parent ea112cc commit 9dc588d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/http-api-bindings/src/embedding/llama.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use async_trait::async_trait;
use serde::{Deserialize, Serialize};
use tabby_inference::Embedding;
use tracing::{info_span, Instrument};
use tracing::Instrument;

use crate::{create_reqwest_client, embedding_info_span};

Expand Down
2 changes: 1 addition & 1 deletion crates/http-api-bindings/src/embedding/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ use core::panic;
use std::sync::Arc;

use llama::LlamaCppEngine;
use openai::OpenAIEmbeddingEngine;
use tabby_common::config::HttpModelConfig;
use tabby_inference::Embedding;

use super::rate_limit;
use openai::OpenAIEmbeddingEngine;

pub async fn create(config: &HttpModelConfig) -> Arc<dyn Embedding> {
let engine = match config.kind.as_str() {
Expand Down
8 changes: 6 additions & 2 deletions crates/http-api-bindings/src/embedding/openai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use async_trait::async_trait;
use reqwest::Client;
use serde::{Deserialize, Serialize};
use tabby_inference::Embedding;
use tracing::{info_span, Instrument};
use tracing::Instrument;

use crate::embedding_info_span;

Expand Down Expand Up @@ -108,7 +108,11 @@ mod tests {
#[ignore]
async fn test_voyage_embedding() {
let api_key = std::env::var("VOYAGE_API_KEY").expect("VOYAGE_API_KEY must be set");
let engine = OpenAIEmbeddingEngine::create("https://api.voyageai.com/v1", "voyage-code-2", Some(&api_key));
let engine = OpenAIEmbeddingEngine::create(
"https://api.voyageai.com/v1",
"voyage-code-2",
Some(&api_key),
);
let embedding = engine.embed("Hello, world!").await.unwrap();
assert_eq!(embedding.len(), 1536);
}

Check warning on line 118 in crates/http-api-bindings/src/embedding/openai.rs

View check run for this annotation

Codecov / codecov/patch

crates/http-api-bindings/src/embedding/openai.rs#L109-L118

Added lines #L109 - L118 were not covered by tests
Expand Down

0 comments on commit 9dc588d

Please sign in to comment.