format.go 195 B

123456789101112
  1. package chatgpt
  2. func formatAnswer(answer string) string {
  3. for len(answer) > 0 {
  4. if answer[:1] == "\n" || answer[0] == ' ' {
  5. answer = answer[1:]
  6. } else {
  7. break
  8. }
  9. }
  10. return answer
  11. }