ballerinax/azure.openai.embeddings Ballerina library
This is a generated connector from Azure OpenAI Embeddings API OpenAPI specification.
The Azure OpenAI Service REST API Embeddings Endpoint will generate a vector representation of a given input that can be easily consumed by machine learning models and other algorithms.
- Create an Azure account
- Create an Azure OpenAI resource
- Deploy an appropriate model within the resource by referring to Deploy a model guide
- Obtain tokens by following Azure OpenAI Authentication guide
To use the Azure OpenAI Embeddings connector in your Ballerina application, update the .bal file as follows:
Step 1: Import connector
ballerinax/azure.openai.embeddings module into the Ballerina project.
Step 2: Create a new connector instance
Create and initialize an
embeddings:Client with the obtained
apiKey and a
serviceUrl containing the deployed models.
Step 3: Invoke connector operation
Now you can use the operations available within the connector.
Note: These operations are in the form of remote operations.
Following is an example on obtaining embeddings from a GPT-3 ada model:
bal runcommand to compile and run the Ballerina program.
Released date: 10 months ago
Ballerina version: 2201.4.1
GraalVM compatible: Yes
Current verison: 7