Fix: recover bot; llama.cpp fix
This commit is contained in:
@ -66,12 +66,13 @@ func (p *lcpRespParser) ParseBytes(body []byte) (map[string]any, error) {
|
||||
p.log.Error("failed to unmarshal", "error", err)
|
||||
return nil, err
|
||||
}
|
||||
if len(resp.Choices) == 0 {
|
||||
p.log.Error("empty choices", "resp", resp)
|
||||
err := errors.New("empty choices in resp")
|
||||
return nil, err
|
||||
}
|
||||
text := resp.Choices[0].Message.Content
|
||||
// if len(resp.Choices) == 0 {
|
||||
// p.log.Error("empty choices", "resp", resp)
|
||||
// err := errors.New("empty choices in resp")
|
||||
// return nil, err
|
||||
// }
|
||||
// text := resp.Choices[0].Message.Content
|
||||
text := resp.Content
|
||||
li := strings.Index(text, "{")
|
||||
ri := strings.LastIndex(text, "}")
|
||||
if li < 0 || ri < 1 {
|
||||
|
Reference in New Issue
Block a user