-
Notifications
You must be signed in to change notification settings - Fork 463
fix(llmobs): ensure langchain azure openai spans are not duplicate llm marked #14939
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
Merged
+261
−3
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6b8f523
ensure langchain aoai spans are marked as workflow if openai integrat…
Yun-Kim 732bfa0
More generic provider checking
Yun-Kim fd746af
Merge branch 'main' into yunkim/langchain-aoai
Yun-Kim 5cdb9c8
Merge branch 'main' into yunkim/langchain-aoai
Yun-Kim 004a7db
Merge branch 'main' into yunkim/langchain-aoai
Yun-Kim 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
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
5 changes: 5 additions & 0 deletions
5
releasenotes/notes/fix-llmobs-langchain-azure-openai-e0ea489aafba7ffd.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,5 @@ | ||
--- | ||
fixes: | ||
- | | ||
LLM Observability: Resolves an issue where the ``langchain`` integration would incorrectly mark Azure OpenAI calls as duplicate llm operations even if the ``openai`` integration was enabled. | ||
The ``langchain`` integration will trace Azure OpenAI spans as workflow spans if there is an equivalent llm span from the ``openai`` integration. |
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
109 changes: 109 additions & 0 deletions
109
...ployments_gpt-4.1-mini_chat_completions_api-version_2024-12-01-preview_post_5836d4fe.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,109 @@ | ||
interactions: | ||
- request: | ||
body: '{"messages":[{"content":"Can you explain what Descartes meant by ''I think, | ||
therefore I am''?","role":"user"}],"model":"gpt-3.5-turbo","n":1,"stream":false,"temperature":0.7}' | ||
headers: | ||
? !!python/object/apply:multidict._multidict.istr | ||
- Accept | ||
: - application/json | ||
? !!python/object/apply:multidict._multidict.istr | ||
- Accept-Encoding | ||
: - gzip, deflate | ||
? !!python/object/apply:multidict._multidict.istr | ||
- Connection | ||
: - keep-alive | ||
Content-Length: | ||
- '172' | ||
? !!python/object/apply:multidict._multidict.istr | ||
- Content-Type | ||
: - application/json | ||
? !!python/object/apply:multidict._multidict.istr | ||
- User-Agent | ||
: - AzureOpenAI/Python 1.109.1 | ||
? !!python/object/apply:multidict._multidict.istr | ||
- X-Stainless-Arch | ||
: - arm64 | ||
? !!python/object/apply:multidict._multidict.istr | ||
- X-Stainless-Async | ||
: - 'false' | ||
? !!python/object/apply:multidict._multidict.istr | ||
- X-Stainless-Lang | ||
: - python | ||
? !!python/object/apply:multidict._multidict.istr | ||
- X-Stainless-OS | ||
: - MacOS | ||
? !!python/object/apply:multidict._multidict.istr | ||
- X-Stainless-Package-Version | ||
: - 1.109.1 | ||
? !!python/object/apply:multidict._multidict.istr | ||
- X-Stainless-Runtime | ||
: - CPython | ||
? !!python/object/apply:multidict._multidict.istr | ||
- X-Stainless-Runtime-Version | ||
: - 3.11.13 | ||
? !!python/object/apply:multidict._multidict.istr | ||
- x-stainless-retry-count | ||
: - '0' | ||
method: POST | ||
uri: https://llmobs-test-resource.openai.azure.com/openai/deployments/gpt-4.1-mini/chat/completions?api-version=2024-12-01-preview | ||
response: | ||
body: | ||
string: "{\"choices\":[{\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"protected_material_code\":{\"filtered\":false,\"detected\":false},\"protected_material_text\":{\"filtered\":false,\"detected\":false},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}},\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"annotations\":[],\"content\":\"Certainly! | ||
The phrase **\\\"I think, therefore I am\\\"** (originally in Latin: *Cogito, | ||
ergo sum*) was coined by the French philosopher Ren\xE9 Descartes. It appears | ||
in his work *Discourse on the Method* (1637) and later in *Meditations on | ||
First Philosophy* (1641).\\n\\n### What Descartes Meant:\\n\\n1. **Foundation | ||
of Certainty:** \\n Descartes was searching for an undeniable foundation | ||
for knowledge. He wanted to find something that could not be doubted, as many | ||
beliefs could be mistaken.\\n\\n2. **Method of Doubt:** \\n He began by | ||
doubting everything \u2014 the evidence of the senses, the existence of the | ||
physical world, even mathematical truths \u2014 to see if anything remained | ||
absolutely certain.\\n\\n3. **The Indubitable Truth:** \\n While doubting, | ||
Descartes realized that the very act of doubting implied a thinking subject. | ||
If he is doubting or thinking, then he must exist in some form to be doing | ||
that thinking.\\n\\n4. **\\\"I think, therefore I am\\\":** \\n Therefore, | ||
the one thing he could not doubt was that he exists as a thinking being. The | ||
act of thinking itself proved his own existence. This statement became the | ||
first principle in his philosophy.\\n\\n### In summary:\\n\\nDescartes meant | ||
that the fact that you are consciously thinking is proof of your own existence. | ||
Even if everything else is uncertain or illusory, the very experience of thought | ||
confirms that there is a \\\"self\\\" doing the thinking. It\u2019s a foundational | ||
claim about knowledge and existence.\\n\\nIf you want, I can also explain | ||
how this idea influenced philosophy or its criticisms!\",\"refusal\":null,\"role\":\"assistant\"}}],\"created\":1760724000,\"id\":\"chatcmpl-CRj28rdRKqhnTBkcKCmXlz0vReldy\",\"model\":\"gpt-4.1-mini-2025-04-14\",\"object\":\"chat.completion\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"jailbreak\":{\"filtered\":false,\"detected\":false},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"system_fingerprint\":\"fp_3dcd5944f5\",\"usage\":{\"completion_tokens\":342,\"completion_tokens_details\":{\"accepted_prediction_tokens\":0,\"audio_tokens\":0,\"reasoning_tokens\":0,\"rejected_prediction_tokens\":0},\"prompt_tokens\":24,\"prompt_tokens_details\":{\"audio_tokens\":0,\"cached_tokens\":0},\"total_tokens\":366}}\n" | ||
headers: | ||
Content-Length: | ||
- '2780' | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Fri, 17 Oct 2025 18:00:13 GMT | ||
Strict-Transport-Security: | ||
- max-age=31536000; includeSubDomains; preload | ||
apim-request-id: | ||
- 381a6525-4f15-481a-8884-dd8ec1b0d6fc | ||
azureml-model-session: | ||
- d213-20251016082839 | ||
x-accel-buffering: | ||
- 'no' | ||
x-content-type-options: | ||
- nosniff | ||
x-ms-deployment-name: | ||
- gpt-4.1-mini | ||
x-ms-rai-invoked: | ||
- 'true' | ||
x-ms-region: | ||
- East US 2 | ||
x-ratelimit-limit-requests: | ||
- '250' | ||
x-ratelimit-limit-tokens: | ||
- '250000' | ||
x-ratelimit-remaining-requests: | ||
- '248' | ||
x-ratelimit-remaining-tokens: | ||
- '249979' | ||
x-request-id: | ||
- 8e52694a-22a0-42fa-9e2d-54539ebd2113 | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
112 changes: 112 additions & 0 deletions
112
...ployments_gpt-4.1-mini_chat_completions_api-version_2024-12-01-preview_post_696c0585.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,112 @@ | ||
interactions: | ||
- request: | ||
body: '{"messages":[{"content":"Can you explain what Descartes meant by ''I think, | ||
therefore I am''?","role":"user"}],"model":null,"stream":false}' | ||
headers: | ||
? !!python/object/apply:multidict._multidict.istr | ||
- Accept | ||
: - application/json | ||
? !!python/object/apply:multidict._multidict.istr | ||
- Accept-Encoding | ||
: - gzip, deflate, zstd | ||
? !!python/object/apply:multidict._multidict.istr | ||
- Connection | ||
: - keep-alive | ||
Content-Length: | ||
- '137' | ||
? !!python/object/apply:multidict._multidict.istr | ||
- Content-Type | ||
: - application/json | ||
? !!python/object/apply:multidict._multidict.istr | ||
- User-Agent | ||
: - langchain-partner-python-azure-openai | ||
? !!python/object/apply:multidict._multidict.istr | ||
- X-Stainless-Arch | ||
: - arm64 | ||
? !!python/object/apply:multidict._multidict.istr | ||
- X-Stainless-Async | ||
: - 'false' | ||
? !!python/object/apply:multidict._multidict.istr | ||
- X-Stainless-Lang | ||
: - python | ||
? !!python/object/apply:multidict._multidict.istr | ||
- X-Stainless-OS | ||
: - MacOS | ||
? !!python/object/apply:multidict._multidict.istr | ||
- X-Stainless-Package-Version | ||
: - 1.109.1 | ||
? !!python/object/apply:multidict._multidict.istr | ||
- X-Stainless-Raw-Response | ||
: - 'true' | ||
? !!python/object/apply:multidict._multidict.istr | ||
- X-Stainless-Runtime | ||
: - CPython | ||
? !!python/object/apply:multidict._multidict.istr | ||
- X-Stainless-Runtime-Version | ||
: - 3.11.13 | ||
? !!python/object/apply:multidict._multidict.istr | ||
- x-stainless-retry-count | ||
: - '0' | ||
method: POST | ||
uri: https://llmobs-test-resource.openai.azure.com/openai/deployments/gpt-4.1-mini/chat/completions?api-version=2024-12-01-preview | ||
response: | ||
body: | ||
string: "{\"choices\":[{\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"protected_material_code\":{\"filtered\":false,\"detected\":false},\"protected_material_text\":{\"filtered\":false,\"detected\":false},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}},\"finish_reason\":\"stop\",\"index\":0,\"logprobs\":null,\"message\":{\"annotations\":[],\"content\":\"Certainly! | ||
The phrase **\\\"I think, therefore I am\\\"** (originally in Latin: *Cogito, | ||
ergo sum*) was coined by the French philosopher Ren\xE9 Descartes. It is a | ||
fundamental element of Western philosophy and appears in his work *Meditations | ||
on First Philosophy* (1641).\\n\\n**What Descartes meant:**\\n\\n1. **Starting | ||
point of certainty:** Descartes was seeking an indubitable foundation for | ||
knowledge. He embarked on a method of radical doubt, questioning everything | ||
that could possibly be doubted\u2014his senses, the physical world, even mathematical | ||
truths.\\n\\n2. **The act of thinking proves existence:** In the process of | ||
doubting, he realized that the very act of doubting or thinking implies a | ||
thinker. If he is doubting, then he must be thinking. If he is thinking, then | ||
he must exist. Thus, the fact that he thinks is proof that he exists.\\n\\n3. | ||
**Existence is confirmed through self-awareness:** This statement establishes | ||
the self as a thinking thing (*res cogitans*). Descartes is not saying \\\"I | ||
am a body,\\\" or \\\"I exist in the physical world,\\\" but rather affirming | ||
the existence of the self as a conscious being\u2014one that thinks, doubts, | ||
understands, wills, imagines, and senses.\\n\\n4. **Foundation for knowledge:** | ||
From this fundamental truth, Descartes hoped to build further knowledge about | ||
the world, God, and existence, by basing it on something certain and clear: | ||
the existence of the self as a thinking entity.\\n\\nIn summary, **\\\"I think, | ||
therefore I am\\\" means that the very act of thinking is proof enough of | ||
one's existence and is the first principle of philosophy that cannot be doubted.**\",\"refusal\":null,\"role\":\"assistant\"}}],\"created\":1760724017,\"id\":\"chatcmpl-CRj2PkKuSFXMkYWzr4xxvmv5TtlQ9\",\"model\":\"gpt-4.1-mini-2025-04-14\",\"object\":\"chat.completion\",\"prompt_filter_results\":[{\"prompt_index\":0,\"content_filter_results\":{\"hate\":{\"filtered\":false,\"severity\":\"safe\"},\"jailbreak\":{\"filtered\":false,\"detected\":false},\"self_harm\":{\"filtered\":false,\"severity\":\"safe\"},\"sexual\":{\"filtered\":false,\"severity\":\"safe\"},\"violence\":{\"filtered\":false,\"severity\":\"safe\"}}}],\"system_fingerprint\":\"fp_3dcd5944f5\",\"usage\":{\"completion_tokens\":354,\"completion_tokens_details\":{\"accepted_prediction_tokens\":0,\"audio_tokens\":0,\"reasoning_tokens\":0,\"rejected_prediction_tokens\":0},\"prompt_tokens\":24,\"prompt_tokens_details\":{\"audio_tokens\":0,\"cached_tokens\":0},\"total_tokens\":378}}\n" | ||
headers: | ||
Content-Length: | ||
- '2822' | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Fri, 17 Oct 2025 18:00:28 GMT | ||
Strict-Transport-Security: | ||
- max-age=31536000; includeSubDomains; preload | ||
apim-request-id: | ||
- ea05cb68-e4e4-4876-b0de-cca3a2bf4c63 | ||
azureml-model-session: | ||
- d213-20251016082839 | ||
x-accel-buffering: | ||
- 'no' | ||
x-content-type-options: | ||
- nosniff | ||
x-ms-deployment-name: | ||
- gpt-4.1-mini | ||
x-ms-rai-invoked: | ||
- 'true' | ||
x-ms-region: | ||
- East US 2 | ||
x-ratelimit-limit-requests: | ||
- '250' | ||
x-ratelimit-limit-tokens: | ||
- '250000' | ||
x-ratelimit-remaining-requests: | ||
- '247' | ||
x-ratelimit-remaining-tokens: | ||
- '249962' | ||
x-request-id: | ||
- 33717a5b-b7e0-48d3-9347-0d8df2e5a48d | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
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.
Uh oh!
There was an error while loading. Please reload this page.