lmnr 0.4.17b0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. lmnr/__init__.py +5 -0
  2. lmnr/cli.py +39 -0
  3. lmnr/sdk/__init__.py +0 -0
  4. lmnr/sdk/decorators.py +66 -0
  5. lmnr/sdk/evaluations.py +354 -0
  6. lmnr/sdk/laminar.py +403 -0
  7. lmnr/sdk/log.py +39 -0
  8. lmnr/sdk/types.py +155 -0
  9. lmnr/sdk/utils.py +99 -0
  10. lmnr/traceloop_sdk/.flake8 +12 -0
  11. lmnr/traceloop_sdk/.python-version +1 -0
  12. lmnr/traceloop_sdk/__init__.py +89 -0
  13. lmnr/traceloop_sdk/config/__init__.py +9 -0
  14. lmnr/traceloop_sdk/decorators/__init__.py +0 -0
  15. lmnr/traceloop_sdk/decorators/base.py +178 -0
  16. lmnr/traceloop_sdk/instruments.py +34 -0
  17. lmnr/traceloop_sdk/tests/__init__.py +1 -0
  18. lmnr/traceloop_sdk/tests/cassettes/test_association_properties/test_langchain_and_external_association_properties.yaml +101 -0
  19. lmnr/traceloop_sdk/tests/cassettes/test_association_properties/test_langchain_association_properties.yaml +99 -0
  20. lmnr/traceloop_sdk/tests/cassettes/test_manual/test_manual_report.yaml +98 -0
  21. lmnr/traceloop_sdk/tests/cassettes/test_manual/test_resource_attributes.yaml +98 -0
  22. lmnr/traceloop_sdk/tests/cassettes/test_privacy_no_prompts/test_simple_workflow.yaml +199 -0
  23. lmnr/traceloop_sdk/tests/cassettes/test_prompt_management/test_prompt_management.yaml +202 -0
  24. lmnr/traceloop_sdk/tests/cassettes/test_sdk_initialization/test_resource_attributes.yaml +199 -0
  25. lmnr/traceloop_sdk/tests/cassettes/test_tasks/test_task_io_serialization_with_langchain.yaml +96 -0
  26. lmnr/traceloop_sdk/tests/cassettes/test_workflows/test_simple_aworkflow.yaml +98 -0
  27. lmnr/traceloop_sdk/tests/cassettes/test_workflows/test_simple_workflow.yaml +199 -0
  28. lmnr/traceloop_sdk/tests/cassettes/test_workflows/test_streaming_workflow.yaml +167 -0
  29. lmnr/traceloop_sdk/tests/conftest.py +111 -0
  30. lmnr/traceloop_sdk/tests/test_association_properties.py +229 -0
  31. lmnr/traceloop_sdk/tests/test_manual.py +48 -0
  32. lmnr/traceloop_sdk/tests/test_nested_tasks.py +47 -0
  33. lmnr/traceloop_sdk/tests/test_privacy_no_prompts.py +50 -0
  34. lmnr/traceloop_sdk/tests/test_sdk_initialization.py +57 -0
  35. lmnr/traceloop_sdk/tests/test_tasks.py +32 -0
  36. lmnr/traceloop_sdk/tests/test_workflows.py +262 -0
  37. lmnr/traceloop_sdk/tracing/__init__.py +1 -0
  38. lmnr/traceloop_sdk/tracing/attributes.py +9 -0
  39. lmnr/traceloop_sdk/tracing/content_allow_list.py +24 -0
  40. lmnr/traceloop_sdk/tracing/context_manager.py +13 -0
  41. lmnr/traceloop_sdk/tracing/tracing.py +913 -0
  42. lmnr/traceloop_sdk/utils/__init__.py +26 -0
  43. lmnr/traceloop_sdk/utils/in_memory_span_exporter.py +61 -0
  44. lmnr/traceloop_sdk/utils/json_encoder.py +20 -0
  45. lmnr/traceloop_sdk/utils/package_check.py +8 -0
  46. lmnr/traceloop_sdk/version.py +1 -0
  47. lmnr-0.4.17b0.dist-info/LICENSE +75 -0
  48. lmnr-0.4.17b0.dist-info/METADATA +250 -0
  49. lmnr-0.4.17b0.dist-info/RECORD +50 -0
  50. lmnr-0.4.17b0.dist-info/WHEEL +4 -0
@@ -0,0 +1,96 @@
1
+ interactions:
2
+ - request:
3
+ body: '{"messages": [{"content": "Is Berlin the capital of Germany? Answer with
4
+ yes or no", "role": "user"}], "model": "gpt-3.5-turbo", "n": 1, "stream": false,
5
+ "temperature": 0.0}'
6
+ headers:
7
+ accept:
8
+ - application/json
9
+ accept-encoding:
10
+ - gzip, deflate
11
+ connection:
12
+ - keep-alive
13
+ content-length:
14
+ - '173'
15
+ content-type:
16
+ - application/json
17
+ host:
18
+ - api.openai.com
19
+ user-agent:
20
+ - OpenAI/Python 1.34.0
21
+ x-stainless-arch:
22
+ - arm64
23
+ x-stainless-async:
24
+ - 'false'
25
+ x-stainless-lang:
26
+ - python
27
+ x-stainless-os:
28
+ - MacOS
29
+ x-stainless-package-version:
30
+ - 1.34.0
31
+ x-stainless-runtime:
32
+ - CPython
33
+ x-stainless-runtime-version:
34
+ - 3.11.8
35
+ method: POST
36
+ uri: https://api.openai.com/v1/chat/completions
37
+ response:
38
+ body:
39
+ string: !!binary |
40
+ H4sIAAAAAAAAA1SQPU/DMBRF9/wK681N1fQ7GWFlKRMIochxX1OD7WfZL0BV5b8jp2kLi4d7c66P
41
+ c86EAL2HSoA6SlbWm7xsyo6K8vGLwunbHCy7nXxqH9YvO/W8hEkiqPlAxVdqqsh6g6zJXWoVUDKm
42
+ 1WJTbNfLxXyzHQpLezQJaz3ni+kq5y40lM+K+Wokj6QVRqjEWyaEEOfhTI5ujz9QidnkmliMUbYI
43
+ 1e0jISCQSQnIGHVk6Rgm91KRY3SD9itGGIv+tmio9YGadLvrjLnlB+10PNYBZSSX6MjkL3ifCfE+
44
+ mHf/ZMAHsp5rpk90abAoL3Nw/1d/yrFjYmnu8XyWjXoQT5HR1gftWgw+6OEVSTLrs18AAAD//wMA
45
+ kVnOwcQBAAA=
46
+ headers:
47
+ CF-Cache-Status:
48
+ - DYNAMIC
49
+ CF-RAY:
50
+ - 89549007cb0d09cd-HFA
51
+ Connection:
52
+ - keep-alive
53
+ Content-Encoding:
54
+ - gzip
55
+ Content-Type:
56
+ - application/json
57
+ Date:
58
+ - Mon, 17 Jun 2024 16:54:38 GMT
59
+ Server:
60
+ - cloudflare
61
+ Set-Cookie:
62
+ - __cf_bm=Gh1qVfLP3osdAlsfwZ95bPcQ70P7y7P2GqkDpwv_114-1718643278-1.0.1.1-Ylx9MccknWpIdVgOohfqOJxbkQtk.DOSwQ2W1Fhzbzpaygq4eIg45EE7awsQUWAOUe1YQZUfX8_MTak1JE0kdA;
63
+ path=/; expires=Mon, 17-Jun-24 17:24:38 GMT; domain=.api.openai.com; HttpOnly;
64
+ Secure; SameSite=None
65
+ - _cfuvid=eicdezJPZl1ydM5agPhmwxuY_PMRMVLW3JlEWKMBbgc-1718643278656-0.0.1.1-604800000;
66
+ path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
67
+ Transfer-Encoding:
68
+ - chunked
69
+ alt-svc:
70
+ - h3=":443"; ma=86400
71
+ openai-organization:
72
+ - traceloop
73
+ openai-processing-ms:
74
+ - '245'
75
+ openai-version:
76
+ - '2020-10-01'
77
+ strict-transport-security:
78
+ - max-age=15724800; includeSubDomains
79
+ x-ratelimit-limit-requests:
80
+ - '5000'
81
+ x-ratelimit-limit-tokens:
82
+ - '160000'
83
+ x-ratelimit-remaining-requests:
84
+ - '4999'
85
+ x-ratelimit-remaining-tokens:
86
+ - '159969'
87
+ x-ratelimit-reset-requests:
88
+ - 12ms
89
+ x-ratelimit-reset-tokens:
90
+ - 11ms
91
+ x-request-id:
92
+ - req_6dc4b2c486e29ab298a3c8a30995470e
93
+ status:
94
+ code: 200
95
+ message: OK
96
+ version: 1
@@ -0,0 +1,98 @@
1
+ interactions:
2
+ - request:
3
+ body: '{"messages": [{"role": "user", "content": "Tell me a joke about OpenTelemetry"}],
4
+ "model": "gpt-3.5-turbo"}'
5
+ headers:
6
+ accept:
7
+ - application/json
8
+ accept-encoding:
9
+ - gzip, deflate
10
+ connection:
11
+ - keep-alive
12
+ content-length:
13
+ - '107'
14
+ content-type:
15
+ - application/json
16
+ host:
17
+ - api.openai.com
18
+ user-agent:
19
+ - AsyncOpenAI/Python 1.35.15
20
+ x-stainless-arch:
21
+ - arm64
22
+ x-stainless-async:
23
+ - async:asyncio
24
+ x-stainless-lang:
25
+ - python
26
+ x-stainless-os:
27
+ - MacOS
28
+ x-stainless-package-version:
29
+ - 1.35.15
30
+ x-stainless-runtime:
31
+ - CPython
32
+ x-stainless-runtime-version:
33
+ - 3.9.5
34
+ method: POST
35
+ uri: https://api.openai.com/v1/chat/completions
36
+ response:
37
+ body:
38
+ string: !!binary |
39
+ H4sIAAAAAAAAA1SRT08CMRDF7/spxp7BAJsNfy4metRoiCiJxpDSHXYL3U5tB2FD+O6mywJ66eH9
40
+ 5k3fzBwSAKFzMQGhSsmqcqY7ptHUvT+Nq+9Zrzcf0m7G04/n9cP+7TV/FJ3ooOUaFZ9dt4oqZ5A1
41
+ 2RNWHiVj7NofDvrDNBul4wZUlKOJtsJxN73Nurz1S+r2+oOsdZakFQYxgc8EAODQvDGjzXEvJtDr
42
+ nJUKQ5AFismlCEB4MlERMgQdWFoWnStUZBltE3te1pDrHLhEeHFoZ2iwQvY15PiDhhx6KAiWnjZ4
43
+ B/eo5DZgrK5hhx5Bmp2sA7CXStsiAu0B9w5twHAj2j+Pl7CGCudpGQezW2Mu+kpbHcqFRxnIxmCB
44
+ yZ3sxwTgq1nK9t+cwnmqHC+YNmhjw352aieuZ/gDRy1kYmmuepombT4R6sBYLVbaFuid182GYsrk
45
+ mPwCAAD//wMA0ggXjCACAAA=
46
+ headers:
47
+ CF-Cache-Status:
48
+ - DYNAMIC
49
+ CF-RAY:
50
+ - 8a7b7e065dbe09b9-HFA
51
+ Connection:
52
+ - keep-alive
53
+ Content-Encoding:
54
+ - gzip
55
+ Content-Type:
56
+ - application/json
57
+ Date:
58
+ - Tue, 23 Jul 2024 11:57:20 GMT
59
+ Server:
60
+ - cloudflare
61
+ Set-Cookie:
62
+ - __cf_bm=i1KFoZSyRXnIoD4BIR9Xs3qMj7bNNyzawZ0EmQmdC4k-1721735840-1.0.1.1-EUFFrC3qgKhnj6WZ2jcCXrRgvcdPsFl1ZQS7OQkl9HPYpFTAMJ6_h6CGwMUQZ0snpzqKoOU.V7ncuFtd4GcOBg;
63
+ path=/; expires=Tue, 23-Jul-24 12:27:20 GMT; domain=.api.openai.com; HttpOnly;
64
+ Secure; SameSite=None
65
+ - _cfuvid=TA6paBnj9YCltuuiD4.DPXHHjLE2BJq6nAcZsD8jPDU-1721735840397-0.0.1.1-604800000;
66
+ path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
67
+ Transfer-Encoding:
68
+ - chunked
69
+ X-Content-Type-Options:
70
+ - nosniff
71
+ alt-svc:
72
+ - h3=":443"; ma=86400
73
+ openai-organization:
74
+ - traceloop
75
+ openai-processing-ms:
76
+ - '286'
77
+ openai-version:
78
+ - '2020-10-01'
79
+ strict-transport-security:
80
+ - max-age=15552000; includeSubDomains; preload
81
+ x-ratelimit-limit-requests:
82
+ - '5000'
83
+ x-ratelimit-limit-tokens:
84
+ - '4000000'
85
+ x-ratelimit-remaining-requests:
86
+ - '4999'
87
+ x-ratelimit-remaining-tokens:
88
+ - '3999973'
89
+ x-ratelimit-reset-requests:
90
+ - 12ms
91
+ x-ratelimit-reset-tokens:
92
+ - 0s
93
+ x-request-id:
94
+ - req_dbf3f3565198e12aea25e38837534938
95
+ status:
96
+ code: 200
97
+ message: OK
98
+ version: 1
@@ -0,0 +1,199 @@
1
+ interactions:
2
+ - request:
3
+ body: '{"messages": [{"role": "user", "content": "Tell me a joke about OpenTelemetry"}],
4
+ "model": "gpt-3.5-turbo"}'
5
+ headers:
6
+ accept:
7
+ - application/json
8
+ accept-encoding:
9
+ - gzip, deflate
10
+ connection:
11
+ - keep-alive
12
+ content-length:
13
+ - '107'
14
+ content-type:
15
+ - application/json
16
+ host:
17
+ - api.openai.com
18
+ user-agent:
19
+ - OpenAI/Python 1.12.0
20
+ x-stainless-arch:
21
+ - arm64
22
+ x-stainless-async:
23
+ - 'false'
24
+ x-stainless-lang:
25
+ - python
26
+ x-stainless-os:
27
+ - MacOS
28
+ x-stainless-package-version:
29
+ - 1.12.0
30
+ x-stainless-runtime:
31
+ - CPython
32
+ x-stainless-runtime-version:
33
+ - 3.9.5
34
+ method: POST
35
+ uri: https://api.openai.com/v1/chat/completions
36
+ response:
37
+ body:
38
+ string: !!binary |
39
+ H4sIAAAAAAAAA1SRTW/bMAyG7/4VrM5J4Th1muYyYJcdBrToNiCHYQhomZGVyKImMUvTIv+9kPOF
40
+ XXR4P4iH1EcBoGyrFqB0h6L74Mbz/d/X5+/N5p3Ncvat+WmqsHnjavvDLafPapQb3GxIy6V1r7kP
41
+ jsSyP9k6EgrlqZPH8qmc1tW0HoyeW3K5ZoKMp/f1WHax4XE5qepzs2OrKakF/C4AAD6GNzP6lt7U
42
+ AsrRRekpJTSkFtcQgIrssqIwJZsEvajRzdTshfyAvewO0NoWpCN4CeR/kaOeJB4ADXkBQwLW/7NC
43
+ LQgDOjdEA0axlL7AV9K4SwRWAN0eDwm2nvcJOt7nvETUBAiGuQWxPd2pM8bxyu/YhMhN3tXvnLvq
44
+ a+tt6laRMLHPrEk4nOrHAuDPcKfdf6urELkPshLeks8DJ/VpnLr9zM2sLqawoLvpD2Vx5lPpkIT6
45
+ 1dp6QzFEezraOqzms0k9w6cHLFVxLD4BAAD//wMA0GjZDD4CAAA=
46
+ headers:
47
+ CF-Cache-Status:
48
+ - DYNAMIC
49
+ CF-RAY:
50
+ - 85c044aeb9be0d68-MXP
51
+ Cache-Control:
52
+ - no-cache, must-revalidate
53
+ Connection:
54
+ - keep-alive
55
+ Content-Encoding:
56
+ - gzip
57
+ Content-Type:
58
+ - application/json
59
+ Date:
60
+ - Tue, 27 Feb 2024 12:00:36 GMT
61
+ Server:
62
+ - cloudflare
63
+ Set-Cookie:
64
+ - __cf_bm=6OMyJmXVQKbgixGmrzfEUQ2Lxs7bTxFr0rWbdpIwpdE-1709035236-1.0-ATrSdiYHD8+xMObzA+ZwowLYajT6OhzdWOzWxTSkbfqhoVWfaUWiAE77LDPTTYjfaRTNm3oVlsZuFbuTTcyseFU=;
65
+ path=/; expires=Tue, 27-Feb-24 12:30:36 GMT; domain=.api.openai.com; HttpOnly;
66
+ Secure; SameSite=None
67
+ - _cfuvid=XP.UBiRvcB8o7L3s3e_ws6vWajdiQ7S2LuHGgf6XNfo-1709035236601-0.0-604800000;
68
+ path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
69
+ Transfer-Encoding:
70
+ - chunked
71
+ access-control-allow-origin:
72
+ - '*'
73
+ alt-svc:
74
+ - h3=":443"; ma=86400
75
+ openai-model:
76
+ - gpt-3.5-turbo-0125
77
+ openai-organization:
78
+ - traceloop
79
+ openai-processing-ms:
80
+ - '763'
81
+ openai-version:
82
+ - '2020-10-01'
83
+ strict-transport-security:
84
+ - max-age=15724800; includeSubDomains
85
+ x-ratelimit-limit-requests:
86
+ - '5000'
87
+ x-ratelimit-limit-tokens:
88
+ - '160000'
89
+ x-ratelimit-remaining-requests:
90
+ - '4999'
91
+ x-ratelimit-remaining-tokens:
92
+ - '159974'
93
+ x-ratelimit-reset-requests:
94
+ - 12ms
95
+ x-ratelimit-reset-tokens:
96
+ - 9ms
97
+ x-request-id:
98
+ - req_ba571b1016f37b097d88dc2d9ff722ca
99
+ status:
100
+ code: 200
101
+ message: OK
102
+ - request:
103
+ body: '{"messages": [{"role": "user", "content": "Tell me a joke about OpenTelemetry"}],
104
+ "model": "gpt-3.5-turbo"}'
105
+ headers:
106
+ accept:
107
+ - application/json
108
+ accept-encoding:
109
+ - gzip, deflate
110
+ connection:
111
+ - keep-alive
112
+ content-length:
113
+ - '107'
114
+ content-type:
115
+ - application/json
116
+ cookie:
117
+ - __cf_bm=6OMyJmXVQKbgixGmrzfEUQ2Lxs7bTxFr0rWbdpIwpdE-1709035236-1.0-ATrSdiYHD8+xMObzA+ZwowLYajT6OhzdWOzWxTSkbfqhoVWfaUWiAE77LDPTTYjfaRTNm3oVlsZuFbuTTcyseFU=;
118
+ _cfuvid=XP.UBiRvcB8o7L3s3e_ws6vWajdiQ7S2LuHGgf6XNfo-1709035236601-0.0-604800000
119
+ host:
120
+ - api.openai.com
121
+ user-agent:
122
+ - OpenAI/Python 1.12.0
123
+ x-stainless-arch:
124
+ - arm64
125
+ x-stainless-async:
126
+ - 'false'
127
+ x-stainless-lang:
128
+ - python
129
+ x-stainless-os:
130
+ - MacOS
131
+ x-stainless-package-version:
132
+ - 1.12.0
133
+ x-stainless-runtime:
134
+ - CPython
135
+ x-stainless-runtime-version:
136
+ - 3.9.5
137
+ method: POST
138
+ uri: https://api.openai.com/v1/chat/completions
139
+ response:
140
+ body:
141
+ string: !!binary |
142
+ H4sIAAAAAAAAA1SRS0/DMBCE7/kVi88tSh8pbS9IiBOVqJBAICiqXGebmDpe195QAup/R+4TLj7M
143
+ 5xnPrn8SAKFzMQahSsmqcqY93KwfpnfN63rN/Rc3ua+/b8Mk/3xpisentWhFBy0+UPHRdamocgZZ
144
+ k91j5VEyxtTOVTpKe1m3N9iBinI00VY4bvcuszbXfkHttNPNDs6StMIgxvCWAAD87M7Y0eb4JcaQ
145
+ to5KhSHIAsX4dAlAeDJRETIEHVhaFq0zVGQZ7a72c9lArnPgEmHq0D6iwQrZN5DjJxpy6KEgWHha
146
+ 4TXM7MzeoJJ1wOhoYIMeQZqNbAKwl0rbIgLtITi0ubbFhTi8uz0VNlQ4T4s4nK2NOelLbXUo5x5l
147
+ IBvLBSa3t28TgPfdYup/swrnqXI8Z1qhjYGdbB8nzl/xB44OkImlOeu9fnLoJ0ITGKv5UtsCvfN6
148
+ v6Wlmw8HnWwgR32ZimSb/AIAAP//AwDrH+cDLwIAAA==
149
+ headers:
150
+ CF-Cache-Status:
151
+ - DYNAMIC
152
+ CF-RAY:
153
+ - 85c044b58f020d68-MXP
154
+ Cache-Control:
155
+ - no-cache, must-revalidate
156
+ Connection:
157
+ - keep-alive
158
+ Content-Encoding:
159
+ - gzip
160
+ Content-Type:
161
+ - application/json
162
+ Date:
163
+ - Tue, 27 Feb 2024 12:00:38 GMT
164
+ Server:
165
+ - cloudflare
166
+ Transfer-Encoding:
167
+ - chunked
168
+ access-control-allow-origin:
169
+ - '*'
170
+ alt-svc:
171
+ - h3=":443"; ma=86400
172
+ openai-model:
173
+ - gpt-3.5-turbo-0125
174
+ openai-organization:
175
+ - traceloop
176
+ openai-processing-ms:
177
+ - '1880'
178
+ openai-version:
179
+ - '2020-10-01'
180
+ strict-transport-security:
181
+ - max-age=15724800; includeSubDomains
182
+ x-ratelimit-limit-requests:
183
+ - '5000'
184
+ x-ratelimit-limit-tokens:
185
+ - '160000'
186
+ x-ratelimit-remaining-requests:
187
+ - '4999'
188
+ x-ratelimit-remaining-tokens:
189
+ - '159974'
190
+ x-ratelimit-reset-requests:
191
+ - 12ms
192
+ x-ratelimit-reset-tokens:
193
+ - 9ms
194
+ x-request-id:
195
+ - req_e140fa1074dedf49709df27beef3001b
196
+ status:
197
+ code: 200
198
+ message: OK
199
+ version: 1
@@ -0,0 +1,167 @@
1
+ interactions:
2
+ - request:
3
+ body: '{"messages": [{"role": "user", "content": "Tell me a joke about OpenTelemetry"}],
4
+ "model": "gpt-3.5-turbo", "stream": true}'
5
+ headers:
6
+ accept:
7
+ - application/json
8
+ accept-encoding:
9
+ - gzip, deflate
10
+ connection:
11
+ - keep-alive
12
+ content-length:
13
+ - '123'
14
+ content-type:
15
+ - application/json
16
+ host:
17
+ - api.openai.com
18
+ user-agent:
19
+ - OpenAI/Python 1.29.0
20
+ x-stainless-arch:
21
+ - arm64
22
+ x-stainless-async:
23
+ - 'false'
24
+ x-stainless-lang:
25
+ - python
26
+ x-stainless-os:
27
+ - MacOS
28
+ x-stainless-package-version:
29
+ - 1.29.0
30
+ x-stainless-runtime:
31
+ - CPython
32
+ x-stainless-runtime-version:
33
+ - 3.9.5
34
+ method: POST
35
+ uri: https://api.openai.com/v1/chat/completions
36
+ response:
37
+ body:
38
+ string: 'data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}]}
39
+
40
+
41
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Why"},"logprobs":null,"finish_reason":null}]}
42
+
43
+
44
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
45
+ did"},"logprobs":null,"finish_reason":null}]}
46
+
47
+
48
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
49
+ the"},"logprobs":null,"finish_reason":null}]}
50
+
51
+
52
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
53
+ Open"},"logprobs":null,"finish_reason":null}]}
54
+
55
+
56
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Te"},"logprobs":null,"finish_reason":null}]}
57
+
58
+
59
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"lemetry"},"logprobs":null,"finish_reason":null}]}
60
+
61
+
62
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
63
+ project"},"logprobs":null,"finish_reason":null}]}
64
+
65
+
66
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
67
+ go"},"logprobs":null,"finish_reason":null}]}
68
+
69
+
70
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
71
+ to"},"logprobs":null,"finish_reason":null}]}
72
+
73
+
74
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
75
+ therapy"},"logprobs":null,"finish_reason":null}]}
76
+
77
+
78
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"?"},"logprobs":null,"finish_reason":null}]}
79
+
80
+
81
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
82
+ Because"},"logprobs":null,"finish_reason":null}]}
83
+
84
+
85
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
86
+ it"},"logprobs":null,"finish_reason":null}]}
87
+
88
+
89
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
90
+ had"},"logprobs":null,"finish_reason":null}]}
91
+
92
+
93
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
94
+ too"},"logprobs":null,"finish_reason":null}]}
95
+
96
+
97
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
98
+ many"},"logprobs":null,"finish_reason":null}]}
99
+
100
+
101
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
102
+ mixed"},"logprobs":null,"finish_reason":null}]}
103
+
104
+
105
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"
106
+ signals"},"logprobs":null,"finish_reason":null}]}
107
+
108
+
109
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"!"},"logprobs":null,"finish_reason":null}]}
110
+
111
+
112
+ data: {"id":"chatcmpl-9OmDmBFHEMbZ31rnA9lGQVDOehR90","object":"chat.completion.chunk","created":1715692262,"model":"gpt-3.5-turbo-0125","system_fingerprint":null,"choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}
113
+
114
+
115
+ data: [DONE]
116
+
117
+
118
+ '
119
+ headers:
120
+ CF-Cache-Status:
121
+ - DYNAMIC
122
+ CF-RAY:
123
+ - 883b21bd48433757-MXP
124
+ Connection:
125
+ - keep-alive
126
+ Content-Type:
127
+ - text/event-stream; charset=utf-8
128
+ Date:
129
+ - Tue, 14 May 2024 13:11:02 GMT
130
+ Server:
131
+ - cloudflare
132
+ Set-Cookie:
133
+ - __cf_bm=.XvQIxrHkdjS_lppgd.ONqVkLX2zudBgR.99K5inab0-1715692262-1.0.1.1-4NFlLxxPE4GhJUwcqVuShu7r29Wsv6mCxObuGBm7WaBuVBW22_MYG6uT0eJ1DUdmuZ9nykZ7bwQeYmQRkGgCdA;
134
+ path=/; expires=Tue, 14-May-24 13:41:02 GMT; domain=.api.openai.com; HttpOnly;
135
+ Secure; SameSite=None
136
+ - _cfuvid=l3N15ZuTdlc6cNEordeiaV5FrYGVfteXAquEnUzpYpk-1715692262541-0.0.1.1-604800000;
137
+ path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
138
+ Transfer-Encoding:
139
+ - chunked
140
+ alt-svc:
141
+ - h3=":443"; ma=86400
142
+ openai-organization:
143
+ - traceloop
144
+ openai-processing-ms:
145
+ - '268'
146
+ openai-version:
147
+ - '2020-10-01'
148
+ strict-transport-security:
149
+ - max-age=15724800; includeSubDomains
150
+ x-ratelimit-limit-requests:
151
+ - '5000'
152
+ x-ratelimit-limit-tokens:
153
+ - '160000'
154
+ x-ratelimit-remaining-requests:
155
+ - '4999'
156
+ x-ratelimit-remaining-tokens:
157
+ - '159974'
158
+ x-ratelimit-reset-requests:
159
+ - 12ms
160
+ x-ratelimit-reset-tokens:
161
+ - 9ms
162
+ x-request-id:
163
+ - req_1bf87984992f16d43b7eb6e9338a0d05
164
+ status:
165
+ code: 200
166
+ message: OK
167
+ version: 1
@@ -0,0 +1,111 @@
1
+ # """Unit tests configuration module."""
2
+
3
+ # import os
4
+ # import pytest
5
+ # from lmnr.traceloop_sdk import Traceloop
6
+ # from lmnr.traceloop_sdk.instruments import Instruments
7
+ # from lmnr.traceloop_sdk.tracing.tracing import TracerWrapper
8
+ # from opentelemetry.sdk.trace.export import SimpleSpanProcessor
9
+ # from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter
10
+
11
+ # # pytest_plugins = []
12
+
13
+
14
+ # @pytest.fixture(scope="session")
15
+ # def exporter():
16
+ # exporter = InMemorySpanExporter()
17
+ # Traceloop.init(
18
+ # app_name="test",
19
+ # resource_attributes={"something": "yes"},
20
+ # disable_batch=True,
21
+ # exporter=exporter,
22
+ # )
23
+ # return exporter
24
+
25
+
26
+ # @pytest.fixture(autouse=True)
27
+ # def clear_exporter(exporter):
28
+ # exporter.clear()
29
+
30
+
31
+ # @pytest.fixture(autouse=True)
32
+ # def environment():
33
+ # if "OPENAI_API_KEY" not in os.environ:
34
+ # os.environ["OPENAI_API_KEY"] = "test_api_key"
35
+
36
+
37
+ # @pytest.fixture(scope="module")
38
+ # def vcr_config():
39
+ # return {
40
+ # "filter_headers": ["authorization"],
41
+ # "ignore_hosts": ["openaipublic.blob.core.windows.net"],
42
+ # }
43
+
44
+
45
+ # @pytest.fixture
46
+ # def exporter_with_custom_span_processor():
47
+ # # Clear singleton if existed
48
+ # if hasattr(TracerWrapper, "instance"):
49
+ # _trace_wrapper_instance = TracerWrapper.instance
50
+ # del TracerWrapper.instance
51
+
52
+ # class CustomSpanProcessor(SimpleSpanProcessor):
53
+ # def on_start(self, span, parent_context=None):
54
+ # span.set_attribute("custom_span", "yes")
55
+
56
+ # exporter = InMemorySpanExporter()
57
+ # Traceloop.init(
58
+ # exporter=exporter,
59
+ # processor=CustomSpanProcessor(exporter),
60
+ # )
61
+
62
+ # yield exporter
63
+
64
+ # # Restore singleton if any
65
+ # if _trace_wrapper_instance:
66
+ # TracerWrapper.instance = _trace_wrapper_instance
67
+
68
+
69
+ # @pytest.fixture
70
+ # def exporter_with_custom_instrumentations():
71
+ # # Clear singleton if existed
72
+ # if hasattr(TracerWrapper, "instance"):
73
+ # _trace_wrapper_instance = TracerWrapper.instance
74
+ # del TracerWrapper.instance
75
+
76
+ # exporter = InMemorySpanExporter()
77
+ # Traceloop.init(
78
+ # exporter=exporter,
79
+ # disable_batch=True,
80
+ # instruments=[i for i in Instruments],
81
+ # )
82
+
83
+ # yield exporter
84
+
85
+ # # Restore singleton if any
86
+ # if _trace_wrapper_instance:
87
+ # TracerWrapper.instance = _trace_wrapper_instance
88
+
89
+
90
+ # @pytest.fixture
91
+ # def exporter_with_no_metrics():
92
+ # # Clear singleton if existed
93
+ # if hasattr(TracerWrapper, "instance"):
94
+ # _trace_wrapper_instance = TracerWrapper.instance
95
+ # del TracerWrapper.instance
96
+
97
+ # os.environ["TRACELOOP_METRICS_ENABLED"] = "false"
98
+
99
+ # exporter = InMemorySpanExporter()
100
+
101
+ # Traceloop.init(
102
+ # exporter=exporter,
103
+ # disable_batch=True,
104
+ # )
105
+
106
+ # yield exporter
107
+
108
+ # # Restore singleton if any
109
+ # if _trace_wrapper_instance:
110
+ # TracerWrapper.instance = _trace_wrapper_instance
111
+ # os.environ["TRACELOOP_METRICS_ENABLED"] = "true"