2023-04-26 16:57:05 +00:00
|
|
|
import pytest
|
|
|
|
|
2023-04-26 20:11:08 +00:00
|
|
|
from tests.vcr.openai_filter import before_record_request, before_record_response
|
2023-04-26 16:57:05 +00:00
|
|
|
|
|
|
|
|
2023-04-27 01:55:01 +00:00
|
|
|
@pytest.fixture(scope="session")
|
2023-04-26 16:57:05 +00:00
|
|
|
def vcr_config():
|
|
|
|
# this fixture is called by the pytest-recording vcr decorator.
|
|
|
|
return {
|
|
|
|
"record_mode": "new_episodes",
|
|
|
|
"before_record_request": before_record_request,
|
2023-04-26 20:11:08 +00:00
|
|
|
"before_record_response": before_record_response,
|
2023-04-26 16:57:05 +00:00
|
|
|
"filter_headers": [
|
2023-04-26 20:11:08 +00:00
|
|
|
"Authorization",
|
2023-04-26 16:57:05 +00:00
|
|
|
"X-OpenAI-Client-User-Agent",
|
|
|
|
"User-Agent",
|
|
|
|
],
|
|
|
|
}
|