mirror of
https://github.com/perstarkse/minne.git
synced 2026-07-02 19:11:43 +02:00
chore: doctests fixes
This commit is contained in:
@@ -30,23 +30,6 @@ use crate::storage::types::{knowledge_entity::KnowledgeEntity, StoredObject};
|
|||||||
/// This function will return a `Error` if:
|
/// This function will return a `Error` if:
|
||||||
/// * The database query fails to execute
|
/// * The database query fails to execute
|
||||||
/// * The results cannot be deserialized into type `T`
|
/// * The results cannot be deserialized into type `T`
|
||||||
///
|
|
||||||
/// # Example
|
|
||||||
///
|
|
||||||
/// ```rust
|
|
||||||
/// #[derive(serde::Deserialize)]
|
|
||||||
/// struct KnowledgeEntity {
|
|
||||||
/// id: String,
|
|
||||||
/// source_id: String,
|
|
||||||
/// // ... other fields
|
|
||||||
/// }
|
|
||||||
///
|
|
||||||
/// let results = find_entities_by_source_id::<KnowledgeEntity>(
|
|
||||||
/// "source123".to_string(),
|
|
||||||
/// "knowledge_entity".to_string(),
|
|
||||||
/// &db_client
|
|
||||||
/// ).await?;
|
|
||||||
/// ```
|
|
||||||
pub async fn find_entities_by_source_ids<T>(
|
pub async fn find_entities_by_source_ids<T>(
|
||||||
source_id: Vec<String>,
|
source_id: Vec<String>,
|
||||||
table_name: String,
|
table_name: String,
|
||||||
|
|||||||
@@ -25,14 +25,6 @@ use crate::error::ProcessingError;
|
|||||||
/// * If the OpenAI API request fails
|
/// * If the OpenAI API request fails
|
||||||
/// * If the request building fails
|
/// * If the request building fails
|
||||||
/// * If no embedding data is received in the response
|
/// * If no embedding data is received in the response
|
||||||
///
|
|
||||||
/// # Example
|
|
||||||
///
|
|
||||||
/// ```rust
|
|
||||||
/// let client = async_openai::Client::new();
|
|
||||||
/// let text = String::from("Hello, world!");
|
|
||||||
/// let embedding = generate_embedding(&client, text).await?;
|
|
||||||
/// ```
|
|
||||||
pub async fn generate_embedding(
|
pub async fn generate_embedding(
|
||||||
client: &async_openai::Client<async_openai::config::OpenAIConfig>,
|
client: &async_openai::Client<async_openai::config::OpenAIConfig>,
|
||||||
input: String,
|
input: String,
|
||||||
|
|||||||
Reference in New Issue
Block a user