finic-ai / doctran

MIT License
491 stars 42 forks source link

Is it possible to support Azure OpenAI? #5

Closed Stark-X closed 1 year ago

clemlesne commented 1 year ago

deployment_id and model parameters are required for OpenAI SDK to talk to OpenAI instances on Azure.

The error I have is:

exception=InvalidRequestError(message="Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.chat_completion.ChatCompletion'>", param='engine', code=None, http_status=None, request_id=None)>

Integration examples:

openai.Embedding.create(
  deployment_id="xxx",
  input=prompt,
  model="xxx",
)

completion = openai.ChatCompletion.create(
  deployment_id="xxx",
  messages=messages,
  model="xxx",
)

Proposed integration:

ChatOpenAI(
  model_name="xxx",
  deployment_id="xxx",
  model="xxx",
)
EliasGitHub commented 1 year ago

I'm getting the same error @clemlesne . Is there any workaround to let us using Doctran with Azure OpenAI deployments like "gpt-35-turbo"? appreciate any help!!

maciejwie commented 1 year ago

I've created a PR to add Azure OpenAI support: #11

timxieICN commented 1 year ago

Do we have someone reviewing @maciejwie 's PR above?

Ayan-Bandyopadhyay commented 1 year ago

Merged just now

yb-sid commented 1 year ago

I'm still facing error after installing doctran via pip install doctran:

TypeError: init() got an unexpected keyword argument 'openai_deployment_id'