-
Notifications
You must be signed in to change notification settings - Fork 10
feat(suppress): expose SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION as env var #336
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
Draft
adityamehra
wants to merge
13
commits into
main
Choose a base branch
from
fix/remove-suppress-language-model-key
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c092f20
feat(langchain): Release version 0.1.14
adityamehra 6b2da19
fix(openai-v2): add __getattr__ to StreamWrapper to proxy unknown att…
adityamehra fcd4978
Merge branch 'main' into fix/stream-wrapper-getattr-headers
adityamehra ec35675
docs(openai-v2): add changelog entry for StreamWrapper __getattr__ fix
adityamehra 7173333
fix(openai-v2): preserve LegacyAPIResponse headers on StreamWrapper f…
adityamehra 044cf8b
style: apply ruff formatting to test_patch_unit.py
adityamehra 2706482
test(openai-v2): add standalone reproducer for with_raw_response stre…
adityamehra 2df57a3
test(openai-v2): use make_azure_openai_chat_completion_request verbat…
adityamehra 57328ce
chore(openai-v2): move reproducer script to examples/scripts/
adityamehra a2fe60e
fix(openai-v2): remove unused time import from reproducer
adityamehra 17c6d96
Merge remote-tracking branch 'origin/main' into fix/stream-wrapper-ge…
adityamehra 8f324d4
feat(suppress): expose SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION as env…
adityamehra c1d6ce6
Merge remote-tracking branch 'origin/main' into fix/remove-suppress-l…
adityamehra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
134 changes: 134 additions & 0 deletions
134
...ion-openai-v2/tests/cassettes/test_chat_completion_not_suppressed_when_env_var_false.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| interactions: | ||
| - request: | ||
| body: |- | ||
| { | ||
| "messages": [ | ||
| { | ||
| "role": "user", | ||
| "content": "Say this is a test" | ||
| } | ||
| ], | ||
| "model": "gpt-4o-mini", | ||
| "stream": false | ||
| } | ||
| headers: | ||
| accept: | ||
| - application/json | ||
| accept-encoding: | ||
| - gzip, deflate | ||
| authorization: | ||
| - Bearer test_openai_api_key | ||
| connection: | ||
| - keep-alive | ||
| content-length: | ||
| - '106' | ||
| content-type: | ||
| - application/json | ||
| host: | ||
| - api.openai.com | ||
| user-agent: | ||
| - OpenAI/Python 1.54.3 | ||
| x-stainless-arch: | ||
| - arm64 | ||
| x-stainless-async: | ||
| - 'false' | ||
| x-stainless-lang: | ||
| - python | ||
| x-stainless-os: | ||
| - MacOS | ||
| x-stainless-package-version: | ||
| - 1.54.3 | ||
| x-stainless-retry-count: | ||
| - '0' | ||
| x-stainless-runtime: | ||
| - CPython | ||
| x-stainless-runtime-version: | ||
| - 3.12.6 | ||
| method: POST | ||
| uri: https://api.openai.com/v1/chat/completions | ||
| response: | ||
| body: | ||
| string: |- | ||
| { | ||
| "id": "chatcmpl-ASYMQRl3A3DXL9FWCK9tnGRcKIO7q", | ||
| "object": "chat.completion", | ||
| "created": 1731368630, | ||
| "model": "gpt-4o-mini-2024-07-18", | ||
| "choices": [ | ||
| { | ||
| "index": 0, | ||
| "message": { | ||
| "role": "assistant", | ||
| "content": "This is a test.", | ||
| "refusal": null | ||
| }, | ||
| "logprobs": null, | ||
| "finish_reason": "stop" | ||
| } | ||
| ], | ||
| "usage": { | ||
| "prompt_tokens": 12, | ||
| "completion_tokens": 5, | ||
| "total_tokens": 17, | ||
| "prompt_tokens_details": { | ||
| "cached_tokens": 0, | ||
| "audio_tokens": 0 | ||
| }, | ||
| "completion_tokens_details": { | ||
| "reasoning_tokens": 0, | ||
| "audio_tokens": 0, | ||
| "accepted_prediction_tokens": 0, | ||
| "rejected_prediction_tokens": 0 | ||
| } | ||
| }, | ||
| "system_fingerprint": "fp_0ba0d124f1" | ||
| } | ||
| headers: | ||
| CF-Cache-Status: | ||
| - DYNAMIC | ||
| CF-RAY: | ||
| - 8e122593ff368bc8-SIN | ||
| Connection: | ||
| - keep-alive | ||
| Content-Type: | ||
| - application/json | ||
| Date: | ||
| - Mon, 11 Nov 2024 23:43:50 GMT | ||
| Server: | ||
| - cloudflare | ||
| Set-Cookie: test_set_cookie | ||
| Transfer-Encoding: | ||
| - chunked | ||
| X-Content-Type-Options: | ||
| - nosniff | ||
| access-control-expose-headers: | ||
| - X-Request-ID | ||
| alt-svc: | ||
| - h3=":443"; ma=86400 | ||
| content-length: | ||
| - '765' | ||
| openai-organization: test_openai_org_id | ||
| openai-processing-ms: | ||
| - '287' | ||
| openai-version: | ||
| - '2020-10-01' | ||
| strict-transport-security: | ||
| - max-age=31536000; includeSubDomains; preload | ||
| x-ratelimit-limit-requests: | ||
| - '10000' | ||
| x-ratelimit-limit-tokens: | ||
| - '200000' | ||
| x-ratelimit-remaining-requests: | ||
| - '9999' | ||
| x-ratelimit-remaining-tokens: | ||
| - '199977' | ||
| x-ratelimit-reset-requests: | ||
| - 8.64s | ||
| x-ratelimit-reset-tokens: | ||
| - 6ms | ||
| x-request-id: | ||
| - req_58cff97afd0e7c0bba910ccf0b044a6f | ||
| status: | ||
| code: 200 | ||
| message: OK | ||
| version: 1 |
134 changes: 134 additions & 0 deletions
134
...nstrumentation-openai-v2/tests/cassettes/test_chat_completion_suppressed_via_env_var.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| interactions: | ||
| - request: | ||
| body: |- | ||
| { | ||
| "messages": [ | ||
| { | ||
| "role": "user", | ||
| "content": "Say this is a test" | ||
| } | ||
| ], | ||
| "model": "gpt-4o-mini", | ||
| "stream": false | ||
| } | ||
| headers: | ||
| accept: | ||
| - application/json | ||
| accept-encoding: | ||
| - gzip, deflate | ||
| authorization: | ||
| - Bearer test_openai_api_key | ||
| connection: | ||
| - keep-alive | ||
| content-length: | ||
| - '106' | ||
| content-type: | ||
| - application/json | ||
| host: | ||
| - api.openai.com | ||
| user-agent: | ||
| - OpenAI/Python 1.54.3 | ||
| x-stainless-arch: | ||
| - arm64 | ||
| x-stainless-async: | ||
| - 'false' | ||
| x-stainless-lang: | ||
| - python | ||
| x-stainless-os: | ||
| - MacOS | ||
| x-stainless-package-version: | ||
| - 1.54.3 | ||
| x-stainless-retry-count: | ||
| - '0' | ||
| x-stainless-runtime: | ||
| - CPython | ||
| x-stainless-runtime-version: | ||
| - 3.12.6 | ||
| method: POST | ||
| uri: https://api.openai.com/v1/chat/completions | ||
| response: | ||
| body: | ||
| string: |- | ||
| { | ||
| "id": "chatcmpl-ASYMQRl3A3DXL9FWCK9tnGRcKIO7q", | ||
| "object": "chat.completion", | ||
| "created": 1731368630, | ||
| "model": "gpt-4o-mini-2024-07-18", | ||
| "choices": [ | ||
| { | ||
| "index": 0, | ||
| "message": { | ||
| "role": "assistant", | ||
| "content": "This is a test.", | ||
| "refusal": null | ||
| }, | ||
| "logprobs": null, | ||
| "finish_reason": "stop" | ||
| } | ||
| ], | ||
| "usage": { | ||
| "prompt_tokens": 12, | ||
| "completion_tokens": 5, | ||
| "total_tokens": 17, | ||
| "prompt_tokens_details": { | ||
| "cached_tokens": 0, | ||
| "audio_tokens": 0 | ||
| }, | ||
| "completion_tokens_details": { | ||
| "reasoning_tokens": 0, | ||
| "audio_tokens": 0, | ||
| "accepted_prediction_tokens": 0, | ||
| "rejected_prediction_tokens": 0 | ||
| } | ||
| }, | ||
| "system_fingerprint": "fp_0ba0d124f1" | ||
| } | ||
| headers: | ||
| CF-Cache-Status: | ||
| - DYNAMIC | ||
| CF-RAY: | ||
| - 8e122593ff368bc8-SIN | ||
| Connection: | ||
| - keep-alive | ||
| Content-Type: | ||
| - application/json | ||
| Date: | ||
| - Mon, 11 Nov 2024 23:43:50 GMT | ||
| Server: | ||
| - cloudflare | ||
| Set-Cookie: test_set_cookie | ||
| Transfer-Encoding: | ||
| - chunked | ||
| X-Content-Type-Options: | ||
| - nosniff | ||
| access-control-expose-headers: | ||
| - X-Request-ID | ||
| alt-svc: | ||
| - h3=":443"; ma=86400 | ||
| content-length: | ||
| - '765' | ||
| openai-organization: test_openai_org_id | ||
| openai-processing-ms: | ||
| - '287' | ||
| openai-version: | ||
| - '2020-10-01' | ||
| strict-transport-security: | ||
| - max-age=31536000; includeSubDomains; preload | ||
| x-ratelimit-limit-requests: | ||
| - '10000' | ||
| x-ratelimit-limit-tokens: | ||
| - '200000' | ||
| x-ratelimit-remaining-requests: | ||
| - '9999' | ||
| x-ratelimit-remaining-tokens: | ||
| - '199977' | ||
| x-ratelimit-reset-requests: | ||
| - 8.64s | ||
| x-ratelimit-reset-tokens: | ||
| - 6ms | ||
| x-request-id: | ||
| - req_58cff97afd0e7c0bba910ccf0b044a6f | ||
| status: | ||
| code: 200 | ||
| message: OK | ||
| version: 1 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this an alternative instead of "alongside"?