mirror of
https://github.com/coaidev/coai.git
synced 2025-05-21 14:00:13 +09:00
fix: fix nil pointer error (#96)
This commit is contained in:
parent
8a6945cf17
commit
f5e1e0e9a8
@ -68,7 +68,7 @@ func (c *ChatInstance) GetFunctionCalling(props *ChatProps) *FunctionsPayload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getChoice(form *ChatResponse) *globals.Chunk {
|
func getChoice(form *ChatResponse) *globals.Chunk {
|
||||||
if len(form.Payload.Choices.Text) == 0 {
|
if form == nil || len(form.Payload.Choices.Text) == 0 {
|
||||||
return &globals.Chunk{Content: ""}
|
return &globals.Chunk{Content: ""}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user