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

feat(openai): Make tiktoken encoding name configurable + tiktoken usage opt-in #3289

Merged
merged 4 commits into from
Jul 15, 2024

Conversation

colin-sentry
Copy link
Member

Tiktoken encodings sometimes make network requests, or do other stateful things. We can't guarantee what happens when you call tiktoken, so let's make it explicitly opt-in to users.


General Notes

Thank you for contributing to sentry-python!

Please add tests to validate your changes, and lint your code using tox -e linters.

Running the test suite on your PR might require maintainer approval. Some tests (AWS Lambda) additionally require a maintainer to add a special label to run and will fail if the label is not present.

For maintainers

Sensitive test suites require maintainer review to ensure that tests do not compromise our secrets. This review must be repeated after any code revisions.

Before running sensitive test suites, please carefully check the PR. Then, apply the Trigger: tests using secrets label. The label will be removed after any code changes to enforce our policy requiring maintainers to review all code revisions before running sensitive tests.

Copy link

codecov bot commented Jul 12, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 79.39%. Comparing base (301c4b8) to head (a1b35d8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3289      +/-   ##
==========================================
- Coverage   79.40%   79.39%   -0.02%     
==========================================
  Files         132      132              
  Lines       14281    14276       -5     
  Branches     2999     3002       +3     
==========================================
- Hits        11340    11334       -6     
+ Misses       2094     2093       -1     
- Partials      847      849       +2     
Files Coverage Δ
sentry_sdk/integrations/openai.py 77.98% <90.90%> (-0.55%) ⬇️
sentry_sdk/integrations/langchain.py 66.94% <61.53%> (-0.55%) ⬇️

Copy link
Member

@antonpirker antonpirker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.
We need to update the docs for the integrations, though.

@sentrivana sentrivana enabled auto-merge (squash) July 15, 2024 08:58
@sentrivana sentrivana merged commit 5bad5c6 into master Jul 15, 2024
122 checks passed
@sentrivana sentrivana deleted the tiktoken_opt_in branch July 15, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants