1
0
mirror of https://github.com/coalaura/whiskr.git synced 2025-12-02 20:22:52 +00:00
This commit is contained in:
Laura
2025-08-31 23:41:28 +02:00
parent d903521154
commit 2d65c2f484
2 changed files with 17 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ import (
type Chunk struct {
Type string `json:"type"`
Text any `json:"text"`
Text any `json:"text,omitempty"`
}
type Stream struct {
@@ -72,6 +72,18 @@ func IDChunk(id string) Chunk {
}
}
func EndChunk() Chunk {
return Chunk{
Type: "end",
}
}
func StartChunk() Chunk {
return Chunk{
Type: "start",
}
}
func ErrorChunk(err error) Chunk {
return Chunk{
Type: "error",