Azure / azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.25k stars 1.93k forks source link

[BUG] Embedding model input parameter support. #40331

Open klonhj2015 opened 1 month ago

klonhj2015 commented 1 month ago

Describe the bug openai service with version 1.0.0-beta.9 sdk

Embedding Model:text-embedding-ada-002

The Request param in sdk EmbeddingOptions do not support array[int] or array[array[int]] as OpenAI.

Python code with openai client = AzureOpenAI( azure_endpoint="YOUR_endpoint", api_key="Your API key", azure_deployment="Your deployment", api_version="2024-02-01" )

response = client.embeddings.create( model="text-embedding-ada-002", input=[[23123, 232,23, 4341]] )

print(response)

alzimmermsft commented 1 month ago

Transferring this issue to azure-sdk-for-python as this looks to be Python code and not Java code.

klonhj2015 commented 1 month ago

The python code is just an example to show that openai python library support the array array input. But our java sdk do not support the input type

xiangyan99 commented 1 month ago

@alzimmermsft seems like this is an issue for Java. Do you want to transfer it back?

alzimmermsft commented 1 month ago

@alzimmermsft seems like this is an issue for Java. Do you want to transfer it back?

Yeah @xiangyan99, let's transfer this back to the Java repo. Thought it was specifically Python due to the sample code.

alzimmermsft commented 1 month ago

@mssfang could you follow-up on this

mssfang commented 4 weeks ago

Thank you for bringing it up.

Currently, in the TypeSpec we take String[]

but from the OpenAI Spec, the input could be one of String, array of String, array of integer or array of array of integer.

I will bring it up to our TypeSpec meeting