-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sdk): api for manual logging of LLM calls (#264)
- Loading branch information
Showing
4 changed files
with
649 additions
and
6 deletions.
There are no files selected for viewing
232 changes: 232 additions & 0 deletions
232
...tors_847855269/should-create-spans-for-manual-LLM-instrumentation_981493419/recording.har
This file contains 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,232 @@ | ||
{ | ||
"log": { | ||
"_recordingName": "Test SDK Decorators/should create spans for manual LLM instrumentation", | ||
"creator": { | ||
"comment": "persister:fs", | ||
"name": "Polly.JS", | ||
"version": "6.0.6" | ||
}, | ||
"entries": [ | ||
{ | ||
"_id": "80b48c70cae76a3c38b9af59d5273e33", | ||
"_order": 0, | ||
"cache": {}, | ||
"request": { | ||
"bodySize": 139, | ||
"cookies": [], | ||
"headers": [ | ||
{ | ||
"_fromType": "array", | ||
"name": "content-length", | ||
"value": "139" | ||
}, | ||
{ | ||
"_fromType": "array", | ||
"name": "accept", | ||
"value": "application/json" | ||
}, | ||
{ | ||
"_fromType": "array", | ||
"name": "content-type", | ||
"value": "application/json" | ||
}, | ||
{ | ||
"_fromType": "array", | ||
"name": "user-agent", | ||
"value": "OpenAI/JS 4.38.3" | ||
}, | ||
{ | ||
"_fromType": "array", | ||
"name": "x-stainless-lang", | ||
"value": "js" | ||
}, | ||
{ | ||
"_fromType": "array", | ||
"name": "x-stainless-package-version", | ||
"value": "4.38.3" | ||
}, | ||
{ | ||
"_fromType": "array", | ||
"name": "x-stainless-os", | ||
"value": "MacOS" | ||
}, | ||
{ | ||
"_fromType": "array", | ||
"name": "x-stainless-arch", | ||
"value": "arm64" | ||
}, | ||
{ | ||
"_fromType": "array", | ||
"name": "x-stainless-runtime", | ||
"value": "node" | ||
}, | ||
{ | ||
"_fromType": "array", | ||
"name": "x-stainless-runtime-version", | ||
"value": "v18.17.1" | ||
}, | ||
{ | ||
"_fromType": "array", | ||
"name": "accept-encoding", | ||
"value": "gzip,deflate" | ||
}, | ||
{ | ||
"name": "host", | ||
"value": "api.openai.com" | ||
} | ||
], | ||
"headersSize": 470, | ||
"httpVersion": "HTTP/1.1", | ||
"method": "POST", | ||
"postData": { | ||
"mimeType": "application/json", | ||
"params": [], | ||
"text": "{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Tell me a joke about OpenTelemetry\"\n }\n ],\n \"model\": \"gpt-3.5-turbo\"\n}" | ||
}, | ||
"queryString": [], | ||
"url": "https://api.openai.com/v1/chat/completions" | ||
}, | ||
"response": { | ||
"bodySize": 491, | ||
"content": { | ||
"encoding": "base64", | ||
"mimeType": "application/json", | ||
"size": 491, | ||
"text": "[\"H4sIAAAAAAAAA1SRT2vDMAzF7/kUms/taFpC017GxmAMBh3bSgtjFCdRE6+OZWxlbSj97sPpv+3iw3t68k/SPgIQqhBTEHklOa+t7k9el1t6vt+q5GmSLtP54/tuZtPSvmwW8zfRCwnKvjHnc+o2p9pqZEXmaOcOJWPoGo/jJB0n4+GwM2oqUIdYabk/uk363LiM+oN4mJySFakcvZjCZwQAsO/ewGgK3IkpDHpnpUbvZYlieikCEI50UIT0XnmWhkXvauZkGE2HvahaKFQBXCHMLJoP1FgjuxYK/EFNFh2UBJmjDd7BA+ay8RiqW9iiQ5B6K1sPXg==\",\"1lYrU8KaHLCjJtN4I04/Hi6omkrrKAtjmUbri75WRvlq5VB6MgHLM9lj/BABfHUraf5NKayj2vKKaYMmNIyTYztxPcIfMz2ZTCz1VR+NohOf8K1nrFdrZUp01qluP4EyOkS/AAAA//8DAMTz7T0eAgAA\"]" | ||
}, | ||
"cookies": [ | ||
{ | ||
"domain": ".api.openai.com", | ||
"expires": "2024-05-16T16:38:43.000Z", | ||
"httpOnly": true, | ||
"name": "__cf_bm", | ||
"path": "/", | ||
"sameSite": "None", | ||
"secure": true, | ||
"value": "eAINKaQ0O3tdSzB.KOxjAHZ7AdV9qQHAOaBv2.3yn1k-1715875723-1.0.1.1-lJcLz_EuaF8Y01g9hzqDWo0bzCPfONiL0mogjqJhNdyyROSixq4FgyI2Cf2bakaQxuzIumKzXIS6oNw2p_AfHw" | ||
}, | ||
{ | ||
"domain": ".api.openai.com", | ||
"httpOnly": true, | ||
"name": "_cfuvid", | ||
"path": "/", | ||
"sameSite": "None", | ||
"secure": true, | ||
"value": "mnsAAZGFXU4qk2hW2DwDVg71nGu_MASZVL2AJqgEbv4-1715875723340-0.0.1.1-604800000" | ||
} | ||
], | ||
"headers": [ | ||
{ | ||
"name": "date", | ||
"value": "Thu, 16 May 2024 16:08:43 GMT" | ||
}, | ||
{ | ||
"name": "content-type", | ||
"value": "application/json" | ||
}, | ||
{ | ||
"name": "transfer-encoding", | ||
"value": "chunked" | ||
}, | ||
{ | ||
"name": "connection", | ||
"value": "keep-alive" | ||
}, | ||
{ | ||
"name": "openai-organization", | ||
"value": "traceloop" | ||
}, | ||
{ | ||
"name": "openai-processing-ms", | ||
"value": "804" | ||
}, | ||
{ | ||
"name": "openai-version", | ||
"value": "2020-10-01" | ||
}, | ||
{ | ||
"name": "strict-transport-security", | ||
"value": "max-age=15724800; includeSubDomains" | ||
}, | ||
{ | ||
"name": "x-ratelimit-limit-requests", | ||
"value": "5000" | ||
}, | ||
{ | ||
"name": "x-ratelimit-limit-tokens", | ||
"value": "160000" | ||
}, | ||
{ | ||
"name": "x-ratelimit-remaining-requests", | ||
"value": "4999" | ||
}, | ||
{ | ||
"name": "x-ratelimit-remaining-tokens", | ||
"value": "159974" | ||
}, | ||
{ | ||
"name": "x-ratelimit-reset-requests", | ||
"value": "12ms" | ||
}, | ||
{ | ||
"name": "x-ratelimit-reset-tokens", | ||
"value": "9ms" | ||
}, | ||
{ | ||
"name": "x-request-id", | ||
"value": "req_9d2a45908700e557bd9eaf0294dd79cc" | ||
}, | ||
{ | ||
"name": "cf-cache-status", | ||
"value": "DYNAMIC" | ||
}, | ||
{ | ||
"_fromType": "array", | ||
"name": "set-cookie", | ||
"value": "__cf_bm=eAINKaQ0O3tdSzB.KOxjAHZ7AdV9qQHAOaBv2.3yn1k-1715875723-1.0.1.1-lJcLz_EuaF8Y01g9hzqDWo0bzCPfONiL0mogjqJhNdyyROSixq4FgyI2Cf2bakaQxuzIumKzXIS6oNw2p_AfHw; path=/; expires=Thu, 16-May-24 16:38:43 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" | ||
}, | ||
{ | ||
"_fromType": "array", | ||
"name": "set-cookie", | ||
"value": "_cfuvid=mnsAAZGFXU4qk2hW2DwDVg71nGu_MASZVL2AJqgEbv4-1715875723340-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" | ||
}, | ||
{ | ||
"name": "server", | ||
"value": "cloudflare" | ||
}, | ||
{ | ||
"name": "cf-ray", | ||
"value": "884ca0c0989159ef-MXP" | ||
}, | ||
{ | ||
"name": "content-encoding", | ||
"value": "gzip" | ||
}, | ||
{ | ||
"name": "alt-svc", | ||
"value": "h3=\":443\"; ma=86400" | ||
} | ||
], | ||
"headersSize": 1100, | ||
"httpVersion": "HTTP/1.1", | ||
"redirectURL": "", | ||
"status": 200, | ||
"statusText": "OK" | ||
}, | ||
"startedDateTime": "2024-05-16T16:08:42.253Z", | ||
"time": 1072, | ||
"timings": { | ||
"blocked": -1, | ||
"connect": -1, | ||
"dns": -1, | ||
"receive": 0, | ||
"send": 0, | ||
"ssl": -1, | ||
"wait": 1072 | ||
} | ||
} | ||
], | ||
"pages": [], | ||
"version": "1.2" | ||
} | ||
} |
Oops, something went wrong.