(title string)
| 512 | } |
| 513 | |
| 514 | func validateGeneratedTitle(title string) error { |
| 515 | if title == "" { |
| 516 | return xerrors.New("generated title was empty") |
| 517 | } |
| 518 | if len(strings.Fields(title)) > 8 { |
| 519 | return xerrors.New("generated title exceeded 8 words") |
| 520 | } |
| 521 | return nil |
| 522 | } |
| 523 | |
| 524 | // titleInput returns the first user message text and whether title |
| 525 | // generation should proceed. It returns false when the chat already |
no test coverage detected