Embeddings
Get a vector representation of a given input.
npm i @xsai/embedExamples
embed
import { } from '@xsai/embed'
import { } from 'node:process'
const { } = await ({
: .!,
: 'https://api.openai.com/v1/',
: 'sunny day at the beach',
: 'text-embedding-3-large',
})embedMany
import { } from '@xsai/embed'
import { } from 'node:process'
const { } = await ({
: .!,
: 'https://api.openai.com/v1/',
: [
'sunny day at the beach',
'rainy afternoon in the city',
'snowy night in the mountains',
],
: 'text-embedding-3-large'
})