- Add `type_`, `truncate`, and `late_chunking` parameters to the `create_embeddings` function for finer control over embedding generation. This allows users to specify embedding type, truncation method, and whether to apply late chunking. - Rename model parameter to `model` for clarity and consistency. - Improve model enum naming for better readability and API consistency. - Add unit tests for the `create_embeddings` function to ensure correct functionality and handle potential errors.
14 lines
383 B
GLSL
Executable File
14 lines
383 B
GLSL
Executable File
#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run
|
|
|
|
import freeflowuniverse.herolib.clients.jina
|
|
|
|
mut jina_client := jina.get()!
|
|
|
|
embeddings := jina_client.create_embeddings(
|
|
input: ['Hello', 'World']
|
|
model: .jina_embeddings_v3
|
|
task: 'separation'
|
|
) or { panic('Error while creating embeddings: ${err}') }
|
|
|
|
println('Created embeddings: ${embeddings}')
|