feat: Add create_embeddings function to Jina client
- Added a `create_embeddings` function to the Jina client to generate embeddings for given input texts. - Improved the `create_embeddings` function input parameters for better flexibility and error handling. - Updated `TextEmbeddingInput` struct to handle optional parameters for embedding type, truncation type, and late chunking. This improves the flexibility of the embedding generation process.
This commit is contained in:
@@ -2,5 +2,12 @@
|
||||
|
||||
import freeflowuniverse.herolib.clients.jina
|
||||
|
||||
jina_client := jina.get()!
|
||||
println('jina: ${jina_client}')
|
||||
mut jina_client := jina.get()!
|
||||
|
||||
embeddings := jina_client.create_embeddings(
|
||||
input: ['Hello', 'World']
|
||||
model: .embeddings_v3
|
||||
task: 'separation'
|
||||
) or { panic('Error while creating embeddings: ${err}') }
|
||||
|
||||
println('Created embeddings: ${embeddings}')
|
||||
|
||||
Reference in New Issue
Block a user