deepset-ai / haystack

AI orchestration framework to build customizable, production-ready LLM applications. Connect components (models, vector DBs, file converters) to pipelines or agents that can interact with your data. With advanced retrieval methods, it's best suited for building RAG, question answering, semantic search or conversational agent chatbots.
https://haystack.deepset.ai
Apache License 2.0
17.72k stars 1.92k forks source link

fix: changing default model to `gpt-4o-mini` on OpenAI API calls #8360

Closed davidsbatista closed 2 months ago

davidsbatista commented 2 months ago

Related Issues

Proposed Changes:

How did you test it?

Checklist

coveralls commented 2 months ago

Pull Request Test Coverage Report for Build 10887011051

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Files with Coverage Reduction New Missed Lines %
components/generators/openai.py 3 96.43%
components/generators/chat/openai.py 13 79.28%
<!-- Total: 16 -->
Totals Coverage Status
Change from base Build 10851825418: -0.005%
Covered Lines: 7162
Relevant Lines: 7934

💛 - Coveralls
davidsbatista commented 2 months ago
FAILED test/components/generators/chat/test_azure.py::TestOpenAIChatGenerator::test_live_run - openai.NotFoundError: Error code: 404 - {'error': {'code': 'DeploymentNotFound', 'message': 'The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again.'}}
FAILED test/components/generators/test_azure.py::TestAzureOpenAIGenerator::test_live_run - openai.NotFoundError: Error code: 404 - {'error': {'code': 'DeploymentNotFound', 'message': 'The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again.'}}

I'm still trying to figure out what's going on with AzureOpenAIGenerator

lbux commented 2 months ago
FAILED test/components/generators/chat/test_azure.py::TestOpenAIChatGenerator::test_live_run - openai.NotFoundError: Error code: 404 - {'error': {'code': 'DeploymentNotFound', 'message': 'The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again.'}}
FAILED test/components/generators/test_azure.py::TestAzureOpenAIGenerator::test_live_run - openai.NotFoundError: Error code: 404 - {'error': {'code': 'DeploymentNotFound', 'message': 'The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again.'}}

I'm still trying to figure out what's going on with AzureOpenAIGenerator

The most likely issue is that the deployment name != the model name. You can try renaming the deployment name to the model name for the deployment you guys use for testing.

From Microsoft:

When you access the model via the API, you need to refer to the deployment name rather than the underlying model name in API calls, which is one of the key differences between OpenAI and Azure OpenAI. OpenAI only requires the model name. Azure OpenAI always requires deployment name, even when using the model parameter. In our docs, we often have examples where deployment names are represented as identical to model names to help indicate which model works with a particular API endpoint. Ultimately your deployment names can follow whatever naming convention is best for your use case.

https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal#deploy-a-model

davidsbatista commented 2 months ago

@lbux thanks for the input, it was related to what you mentioned👍🏽