Skip to content

Commit

Permalink
Update OpenAI testing infra to match bedrock
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPansino committed Oct 13, 2023
1 parent 2834663 commit fad7c45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/mlmodel_openai/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import json
import os
import pprint

import pytest
from _mock_external_openai_server import (
MockExternalOpenAIServer,
extract_shortened_prompt,
)
from testing_support.fixture.event_loop import ( # noqa: F401; pylint: disable=W0611
event_loop as loop,
)
from testing_support.fixtures import ( # noqa: F401, pylint: disable=W0611
collector_agent_registration_fixture,
collector_available_fixture,
)
from testing_support.mock_external_openai_server import (
MockExternalOpenAIServer,
extract_shortened_prompt,
)

from newrelic.common.object_wrapper import wrap_function_wrapper

Expand Down Expand Up @@ -78,7 +78,7 @@ def openai_server():

# Write responses to audit log
with open(OPENAI_AUDIT_LOG_FILE, "w") as audit_log_fp:
pprint.pprint(OPENAI_AUDIT_LOG_CONTENTS, stream=audit_log_fp)
json.dump(OPENAI_AUDIT_LOG_CONTENTS, fp=audit_log_fp, indent=4)


# Intercept outgoing requests and log to file for mocking
Expand Down

0 comments on commit fad7c45

Please sign in to comment.