camel icon indicating copy to clipboard operation
camel copied to clipboard

[Feature Request] Support `Azure` OpenAI models

Open lightaime opened this issue 1 year ago • 3 comments

Required prerequisites

  • [X] I have searched the Issue Tracker and Discussions that this hasn't already been reported. (+1 or comment there if it has.)
  • [X] Consider asking first in a Discussion.

Motivation

People are interested in setting up Azure OpenAI models. We can add Azure OpenAI models to https://github.com/camel-ai/camel/tree/master/camel/models.

Solution

No response

Alternatives

No response

Additional context

No response

lightaime avatar Jul 24 '23 13:07 lightaime

@hammoudhasan can you take this issue? It is related to what we will do.

lightaime avatar Aug 18 '23 01:08 lightaime

@lightaime, @hammoudhasan: I think the code needs to be changed in 3 places, but I do not understand the code well enough to implement it in a nice way and create a PR for it. I got it to work by hard-coding values in each location.

In apps/agents/agents.py and camel/models/openai_model.py, openai.api_key = ... needs to be complemented with openai.api_base = "https://<example-endpoint>.openai.azure.com". In camel/configs.py, the ChatGPTConfig class needs to be extended with the variable deployment_id: str = "<name of the deployment>".

Adding openai.api_type = ... and openai.api_version = ... was not necessary.

qiviut avatar Oct 27 '23 06:10 qiviut

Hi, @lightaime , I have integrated Azure OpenAI API into Camel and updated the corresponding files. Would it be okay for me to make a pull request?

L4zyy avatar Dec 06 '23 19:12 L4zyy

finished https://github.com/camel-ai/camel/pull/733

Wendong-Fan avatar Jul 23 '24 17:07 Wendong-Fan