Notebooks
A
Azure
Get Embeddings

Get Embeddings

azure-openai-samplesBasic_Samplesdotnetembeddingscsharp

Get embeddings from dataset

This notebook gives an example on how to get embeddings text.

Installation

Install the Azure Open AI SDK using the below command.

[2]
[1]

Run this cell, it will prompt you for the apiKey, endPoint, and embedding deployment

[5]

Import namesapaces and create an instance of OpenAiClient using the azureOpenAIEndpoint and the azureOpenAIKey

[3]
[6]

Create some text

[5]

Create text embeddings using the deployment

[6]

Generate a single request with a batch of inputs, this is more efficient and saves api calls

Use Linq extension Chuck to split the source collection into chunks of at most size 4 and perform back requests.

[7]