Skip to content

Commit d6af657

Browse files
authored
Merge pull request #1092 from rumpl/fix-max-tokens
config: Make max tokens a pointer
2 parents 3e9ccbe + 13cb57f commit d6af657

18 files changed

Lines changed: 281 additions & 203 deletions

File tree

e2e/runtime_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func TestRuntime_OpenAI_Basic(t *testing.T) {
3232

3333
response := sess.GetLastAssistantMessageContent()
3434
assert.Equal(t, "2 + 2 equals 4.", response)
35-
assert.Equal(t, "Basic Math Question", sess.Title)
35+
assert.Equal(t, "Simple Math: Addition of 2 and 2", sess.Title)
3636
}
3737

3838
func TestRuntime_Mistral_Basic(t *testing.T) {
Lines changed: 44 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,47 @@
11
---
22
version: 2
33
interactions:
4-
- id: 0
5-
request:
6-
proto: HTTP/1.1
7-
proto_major: 1
8-
proto_minor: 1
9-
content_length: 0
10-
host: api.anthropic.com
11-
body: "{\"messages\":[{\"content\":[{\"text\":\"What's 2+2?\",\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-0\",\"system\":[{\"text\":\"You are a knowledgeable assistant that helps users with various tasks.\\nBe helpful, accurate, and concise in your responses.\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}]}"
12-
url: https://api.anthropic.com/v1/messages/count_tokens
13-
method: POST
14-
response:
15-
proto: HTTP/2.0
16-
proto_major: 2
17-
proto_minor: 0
18-
content_length: 19
19-
body: "{\"input_tokens\":42}"
20-
headers: {}
21-
status: 200 OK
22-
code: 200
23-
duration: 192.898375ms
24-
- id: 1
25-
request:
26-
proto: HTTP/1.1
27-
proto_major: 1
28-
proto_minor: 1
29-
content_length: 0
30-
host: api.anthropic.com
31-
body: "{\"max_tokens\":8192,\"messages\":[{\"content\":[{\"text\":\"What's 2+2?\",\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-0\",\"system\":[{\"text\":\"You are a knowledgeable assistant that helps users with various tasks.\\nBe helpful, accurate, and concise in your responses.\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tools\":[],\"stream\":true}"
32-
url: https://api.anthropic.com/v1/messages
33-
method: POST
34-
response:
35-
proto: HTTP/2.0
36-
proto_major: 2
37-
proto_minor: 0
38-
content_length: -1
39-
body: "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"model\":\"claude-sonnet-4-20250514\",\"id\":\"msg_0175jbuqJKy5FyijdH5fbvaW\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":42,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":1,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"2 \"} }\n\nevent: ping\ndata: {\"type\": \"ping\"}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"+ 2 = 4\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":42,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":13} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n"
40-
headers: {}
41-
status: 200 OK
42-
code: 200
43-
duration: 2.088045083s
4+
- id: 0
5+
request:
6+
proto: HTTP/1.1
7+
proto_major: 1
8+
proto_minor: 1
9+
content_length: 0
10+
host: api.anthropic.com
11+
body: '{"max_tokens":64000,"messages":[{"content":[{"text":"What''s 2+2?","type":"text"}],"role":"user"}],"model":"claude-sonnet-4-0","system":[{"text":"You are a knowledgeable assistant that helps users with various tasks.\nBe helpful, accurate, and concise in your responses.","cache_control":{"type":"ephemeral"},"type":"text"}],"tools":[],"stream":true}'
12+
url: https://api.anthropic.com/v1/messages
13+
method: POST
14+
response:
15+
proto: HTTP/2.0
16+
proto_major: 2
17+
proto_minor: 0
18+
content_length: -1
19+
body: |+
20+
event: message_start
21+
data: {"type":"message_start","message":{"model":"claude-sonnet-4-20250514","id":"msg_01MyjDL5YUjXGFqCCCofeFkK","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":42,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} }
22+
23+
event: content_block_start
24+
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} }
25+
26+
event: content_block_delta
27+
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"2 "} }
28+
29+
event: ping
30+
data: {"type": "ping"}
31+
32+
event: content_block_delta
33+
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"+ 2 = 4"} }
34+
35+
event: content_block_stop
36+
data: {"type":"content_block_stop","index":0 }
37+
38+
event: message_delta
39+
data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":42,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":13} }
40+
41+
event: message_stop
42+
data: {"type":"message_stop" }
43+
44+
headers: {}
45+
status: 200 OK
46+
code: 200
47+
duration: 2.000933084s

0 commit comments

Comments
 (0)