-
Notifications
You must be signed in to change notification settings - Fork 33
Max_retries and timeout #126
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -296,6 +296,37 @@ def test_qwen_omni_audio_formatting(self): | |
| "data:;base64,", | ||
| ) | ||
|
|
||
| @patch("openjudge.models.openai_chat_model.AsyncOpenAI") | ||
| def test_timeout_and_max_retries_passed(self, mock_async_openai): | ||
| """Test that timeout and max_retries are passed to AsyncOpenAI.""" | ||
| OpenAIChatModel( | ||
| model="gpt-4", | ||
| api_key="test-key", | ||
| client_args={ | ||
| "timeout": 30.0, | ||
| "max_retries": 3, | ||
| }, | ||
| ) | ||
|
|
||
| _, kwargs = mock_async_openai.call_args | ||
|
|
||
| assert kwargs["timeout"] == 30.0 | ||
| assert kwargs["max_retries"] == 3 | ||
|
|
||
| @patch("openjudge.models.openai_chat_model.AsyncOpenAI") | ||
| def test_default_timeout_and_max_retries(self, mock_async_openai): | ||
| """Test that default timeout and max_retries are applied.""" | ||
| OpenAIChatModel( | ||
| model="gpt-4", | ||
| api_key="test-key", | ||
| ) | ||
|
|
||
| _, kwargs = mock_async_openai.call_args | ||
|
|
||
| assert kwargs["timeout"] == 60.0 | ||
| assert kwargs["max_retries"] == 2 | ||
|
|
||
|
Comment on lines
+299
to
+328
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These new test methods are defined inside To fix this, please move |
||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| pytest.main([__file__]) | ||
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.
There are a couple of minor formatting issues here: