Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestRuntime_OpenAI_Basic(t *testing.T) {

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

func TestRuntime_Mistral_Basic(t *testing.T) {
Expand Down
84 changes: 44 additions & 40 deletions e2e/testdata/cassettes/TestExec_Anthropic.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,47 @@
---
version: 2
interactions:
- id: 0
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 0
host: api.anthropic.com
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\"}]}"
url: https://api.anthropic.com/v1/messages/count_tokens
method: POST
response:
proto: HTTP/2.0
proto_major: 2
proto_minor: 0
content_length: 19
body: "{\"input_tokens\":42}"
headers: {}
status: 200 OK
code: 200
duration: 192.898375ms
- id: 1
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 0
host: api.anthropic.com
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}"
url: https://api.anthropic.com/v1/messages
method: POST
response:
proto: HTTP/2.0
proto_major: 2
proto_minor: 0
content_length: -1
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"
headers: {}
status: 200 OK
code: 200
duration: 2.088045083s
- id: 0
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 0
host: api.anthropic.com
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}'
url: https://api.anthropic.com/v1/messages
method: POST
response:
proto: HTTP/2.0
proto_major: 2
proto_minor: 0
content_length: -1
body: |+
event: message_start
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"}} }

event: content_block_start
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} }

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"2 "} }

event: ping
data: {"type": "ping"}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"+ 2 = 4"} }

event: content_block_stop
data: {"type":"content_block_stop","index":0 }

event: message_delta
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} }

event: message_stop
data: {"type":"message_stop" }

headers: {}
status: 200 OK
code: 200
duration: 2.000933084s
Loading