Skip to content

Commit 061bb6d

Browse files
test: convert DeepSeek live tests to cassettes (0xPlaygrounds#1870)
1 parent 5f52267 commit 061bb6d

40 files changed

Lines changed: 11516 additions & 629 deletions
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
when:
2+
path: /chat/completions
3+
method: POST
4+
query_param: []
5+
header:
6+
- name: accept
7+
value: '*/*'
8+
- name: content-type
9+
value: application/json
10+
body: '{"messages":[{"content":"You are a concise assistant. Answer directly.","role":"system"},{"content":"In one or two sentences, explain what Rust programming language is and why memory safety matters.","role":"user"}],"model":"deepseek-v4-flash"}'
11+
then:
12+
status: 200
13+
header:
14+
- name: content-type
15+
value: application/json
16+
body: '{"choices":[{"finish_reason":"stop","index":0,"logprobs":null,"message":{"content":"Rust is a systems programming language that ensures memory safety at compile time through its ownership model and borrow checker, eliminating common bugs without needing a garbage collector. Memory safety is crucial because it prevents vulnerabilities like buffer overflows and dangling pointers, which can cause crashes, data corruption, or security exploits.","reasoning_content":"We need to explain Rust and why memory safety matters in one or two sentences. Keep concise. Rust is a systems programming language that focuses on safety, speed, and concurrency, using a borrow checker to enforce memory safety without garbage collection. Memory safety matters because it prevents common bugs like buffer overflows and use-after-free, which can lead to crashes, security vulnerabilities, and undefined behavior.","role":"assistant"}}],"created":0,"id":"chatcmpl-REDACTED_1","model":"deepseek-v4-flash","object":"chat.completion","system_fingerprint":"fp_REDACTED_1","usage":{"completion_tokens":138,"completion_tokens_details":{"reasoning_tokens":78},"prompt_cache_hit_tokens":0,"prompt_cache_miss_tokens":31,"prompt_tokens":31,"prompt_tokens_details":{"cached_tokens":0},"total_tokens":169}}'
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
when:
2+
path: /chat/completions
3+
method: POST
4+
query_param: []
5+
header:
6+
- name: accept
7+
value: '*/*'
8+
- name: content-type
9+
value: application/json
10+
body: '{"messages":[{"content":"You are an AI assistant whose purpose is to extract structured data from the provided text.\nYou will have access to a `submit` function that defines the structure of the data to extract from the provided text.\nUse the `submit` function to submit the structured data.\nBe sure to fill out every field and ALWAYS CALL THE `submit` function, even with default values!!!.\n ","role":"system"},{"content":"Hello, my name is Ada Lovelace and I work as a mathematician.","role":"user"}],"model":"deepseek-v4-flash","tool_choice":null,"tools":[{"function":{"description":"Submit the structured data you extracted from the provided text.","name":"submit","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"first_name":{"type":"string"},"job":{"type":"string"},"last_name":{"type":"string"}},"required":["first_name","last_name","job"],"title":"SmokePerson","type":"object"}},"type":"function"}]}'
11+
then:
12+
status: 200
13+
header:
14+
- name: content-type
15+
value: application/json
16+
body: '{"choices":[{"finish_reason":"tool_calls","index":0,"logprobs":null,"message":{"content":"","reasoning_content":"Let me extract the structured data from the text provided.\n\nFirst name: Ada\nLast name: Lovelace\nJob: mathematician\n\nLet me submit this.","role":"assistant","tool_calls":[{"function":{"arguments":"{\"first_name\": \"Ada\", \"last_name\": \"Lovelace\", \"job\": \"mathematician\"}","name":"submit"},"id":"call_REDACTED_1","index":0,"type":"function"}]}}],"created":0,"id":"chatcmpl-REDACTED_1","model":"deepseek-v4-flash","object":"chat.completion","system_fingerprint":"fp_REDACTED_1","usage":{"completion_tokens":113,"completion_tokens_details":{"reasoning_tokens":32},"prompt_cache_hit_tokens":0,"prompt_cache_miss_tokens":426,"prompt_tokens":426,"prompt_tokens_details":{"cached_tokens":0},"total_tokens":539}}'
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
when:
2+
path: /chat/completions
3+
method: POST
4+
query_param: []
5+
header:
6+
- name: accept
7+
value: '*/*'
8+
- name: content-type
9+
value: application/json
10+
body: '{"messages":[{"content":"You are an AI assistant whose purpose is to extract structured data from the provided text.\nYou will have access to a `submit` function that defines the structure of the data to extract from the provided text.\nUse the `submit` function to submit the structured data.\nBe sure to fill out every field and ALWAYS CALL THE `submit` function, even with default values!!!.\n ","role":"system"},{"content":"Bob Johnson is a 55 year old retired teacher.","role":"user"}],"model":"deepseek-v4-flash","tool_choice":null,"tools":[{"function":{"description":"Submit the structured data you extracted from the provided text.","name":"submit","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"age":{"format":"uint8","maximum":255,"minimum":0,"type":["integer","null"]},"name":{"type":["string","null"]},"profession":{"type":["string","null"]}},"title":"Person","type":"object"}},"type":"function"}]}'
11+
then:
12+
status: 200
13+
header:
14+
- name: content-type
15+
value: application/json
16+
body: '{"choices":[{"finish_reason":"tool_calls","index":0,"logprobs":null,"message":{"content":"","reasoning_content":"Let me extract the structured data from the provided text:\n\n- Name: Bob Johnson\n- Age: 55\n- Profession: retired teacher\n\nLet me submit this data.","role":"assistant","tool_calls":[{"function":{"arguments":"{\"name\": \"Bob Johnson\", \"age\": 55, \"profession\": \"retired teacher\"}","name":"submit"},"id":"call_REDACTED_1","index":0,"type":"function"}]}}],"created":0,"id":"chatcmpl-REDACTED_1","model":"deepseek-v4-flash","object":"chat.completion","system_fingerprint":"fp_REDACTED_1","usage":{"completion_tokens":114,"completion_tokens_details":{"reasoning_tokens":35},"prompt_cache_hit_tokens":0,"prompt_cache_miss_tokens":433,"prompt_tokens":433,"prompt_tokens_details":{"cached_tokens":0},"total_tokens":547}}'
17+
---
18+
when:
19+
path: /chat/completions
20+
method: POST
21+
query_param: []
22+
header:
23+
- name: accept
24+
value: '*/*'
25+
- name: content-type
26+
value: application/json
27+
body: '{"messages":[{"content":"You are an AI assistant whose purpose is to extract structured data from the provided text.\nYou will have access to a `submit` function that defines the structure of the data to extract from the provided text.\nUse the `submit` function to submit the structured data.\nBe sure to fill out every field and ALWAYS CALL THE `submit` function, even with default values!!!.\n ","role":"system"},{"content":"Bob Johnson is a 55 year old retired teacher.","role":"user"}],"model":"deepseek-v4-flash","tool_choice":null,"tools":[{"function":{"description":"Submit the structured data you extracted from the provided text.","name":"submit","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"age":{"format":"uint8","maximum":255,"minimum":0,"type":["integer","null"]},"name":{"type":["string","null"]},"profession":{"type":["string","null"]}},"title":"Person","type":"object"}},"type":"function"}]}'
28+
then:
29+
status: 200
30+
header:
31+
- name: content-type
32+
value: application/json
33+
body: '{"choices":[{"finish_reason":"tool_calls","index":0,"logprobs":null,"message":{"content":"","reasoning_content":"Let me extract the structured data from the text.\n\nName: Bob Johnson\nAge: 55\nProfession: retired teacher","role":"assistant","tool_calls":[{"function":{"arguments":"{\"name\": \"Bob Johnson\", \"age\": 55, \"profession\": \"retired teacher\"}","name":"submit"},"id":"call_REDACTED_2","index":0,"type":"function"}]}}],"created":0,"id":"chatcmpl-REDACTED_2","model":"deepseek-v4-flash","object":"chat.completion","system_fingerprint":"fp_REDACTED_1","usage":{"completion_tokens":104,"completion_tokens_details":{"reasoning_tokens":25},"prompt_cache_hit_tokens":384,"prompt_cache_miss_tokens":49,"prompt_tokens":433,"prompt_tokens_details":{"cached_tokens":384},"total_tokens":537}}'
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
when:
2+
path: /chat/completions
3+
method: POST
4+
query_param: []
5+
header:
6+
- name: accept
7+
value: '*/*'
8+
- name: content-type
9+
value: application/json
10+
body: '{"messages":[{"content":"You are an AI assistant whose purpose is to extract structured data from the provided text.\nYou will have access to a `submit` function that defines the structure of the data to extract from the provided text.\nUse the `submit` function to submit the structured data.\nBe sure to fill out every field and ALWAYS CALL THE `submit` function, even with default values!!!.\n ","role":"system"},{"content":"John Doe is a 30 year old software engineer.","role":"user"}],"model":"deepseek-v4-flash","tool_choice":null,"tools":[{"function":{"description":"Submit the structured data you extracted from the provided text.","name":"submit","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"age":{"format":"uint8","maximum":255,"minimum":0,"type":["integer","null"]},"name":{"type":["string","null"]},"profession":{"type":["string","null"]}},"title":"Person","type":"object"}},"type":"function"}]}'
11+
then:
12+
status: 200
13+
header:
14+
- name: content-type
15+
value: application/json
16+
body: '{"choices":[{"finish_reason":"tool_calls","index":0,"logprobs":null,"message":{"content":"","reasoning_content":"Let me extract the structured data from the text:\n\n- Name: John Doe\n- Age: 30\n- Profession: software engineer\n\nI''ll submit this using the submit function.","role":"assistant","tool_calls":[{"function":{"arguments":"{\"name\": \"John Doe\", \"age\": 30, \"profession\": \"software engineer\"}","name":"submit"},"id":"call_REDACTED_1","index":0,"type":"function"}]}}],"created":0,"id":"chatcmpl-REDACTED_1","model":"deepseek-v4-flash","object":"chat.completion","system_fingerprint":"fp_REDACTED_1","usage":{"completion_tokens":115,"completion_tokens_details":{"reasoning_tokens":37},"prompt_cache_hit_tokens":384,"prompt_cache_miss_tokens":49,"prompt_tokens":433,"prompt_tokens_details":{"cached_tokens":384},"total_tokens":548}}'
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
when:
2+
path: /chat/completions
3+
method: POST
4+
query_param: []
5+
header:
6+
- name: accept
7+
value: '*/*'
8+
- name: content-type
9+
value: application/json
10+
body: '{"messages":[{"content":"You are an AI assistant whose purpose is to extract structured data from the provided text.\nYou will have access to a `submit` function that defines the structure of the data to extract from the provided text.\nUse the `submit` function to submit the structured data.\nBe sure to fill out every field and ALWAYS CALL THE `submit` function, even with default values!!!.\n ","role":"system"},{"content":"I''m looking at a property that might be interesting.","role":"user"},{"content":"The address is 123 Main St in Springfield, IL 62701.","role":"user"}],"model":"deepseek-v4-flash","tool_choice":null,"tools":[{"function":{"description":"Submit the structured data you extracted from the provided text.","name":"submit","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"city":{"type":["string","null"]},"state":{"type":["string","null"]},"street":{"type":["string","null"]},"zip_code":{"type":["string","null"]}},"title":"Address","type":"object"}},"type":"function"}]}'
11+
then:
12+
status: 200
13+
header:
14+
- name: content-type
15+
value: application/json
16+
body: '{"choices":[{"finish_reason":"tool_calls","index":0,"logprobs":null,"message":{"content":"Let me extract the address information from your text.","reasoning_content":"Let me extract the structured data from the provided text.\n\nStreet: 123 Main St\nCity: Springfield\nState: IL\nZip Code: 62701","role":"assistant","tool_calls":[{"function":{"arguments":"{\"street\": \"123 Main St\", \"city\": \"Springfield\", \"state\": \"IL\", \"zip_code\": \"62701\"}","name":"submit"},"id":"call_REDACTED_1","index":0,"type":"function"}]}}],"created":0,"id":"chatcmpl-REDACTED_1","model":"deepseek-v4-flash","object":"chat.completion","system_fingerprint":"fp_REDACTED_1","usage":{"completion_tokens":137,"completion_tokens_details":{"reasoning_tokens":32},"prompt_cache_hit_tokens":256,"prompt_cache_miss_tokens":187,"prompt_tokens":443,"prompt_tokens_details":{"cached_tokens":256},"total_tokens":580}}'
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
when:
2+
path: /chat/completions
3+
method: POST
4+
query_param: []
5+
header:
6+
- name: accept
7+
value: '*/*'
8+
- name: content-type
9+
value: application/json
10+
body: '{"messages":[{"content":"You are an AI assistant whose purpose is to extract structured data from the provided text.\nYou will have access to a `submit` function that defines the structure of the data to extract from the provided text.\nUse the `submit` function to submit the structured data.\nBe sure to fill out every field and ALWAYS CALL THE `submit` function, even with default values!!!.\n ","role":"system"},{"content":"Jane Smith is a 45 year old data scientist.","role":"user"}],"model":"deepseek-v4-flash","tool_choice":null,"tools":[{"function":{"description":"Submit the structured data you extracted from the provided text.","name":"submit","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"age":{"format":"uint8","maximum":255,"minimum":0,"type":["integer","null"]},"name":{"type":["string","null"]},"profession":{"type":["string","null"]}},"title":"Person","type":"object"}},"type":"function"}]}'
11+
then:
12+
status: 200
13+
header:
14+
- name: content-type
15+
value: application/json
16+
body: '{"choices":[{"finish_reason":"tool_calls","index":0,"logprobs":null,"message":{"content":"","reasoning_content":"The text mentions Jane Smith, age 45, and her profession is data scientist. Let me submit this structured data.","role":"assistant","tool_calls":[{"function":{"arguments":"{\"name\": \"Jane Smith\", \"age\": 45, \"profession\": \"data scientist\"}","name":"submit"},"id":"call_REDACTED_1","index":0,"type":"function"}]}}],"created":0,"id":"chatcmpl-REDACTED_1","model":"deepseek-v4-flash","object":"chat.completion","system_fingerprint":"fp_REDACTED_1","usage":{"completion_tokens":102,"completion_tokens_details":{"reasoning_tokens":24},"prompt_cache_hit_tokens":384,"prompt_cache_miss_tokens":49,"prompt_tokens":433,"prompt_tokens_details":{"cached_tokens":384},"total_tokens":535}}'
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
when:
2+
path: /chat/completions
3+
method: POST
4+
query_param: []
5+
header:
6+
- name: accept
7+
value: '*/*'
8+
- name: content-type
9+
value: application/json
10+
body: '{"messages":[{"content":"You are an AI assistant whose purpose is to extract structured data from the provided text.\nYou will have access to a `submit` function that defines the structure of the data to extract from the provided text.\nUse the `submit` function to submit the structured data.\nBe sure to fill out every field and ALWAYS CALL THE `submit` function, even with default values!!!.\n ","role":"system"},{"content":"Alice is a 25 year old developer.","role":"user"}],"model":"deepseek-v4-flash","tool_choice":null,"tools":[{"function":{"description":"Submit the structured data you extracted from the provided text.","name":"submit","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"age":{"format":"uint8","maximum":255,"minimum":0,"type":["integer","null"]},"name":{"type":["string","null"]},"profession":{"type":["string","null"]}},"title":"Person","type":"object"}},"type":"function"}]}'
11+
then:
12+
status: 200
13+
header:
14+
- name: content-type
15+
value: application/json
16+
body: '{"choices":[{"finish_reason":"tool_calls","index":0,"logprobs":null,"message":{"content":"","reasoning_content":"Let me extract the structured data from the provided text.\n\n- Name: \"Alice\"\n- Age: 25\n- Profession: \"developer\"\n\nLet me submit this.","role":"assistant","tool_calls":[{"function":{"arguments":"{\"name\": \"Alice\", \"age\": 25, \"profession\": \"developer\"}","name":"submit"},"id":"call_REDACTED_1","index":0,"type":"function"}]}}],"created":0,"id":"chatcmpl-REDACTED_1","model":"deepseek-v4-flash","object":"chat.completion","system_fingerprint":"fp_REDACTED_1","usage":{"completion_tokens":110,"completion_tokens_details":{"reasoning_tokens":34},"prompt_cache_hit_tokens":384,"prompt_cache_miss_tokens":47,"prompt_tokens":431,"prompt_tokens_details":{"cached_tokens":384},"total_tokens":541}}'
17+
---
18+
when:
19+
path: /chat/completions
20+
method: POST
21+
query_param: []
22+
header:
23+
- name: accept
24+
value: '*/*'
25+
- name: content-type
26+
value: application/json
27+
body: '{"messages":[{"content":"You are an AI assistant whose purpose is to extract structured data from the provided text.\nYou will have access to a `submit` function that defines the structure of the data to extract from the provided text.\nUse the `submit` function to submit the structured data.\nBe sure to fill out every field and ALWAYS CALL THE `submit` function, even with default values!!!.\n ","role":"system"},{"content":"456 Oak Avenue, Cambridge, MA 02139","role":"user"}],"model":"deepseek-v4-flash","tool_choice":null,"tools":[{"function":{"description":"Submit the structured data you extracted from the provided text.","name":"submit","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"city":{"type":["string","null"]},"state":{"type":["string","null"]},"street":{"type":["string","null"]},"zip_code":{"type":["string","null"]}},"title":"Address","type":"object"}},"type":"function"}]}'
28+
then:
29+
status: 200
30+
header:
31+
- name: content-type
32+
value: application/json
33+
body: '{"choices":[{"finish_reason":"tool_calls","index":0,"logprobs":null,"message":{"content":"","reasoning_content":"Let me extract the structured data from this address:\n\n- Street: 456 Oak Avenue\n- City: Cambridge\n- State: MA\n- Zip code: 02139","role":"assistant","tool_calls":[{"function":{"arguments":"{\"street\": \"456 Oak Avenue\", \"city\": \"Cambridge\", \"state\": \"MA\", \"zip_code\": \"02139\"}","name":"submit"},"id":"call_REDACTED_2","index":0,"type":"function"}]}}],"created":0,"id":"chatcmpl-REDACTED_2","model":"deepseek-v4-flash","object":"chat.completion","system_fingerprint":"fp_REDACTED_1","usage":{"completion_tokens":130,"completion_tokens_details":{"reasoning_tokens":35},"prompt_cache_hit_tokens":384,"prompt_cache_miss_tokens":43,"prompt_tokens":427,"prompt_tokens_details":{"cached_tokens":384},"total_tokens":557}}'
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
when:
2+
path: /models
3+
method: GET
4+
query_param: []
5+
header:
6+
- name: accept
7+
value: '*/*'
8+
- name: content-type
9+
value: application/json
10+
body: null
11+
then:
12+
status: 200
13+
header:
14+
- name: content-type
15+
value: application/json
16+
body: '{"data":[{"id":"deepseek-v4-flash","object":"model","owned_by":"deepseek"},{"id":"deepseek-v4-pro","object":"model","owned_by":"deepseek"}],"object":"list"}'

0 commit comments

Comments
 (0)