Skip to content

Commit

Permalink
Added mark vcr decorator to a bunch of tests, with fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbraza committed Sep 11, 2024
1 parent 6716bcc commit 6b29f61
Show file tree
Hide file tree
Showing 23 changed files with 2,701 additions and 24 deletions.
713 changes: 713 additions & 0 deletions tests/cassettes/TestHTTPAgentClient.test_lifecycle.yaml

Large diffs are not rendered by default.

101 changes: 101 additions & 0 deletions tests/cassettes/TestLLMModel.test_output_schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
interactions:
- request:
body:
'{"messages": [{"role": "system", "content": "Respond following this JSON
schema:\n\n{\n \"properties\": {\n \"name\": {\n \"title\": \"Name\",\n \"type\":
\"string\"\n },\n \"age\": {\n \"title\": \"Age\",\n \"type\":
\"integer\"\n }\n },\n \"required\": [\n \"name\",\n \"age\"\n ],\n \"title\":
\"DummyOutputSchema\",\n \"type\": \"object\"\n}"}, {"role": "user", "content":
"My name is Claude and I am 1 year old. What is my name and age?"}], "model":
"gpt-3.5-turbo", "response_format": {"type": "json_object"}}'
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
connection:
- keep-alive
content-length:
- "559"
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.44.1
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.44.1
x-stainless-raw-response:
- "true"
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: !!binary |
H4sIAAAAAAAAA1SQzW7CMBCE73mK1Z4TREghIbeqVXurekFV21TIJEswdWzLdgQI8e6VTfjpxYf5
POMZHyMA5A2WgPWGubrTInmcvRfZ4evjk78U+vU5e9i+LXb73aIxOcsx9g612lLtLq5RrTotyHEl
z7g2xBz51DSfzMbFfD7JA+hUQ8LbWu2SbDRNXG9WKhmnk+ng3Chek8USviMAgGM4fUfZ0B5LGMcX
pSNrWUtYXi8BoFHCK8is5dYx6TC+wVpJRzLUPlYSoELJOqqwhAqfBOsbqjA+A9YGPa3k6T7B0Lq3
zC+QvRCDfrpWEqrVRq3swK/6mktuN0tDzCrpn7dOaQz0FAH8hOn9vzWojeq0Wzr1S9IHpmlxzsPb
b9/RfIBOOSbu9GwaDQ3RHqyjbrnmsiWjDQ8/EXacoj8AAAD//wMANu8s3AgCAAA=
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8c1abafcea3c171a-SJC
Connection:
- keep-alive
Content-Encoding:
- gzip
Content-Type:
- application/json
Date:
- Wed, 11 Sep 2024 21:25:27 GMT
Server:
- cloudflare
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
openai-organization:
- future-house-xr4tdh
openai-processing-ms:
- "267"
openai-version:
- "2020-10-01"
strict-transport-security:
- max-age=15552000; includeSubDomains; preload
x-ratelimit-limit-requests:
- "12000"
x-ratelimit-limit-tokens:
- "1000000"
x-ratelimit-remaining-requests:
- "11999"
x-ratelimit-remaining-tokens:
- "999838"
x-ratelimit-reset-requests:
- 5ms
x-ratelimit-reset-tokens:
- 9ms
x-request-id:
- req_65355d90c1cb42732d3c85abb2413f94
status:
code: 200
message: OK
version: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
interactions:
- request:
body:
'{"messages": [{"role": "user", "content": [{"type": "image", "source":
{"type": "base64", "media_type": "image/png", "data": "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR4nO3NMQEAAAjDMMC/ZzDBvlRA01vZJvwHAAAAAAAAAAAAbx2jxAE/i2AjOgAAAABJRU5ErkJggg=="}},
{"type": "text", "text": "What color is this square? Respond only with the color
name."}]}], "max_tokens": 4096, "model": "claude-3-haiku-20240307"}'
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
anthropic-version:
- "2023-06-01"
connection:
- keep-alive
content-length:
- "411"
content-type:
- application/json
host:
- api.anthropic.com
user-agent:
- litellm/1.44.24
method: POST
uri: https://api.anthropic.com/v1/messages
response:
body:
string: !!binary |
H4sIAAAAAAAAA0yOT2vCQBDFv8s7byBNBOlehV5KRUS9SAlLdqrBdTZmZool5LuXiIWeHvzeH96I
LsLjKqemfNnFj3U4L982h9V2d/ve1/b+RQMc9KenOUUi4URwGHKaQRDpRAMrHK45UoJHm4JFKuri
HLqLFVVZLcq6XMKhzazECn8c/xaV7nP3IR5bipg+HURz3wwUJDM8iGOjNjCehtDNiFuCZ0vJwR6f
/IiOe9NG84VY4KtXh2z6Hy2m6RcAAP//AwB6WGlZ8AAAAA==
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8c1aba3c6c959664-SJC
Connection:
- keep-alive
Content-Encoding:
- gzip
Content-Type:
- application/json
Date:
- Wed, 11 Sep 2024 21:24:56 GMT
Server:
- cloudflare
Transfer-Encoding:
- chunked
X-Robots-Tag:
- none
request-id:
- req_01HzTrvjM4ny4Fa5TnY8n8pE
via:
- 1.1 google
x-cloud-trace-context:
- 4ab7e744703e1034c4b84f8d53549416
status:
code: 200
message: OK
version: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
interactions:
- request:
body:
'{"messages": [{"role": "user", "content": [{"type": "image_url", "image_url":
{"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR4nO3NMQEAAAjDMMC/ZzDBvlRA01vZJvwHAAAAAAAAAAAAbx2jxAE/i2AjOgAAAABJRU5ErkJggg=="}},
{"type": "text", "text": "What color is this square? Respond only with the color
name."}]}], "model": "gpt-4-turbo"}'
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
connection:
- keep-alive
content-length:
- "362"
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.44.1
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.44.1
x-stainless-raw-response:
- "true"
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: !!binary |
H4sIAAAAAAAAA1SQS0/DMBCE7/kV1p4blIT0kdyQSrkgBEVwQShykk3i4tiWvUGgqv8dOU0fXPYw
n2d21vuAMRA15AyqjlPVGxneLZ6X5dP29n39+F12r5t487LbZe6eHtbxG8y8Q5c7rOjkuql0bySS
0OqIK4uc0KfGy2QRrbJVlo2g1zVKb2sNhWlIgy11mERJGkZpGGWTu9OiQgc5+wgYY2w/Tt9T1fgD
OYtmJ6VH53iLkJ8fMQZWS68Ad0444opgdoGVVoRqrL7F+ppYbAbHfTs1SDnph/MqqVtjdekmftYb
oYTrCovcaeVjHWkDIz0EjH2OJw3/WoKxujdUkP5C5QOT5fyYB5efvNB4YqSJy2vTIpgKgvt1hH3R
CNWiNVYcD2xMkSXzuEnnNW8gOAR/AAAA//8DANYbuh/uAQAA
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8c1aba4488fdd035-SJC
Connection:
- keep-alive
Content-Encoding:
- gzip
Content-Type:
- application/json
Date:
- Wed, 11 Sep 2024 21:25:00 GMT
Server:
- cloudflare
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
openai-organization:
- future-house-xr4tdh
openai-processing-ms:
- "1891"
openai-version:
- "2020-10-01"
strict-transport-security:
- max-age=15552000; includeSubDomains; preload
x-ratelimit-limit-requests:
- "10000"
x-ratelimit-limit-tokens:
- "2000000"
x-ratelimit-remaining-requests:
- "9999"
x-ratelimit-remaining-tokens:
- "1999203"
x-ratelimit-reset-requests:
- 6ms
x-ratelimit-reset-tokens:
- 23ms
x-request-id:
- req_70379d0b10dbfd23826f5319eb7c48f4
status:
code: 200
message: OK
version: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
interactions:
- request:
body:
'{"messages": [{"role": "user", "content": [{"type": "image_url", "image_url":
{"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR4nO3NMQEAAAjDMMC/ZzDBvlRA01vZJvwHAAAAAAAAAAAAbx2jxAE/i2AjOgAAAABJRU5ErkJggg=="}},
{"type": "text", "text": "What color is this square? Respond only with the color
name."}]}], "model": "gpt-4o-mini-2024-07-18"}'
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate
connection:
- keep-alive
content-length:
- "373"
content-type:
- application/json
host:
- api.openai.com
user-agent:
- AsyncOpenAI/Python 1.44.1
x-stainless-arch:
- arm64
x-stainless-async:
- async:asyncio
x-stainless-lang:
- python
x-stainless-os:
- MacOS
x-stainless-package-version:
- 1.44.1
x-stainless-raw-response:
- "true"
x-stainless-runtime:
- CPython
x-stainless-runtime-version:
- 3.12.5
method: POST
uri: https://api.openai.com/v1/chat/completions
response:
body:
string: !!binary |
H4sIAAAAAAAAA1SQP2/CMBTE93wKyzOpkjRAyNaBpVNF/wytqshxXoKL7WfZD9QK8d0rhxTK4uF+
vvOdjwljXHW8ZlxuBUnjdPqweFoKef+46iQ9Z6+bl3YXDsq9rQ/v+ZrPogPbL5D057qTaJwGUmjP
WHoQBDE1XxaLrFpVq2oEBjvQ0TY4SktMjbIqLbKiTLNlmleTe4tKQuA1+0gYY+w4nrGn7eCb1yyb
/SkGQhAD8PpyiTHuUUeFixBUIGGJz65QoiWwY/UNdP+Jh34fRGxn91pP+unylMbBeWzDxC96r6wK
28aDCGhjbCB0fKSnhLHPcdL+piV3Ho2jhnAHNgZW82LaxK9fecX5xAhJ6BtXnkwVefgJBKbplR3A
O6/OE3vXzEso+rIqW+DJKfkFAAD//wMAfqvd//ABAAA=
headers:
CF-Cache-Status:
- DYNAMIC
CF-RAY:
- 8c1aba436f88aaa6-SJC
Connection:
- keep-alive
Content-Encoding:
- gzip
Content-Type:
- application/json
Date:
- Wed, 11 Sep 2024 21:24:58 GMT
Server:
- cloudflare
Transfer-Encoding:
- chunked
X-Content-Type-Options:
- nosniff
access-control-expose-headers:
- X-Request-ID
alt-svc:
- h3=":443"; ma=86400
openai-organization:
- future-house-xr4tdh
openai-processing-ms:
- "895"
openai-version:
- "2020-10-01"
strict-transport-security:
- max-age=15552000; includeSubDomains; preload
x-ratelimit-limit-requests:
- "30000"
x-ratelimit-limit-tokens:
- "150000000"
x-ratelimit-remaining-requests:
- "29999"
x-ratelimit-remaining-tokens:
- "149999202"
x-ratelimit-reset-requests:
- 2ms
x-ratelimit-reset-tokens:
- 0s
x-request-id:
- req_93eab71f1f2d07d3a7cb0fbe4fe21df1
status:
code: 200
message: OK
version: 1
Loading

0 comments on commit 6b29f61

Please sign in to comment.