Skip to content

Commit be41d9b

Browse files
committed
Handle response fragments with no content.
Signed-off-by: Katharine Berry <[email protected]>
1 parent 26e8024 commit be41d9b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

service/assistant/session.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ func (ps *PromptSession) Run(ctx context.Context) {
170170
}
171171
choice := resp.Candidates[0]
172172
ourContent := ""
173+
if choice.Content == nil {
174+
continue
175+
}
173176
for _, c := range choice.Content.Parts {
174177
if c.Text != "" {
175178
ourContent += c.Text

0 commit comments

Comments
 (0)