Skip to content

Commit

Permalink
Added safety output video reason and unknown command
Browse files Browse the repository at this point in the history
  • Loading branch information
igolaizola committed Aug 10, 2024
1 parent f69f554 commit 8c03f2c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pkg/runway/runway.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ func (e *Error) Temporary() bool {
switch {
case r == "SAFETY.INPUT.TEXT", r == "SAFETY.INPUT.IMAGE":
return false
case strings.HasPrefix(r, "INTERNAL.BAD_OUTPUT."):
case strings.HasPrefix(r, "INTERNAL.BAD_OUTPUT."), r == "SAFETY.OUTPUT.VIDEO":
return true
case r == "":
return true
Expand All @@ -387,6 +387,19 @@ func (e *Error) Temporary() bool {
}
}

func (e *Error) Unknown() bool {
switch e.data.Error.Reason {
case "INTERNAL.BAD_OUTPUT.CODE01",
"INTERNAL.BAD_OUTPUT.CODE03",
"SAFETY.INPUT.TEXT",
"SAFETY.INPUT.IMAGE",
"SAFETY.OUTPUT.VIDEO":
return false
default:
return true
}
}

func (c *Client) Generate(ctx context.Context, cfg *GenerateRequest) (*Generation, error) {
// Load team ID
if err := c.loadTeamID(ctx); err != nil {
Expand Down

0 comments on commit 8c03f2c

Please sign in to comment.