Vectorize
azure_openai_vectorize
azure_openai_vectorize(batch=None, api_key=None, azure_endpoint=None, api_version=None, model=os.environ['AZURE_OPENAI_DEPLOYMENT_EMBEDDINGS'], max_retries=5)
Generates vector embeddings of each string item in a list. Uses the Azure OpenAI service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
batch
|
List[str]
|
A list of strings to vectorize. |
None
|
api_key
|
str
|
Access key for the Azure OpenAI resource |
None
|
azure_endpoint
|
str
|
Your Azure endpoint, including the resource, e.g. https://example-resource.azure.openai.com/. if not provided will default to environment variable |
None
|
api_version
|
str
|
API version for Azure resource. |
None
|
model
|
str
|
Model deployment name within the Azure resource. If not provided will default to environment variable |
environ['AZURE_OPENAI_DEPLOYMENT_EMBEDDINGS']
|
max_retries
|
int
|
Maximum number of unsuccessful call attempts to the OpenAI service before returning an error. |
5
|
Returns:
Name | Type | Description |
---|---|---|
embeddings |
List[List[float]]
|
A list of vector embeddings |