Make text embedding title optional

- Make text embedding title optional, as sending it causes erros
on tasks that don't support title, like CLASSIFICATION.
- Update dependencies
This commit is contained in:
2024-04-15 11:10:11 +01:00
parent 5de4a96d33
commit 0e219aded0
4 changed files with 12 additions and 11 deletions

View File

@@ -21,12 +21,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let embedding_request = TextEmbeddingRequest {
instances: vec![
TextEmbeddingRequestInstance {
title: String::from("Embed testing"),
title: Some(String::from("Embed testing")),
content: String::from("Embed testing"),
task_type: String::from("RETRIEVAL_DOCUMENT"),
},
TextEmbeddingRequestInstance {
title: String::from("Embed testing 2"),
title: Some(String::from("Embed testing 2")),
content: String::from("Embed testing 2"),
task_type: String::from("RETRIEVAL_DOCUMENT"),
},