Files
herolib/examples/clients/jina.vsh
Mahmoud Emad 7965883744 feat: Enhance Jina client with additional embedding parameters
- 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.
2025-03-11 17:45:55 +02:00

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}')