new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

jina-ai/capabilities

7 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Jina text embedding model factory method

Create text embedding models using the .embeddingModel() factory method on the jina provider instance. Example: jina.embeddingModel('jina-embeddings-v3')

Jina text embedding example

Example of generating text embeddings with Jina: import { jina } from 'jina-ai-provider'; import { embedMany } from 'ai'; const embeddingModel = jina.embeddingModel('jina-embeddings-v3'); export const generateEmbeddings = async (value: string): Promise<Array<{ embedding: number[]; content: string }>> => { const chunks = value.split('\n'); const { embeddings } = await embedMany({ model: embeddingModel, values: chunks, providerOptions: { jina: { inputType: 'retrieval.passage', }, }, }); return embeddings.map((embedding, index) => ({ content: chunks[index]!, embedding, })); };

Jina multimodal embedding model factory method

Create multimodal (text + image) embedding models using the .multiModalEmbeddingModel() factory method on the jina provider instance. Example: jina.multiModalEmbeddingModel('jina-clip-v2')

Jina multimodal embedding example

Example of generating multimodal embeddings with Jina: import { jina, type MultimodalEmbeddingInput } from 'jina-ai-provider'; import { embedMany } from 'ai'; const multimodalModel = jina.multiModalEmbeddingModel('jina-clip-v2'); export const generateMultimodalEmbeddings = async () => { const values: MultimodalEmbeddingInput[] = [ { text: 'A beautiful sunset over the beach' }, { image: 'https://i.ibb.co/r5w8hG8/beach2.jpg' }, ]; const { embeddings } = await embedMany<MultimodalEmbeddingInput>({ model: multimodalModel, values, }); return embeddings.map((embedding, index) => ({ content: values[index]!, embedding, })); };

Jina text embedding input formats

Text embeddings support array of strings input format, for example: const strings = ['text1', 'text2']

Jina multimodal embedding input formats

Multimodal embeddings support the following input formats: Text objects like { text: 'Your text here' }. Image objects like { image: 'https://example.com/image.jpg' } or Base64 data URLs in format data:image/jpeg;base64,... Mixed arrays containing any combination of text and image objects.

Jina multimodal embedding input with Base64 images

When using Jina multimodal embeddings, Base64 encoded images can be passed to the image property in the Data URL format: data:[mediatype];base64,<data>

Give your agent this brain