Skip to content

@chinmaymk/aikit v0.0.40


@chinmaymk/aikit / openaiEmbeddings

Function: openaiEmbeddings()

openaiEmbeddings(config, texts): Promise<EmbeddingResponse>

Defined in: providers/openai_embeddings.ts:61

Direct OpenAI embeddings function - no configuration step needed

Parameters

config

WithApiKey<OpenAIEmbeddingOptions>

texts

string[]

Returns

Promise<EmbeddingResponse>

Example

typescript
const result = await openaiEmbeddings(
  { apiKey: '...', model: 'text-embedding-3-small' },
  ['Hello world']
);

Released under the MIT License.