psychic-api / doctran

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to support Azure OpenAI?

Stark-X opened this issue · comments

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",
)

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!!

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

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

Merged just now

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

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