Skip to content
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

Support for OpenAI's .with_raw_response. #1138

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

lrafeei
Copy link
Contributor

@lrafeei lrafeei commented May 10, 2024

This PR adds support for .with_raw_response. prepending to HTTP method calls in OpenAI.

Currently, the New Relic instrumentation will instrument this, but during the collection of custom AI event attributes, this modified response type (LegacyAPIResponse) will result in a crash.

This is part 1 of two PRs. The second part will cover the streaming version of this functionality, .with_streaming_response.

Copy link

github-actions bot commented May 10, 2024

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON bandit 1 0 5.35s
✅ PYTHON black 7 1 0 2.37s
✅ PYTHON flake8 7 0 0.88s
✅ PYTHON isort 7 1 0 0.35s
❌ PYTHON pylint 7 31 5.56s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@codecov-commenter
Copy link

codecov-commenter commented May 10, 2024

Codecov Report

Attention: Patch coverage is 86.66667% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 81.45%. Comparing base (8b79e6c) to head (679f97a).

Files Patch % Lines
newrelic/hooks/mlmodel_openai.py 86.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1138      +/-   ##
==========================================
+ Coverage   81.38%   81.45%   +0.07%     
==========================================
  Files         192      192              
  Lines       21345    21358      +13     
  Branches     3715     3715              
==========================================
+ Hits        17371    17397      +26     
+ Misses       2885     2872      -13     
  Partials     1089     1089              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lrafeei lrafeei marked this pull request as ready for review May 13, 2024 16:45
@lrafeei lrafeei requested a review from a team as a code owner May 13, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants