Skip to content

Commit

Permalink
fix(*): test format
Browse files Browse the repository at this point in the history
  • Loading branch information
tysoekong authored Jun 6, 2024
1 parent e1a84b4 commit bec7666
Showing 1 changed file with 21 additions and 66 deletions.
87 changes: 21 additions & 66 deletions spec/01-generic/04-stream-decoder_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,88 +37,43 @@ describe("stream decoder", function()
{
body = "{\"role\":\"assistant\"}",
headers = {
{
key = ":event-type",
value = "messageStart"
},
{
key = ":content-type",
value = "application/json"
},
{
key = ":message-type",
value = "event"
}
}
[":event-type"] = "messageStart",
[":content-type"] = "application/json",
[":message-type"] = "event",
},
},
{
body = "{\"contentBlockIndex\":0,\"delta\":{\"text\":\"Pi (π) is a mathematical constant that represents the circumference-to-diameter ratio of a circle. It's approximately 3.14159.\"}}",
headers = {
{
key = ":event-type",
value = "contentBlockDelta"
},
{
key = ":content-type",
value = "application/json"
},
{
key = ":message-type",
value = "event"
}
}
[":event-type"] = "contentBlockDelta",
[":content-type"] = "application/json",
[":message-type"] = "event",
},
},
{
body = "{\"contentBlockIndex\":0}",
headers = {
{
key = ":event-type",
value = "contentBlockStop"
},
{
key = ":content-type",
value = "application/json"
},
{
key = ":message-type",
value = "event"
}
}
[":event-type"] = "contentBlockStop",
[":content-type"] = "application/json",
[":message-type"] = "event",
},
},
{
body = "{\"stopReason\":\"end_turn\"}",
headers = {
{
key = ":event-type",
value = "messageStop"
},
{
key = ":content-type",
value = "application/json"
},
{
key = ":message-type",
value = "event"
}
}
[":event-type"] = "messageStop",
[":content-type"] = "application/json",
[":message-type"] = "event",
},
},
{
body = "{\"metrics\":{\"latencyMs\":1506},\"usage\":{\"inputTokens\":8,\"outputTokens\":39,\"totalTokens\":47}}",
headers = {
{
key = ":event-type",
value = "metadata"
},
{
key = ":content-type",
value = "application/json"
},
{
key = ":message-type",
value = "event"
}
}
}
[":event-type"] = "metadata",
[":content-type"] = "application/json",
[":message-type"] = "event",
},
},
})
end)
end)

0 comments on commit bec7666

Please sign in to comment.