Skip to content

Commit

Permalink
fix(weave): add attributes to langchain integration calls (#3521)
Browse files Browse the repository at this point in the history
* fix: include user provided call attributes in the weave call

* test: add test case to track the call attributes

* fix: remove fingerprints from test cassettes

ref: #3521 (comment)

* chore: fix linting errors in tests file

* tests: fix test data path
  • Loading branch information
parambharat authored Feb 4, 2025
1 parent fd6fcbc commit 460c0ad
Show file tree
Hide file tree
Showing 10 changed files with 4,210 additions and 3,993 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,69 +5,71 @@ interactions:
accept:
- application/json
accept-encoding:
- gzip, deflate
- gzip, deflate, zstd
connection:
- keep-alive
content-length:
- '579'
- '530'
content-type:
- application/json
host:
- api.openai.com
user-agent:
- OpenAI/Python 1.35.13
- OpenAI/Python 1.60.2
x-stainless-arch:
- x64
- arm64
x-stainless-async:
- 'false'
x-stainless-lang:
- python
x-stainless-os:
- Linux
- MacOS
x-stainless-package-version:
- 1.48.0
- 1.60.2
x-stainless-retry-count:
- '0'
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.10.14
- 3.11.11
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: 'data: {"id":"chatcmpl-9jicpaVkXi2nrE0R4SNVFeCGQ0blB","object":"chat.completion.chunk","created":1720683327,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"function_call":{"name":"Calculator","arguments":""}},"logprobs":null,"finish_reason":null}],"usage":null}
string: 'data: {"id":"chatcmpl-Av0tQ435mNvqfk5c4Mtjr8c2ogJPI","object":"chat.completion.chunk","created":1738151492,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"function_call":{"name":"Calculator","arguments":""},"refusal":null},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-9jicpaVkXi2nrE0R4SNVFeCGQ0blB","object":"chat.completion.chunk","created":1720683327,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":"{\""}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-Av0tQ435mNvqfk5c4Mtjr8c2ogJPI","object":"chat.completion.chunk","created":1738151492,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":"{\""}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-9jicpaVkXi2nrE0R4SNVFeCGQ0blB","object":"chat.completion.chunk","created":1720683327,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":"a"}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-Av0tQ435mNvqfk5c4Mtjr8c2ogJPI","object":"chat.completion.chunk","created":1738151492,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":"a"}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-9jicpaVkXi2nrE0R4SNVFeCGQ0blB","object":"chat.completion.chunk","created":1720683327,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":"\":"}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-Av0tQ435mNvqfk5c4Mtjr8c2ogJPI","object":"chat.completion.chunk","created":1738151492,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":"\":"}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-9jicpaVkXi2nrE0R4SNVFeCGQ0blB","object":"chat.completion.chunk","created":1720683327,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":"3"}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-Av0tQ435mNvqfk5c4Mtjr8c2ogJPI","object":"chat.completion.chunk","created":1738151492,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":"3"}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-9jicpaVkXi2nrE0R4SNVFeCGQ0blB","object":"chat.completion.chunk","created":1720683327,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":",\""}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-Av0tQ435mNvqfk5c4Mtjr8c2ogJPI","object":"chat.completion.chunk","created":1738151492,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":",\""}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-9jicpaVkXi2nrE0R4SNVFeCGQ0blB","object":"chat.completion.chunk","created":1720683327,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":"b"}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-Av0tQ435mNvqfk5c4Mtjr8c2ogJPI","object":"chat.completion.chunk","created":1738151492,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":"b"}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-9jicpaVkXi2nrE0R4SNVFeCGQ0blB","object":"chat.completion.chunk","created":1720683327,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":"\":"}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-Av0tQ435mNvqfk5c4Mtjr8c2ogJPI","object":"chat.completion.chunk","created":1738151492,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":"\":"}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-9jicpaVkXi2nrE0R4SNVFeCGQ0blB","object":"chat.completion.chunk","created":1720683327,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":"4"}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-Av0tQ435mNvqfk5c4Mtjr8c2ogJPI","object":"chat.completion.chunk","created":1738151492,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":"4"}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-9jicpaVkXi2nrE0R4SNVFeCGQ0blB","object":"chat.completion.chunk","created":1720683327,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":"}"}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-Av0tQ435mNvqfk5c4Mtjr8c2ogJPI","object":"chat.completion.chunk","created":1738151492,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"function_call":{"arguments":"}"}},"logprobs":null,"finish_reason":null}],"usage":null}
data: {"id":"chatcmpl-9jicpaVkXi2nrE0R4SNVFeCGQ0blB","object":"chat.completion.chunk","created":1720683327,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"function_call"}],"usage":null}
data: {"id":"chatcmpl-Av0tQ435mNvqfk5c4Mtjr8c2ogJPI","object":"chat.completion.chunk","created":1738151492,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"function_call"}],"usage":null}
data: {"id":"chatcmpl-9jicpaVkXi2nrE0R4SNVFeCGQ0blB","object":"chat.completion.chunk","created":1720683327,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":82,"completion_tokens":19,"total_tokens":101}}
data: {"id":"chatcmpl-Av0tQ435mNvqfk5c4Mtjr8c2ogJPI","object":"chat.completion.chunk","created":1738151492,"model":"gpt-4o-mini-2024-07-18","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":79,"completion_tokens":19,"total_tokens":98,"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}}}
data: [DONE]
Expand All @@ -78,47 +80,51 @@ interactions:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8a171de8dd3e17a8-MAA
- 909902c81d597fd3-MAA
Connection:
- keep-alive
Content-Type:
- text/event-stream; charset=utf-8
Date:
- Thu, 11 Jul 2024 07:35:27 GMT
- Wed, 29 Jan 2025 11:51:32 GMT
Server:
- cloudflare
Set-Cookie:
- __cf_bm=DDEn6R3b05j5ESjBB4KqBcK8v_VF588P4m2wV4FTr1E-1720683327-1.0.1.1-h7FKVo1ybqX49KTG9mgb5JvfVPA3UPqdl6F2_Mgi7ywVxJUl15mrcV50bZkqIovV97ADYALwf4_mHsgSUp5ZlQ;
path=/; expires=Thu, 11-Jul-24 08:05:27 GMT; domain=.api.openai.com; HttpOnly;
- __cf_bm=XjZp660It1kdBu7cTLBVfJFu7TPIqtYHKRu1tafcoa8-1738151492-1.0.1.1-0uU5p3bRhqC8Kys9yacG2tLcbDr3kGVrBWodaJexHx8.KJ0DZMPNmJtfXsPES4qsmXH6Br3_aOeXqTos8xvqPQ;
path=/; expires=Wed, 29-Jan-25 12:21:32 GMT; domain=.api.openai.com; HttpOnly;
Secure; SameSite=None
- _cfuvid=smUjru5nhEEfbgEtw9oNzZt7GYa3SnrIe8LN4xm1Yg0-1720683327476-0.0.1.1-604800000;
- _cfuvid=2PYVAJdLLMOJAjZCYRRXrs7rRx05XCyaKnb0H5ZSqSk-1738151492549-0.0.1.1-604800000;
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
openai-organization:
- wandb
openai-processing-ms:
- '280'
- '413'
openai-version:
- '2020-10-01'
strict-transport-security:
- max-age=31536000; includeSubDomains
- max-age=31536000; includeSubDomains; preload
x-ratelimit-limit-requests:
- '10000'
- '30000'
x-ratelimit-limit-tokens:
- '15000000'
- '150000000'
x-ratelimit-remaining-requests:
- '9999'
- '29999'
x-ratelimit-remaining-tokens:
- '14999950'
- '149999951'
x-ratelimit-reset-requests:
- 6ms
- 2ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_38e8c68b3690e7b05700b4771ce39e04
- req_97d94e120f37a54c4a0056e047f52e90
status:
code: 200
message: OK
Expand Down
Loading

0 comments on commit 460c0ad

Please sign in to comment.