Skip to content

Commit 6ef443f

Browse files
committed
Skip the lie detector if things have gone poorly.
Signed-off-by: Katharine Berry <[email protected]>
1 parent de8f3e9 commit 6ef443f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

service/assistant/verifier/verifier.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ func FindLies(ctx context.Context, qt *quota.Tracker, message []*genai.Content)
110110
return nil, nil
111111
}
112112

113+
// If the last assistant message is empty, there's nothing to do here.
114+
if len(lastAssistantMessage.Parts) == 0 || lastAssistantMessage.Parts[0].Text == "" {
115+
return nil, nil
116+
}
117+
113118
actions, err := DetermineActions(ctx, qt, lastAssistantMessage.Parts[0].Text)
114119
if err != nil {
115120
return nil, err

0 commit comments

Comments
 (0)