Create an OpenAIAPI instance with test defaults.
()
| 28 | |
| 29 | @pytest.fixture |
| 30 | def api(): |
| 31 | """Create an OpenAIAPI instance with test defaults.""" |
| 32 | return OpenAIAPI( |
| 33 | model="test-model", |
| 34 | key="test-key", |
| 35 | api_base="http://localhost:8000/v1/chat/completions", |
| 36 | retry=3, |
| 37 | wait=0.01, |
| 38 | timeout=(5, 30), |
| 39 | max_tokens=1024, |
| 40 | thread_num=4, |
| 41 | ) |
| 42 | |
| 43 | |
| 44 | @pytest.fixture |