confident-ai / deepeval

The LLM Evaluation Framework
https://docs.confident-ai.com/
Apache License 2.0
3.78k stars 300 forks source link

Missing API key and endpoint configuration...(etc) in OpenAI() and support for Azure OpenAI #1086

Open NaraSyuhei opened 1 month ago

NaraSyuhei commented 1 month ago

Hi

Thank you for your continued efforts on this project. I’ve encountered an issue while using the following code:

https://github.com/confident-ai/deepeval/blob/dd64174925ccbacd4bb1feb332a9dcce29d87bc3/deepeval/models/gpt_model_schematic.py#L114

https://github.com/confident-ai/deepeval/blob/dd64174925ccbacd4bb1feb332a9dcce29d87bc3/deepeval/models/gpt_model_schematic.py#L132

It seems that the OpenAI() initialization is missing some necessary configurations, such as the API key and endpoint settings. Without these configurations, it doesn't seem to function as expected.

Additionally, I would like to suggest making it compatible with Azure OpenAI as well. This would broaden the utility of the library for those using Azure's services.

Could you please confirm if the OpenAI() configuration needs to include these parameters, and if there's a possibility to support Azure OpenAI in the future?

Thank you for considering this, and I appreciate your hard work!

penguine-ip commented 1 month ago

Hey @NaraSyuhei, have you tried setting the openai api key in the env variables?

Azure OpenAI is already supported, you can also implement your own wrappers: https://docs.confident-ai.com/docs/guides-using-custom-llms