cognis-core 0.2.1

Core traits and types for the Cognis LLM framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use async_trait::async_trait;

use crate::error::Result;

/// Interface for embedding models.
#[async_trait]
pub trait Embeddings: Send + Sync {
    /// Embed a list of documents.
    async fn embed_documents(&self, texts: Vec<String>) -> Result<Vec<Vec<f32>>>;

    /// Embed a single query text.
    async fn embed_query(&self, text: &str) -> Result<Vec<f32>>;
}