-
Notifications
You must be signed in to change notification settings - Fork 20
add #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds end-to-end integration tests for the new OpenAI-compatible Clarifai endpoint, covering both synchronous and asynchronous flows.
- Introduces
API_KEY
constant sourced fromCLARIFAI_PAT
- Adds helper functions (
_call_openai_model
,_list_featured_models
) for sync/async calls - Implements synchronous (
test_openai_compatible_endpoint_on_featured_models
) and async (test_openai_compatible_endpoint_on_featured_models_async
) integration tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
fb4ed95
to
9338767
Compare
This pull request introduces significant enhancements to the testing framework for public models, focusing on integration with OpenAI-compatible endpoints and improving test reliability through retry mechanisms. It also adds new dependencies to support OpenAI API usage. Below is a summary of the most important changes.
Integration with OpenAI-compatible endpoints:
_call_openai_model
and_list_featured_models
to test OpenAI-compatible models with retry logic for chat completions and image generation. These functions include error handling and parameter corrections for API compatibility. (tests/public_models/test_public_models_predicts.py
, tests/public_models/test_public_models_predicts.pyR356-R500)test_openai_compatible_endpoint_on_featured_models
andtest_openai_compatible_endpoint_on_featured_models_async
to validate OpenAI-compatible endpoints on featured models, both synchronously and asynchronously. (tests/public_models/test_public_models_predicts.py
, tests/public_models/test_public_models_predicts.pyR356-R500)Improvements to test reliability:
API_KEY
andMAX_RETRY_ATTEMPTS
for managing authentication and retry logic in tests. (tests/public_models/test_public_models_predicts.py
, tests/public_models/test_public_models_predicts.pyR42-R45)test_audio_predict_on_public_models_async
function to support asynchronous testing. (tests/public_models/test_public_models_predicts.py
, tests/public_models/test_public_models_predicts.pyL55)Dependency updates:
openai==1.86.0
totests/requirements.txt
to enable OpenAI API integration. (tests/requirements.txt
, tests/requirements.txtR5)