diff --git a/neo/assistant/hooks.go b/neo/assistant/hooks.go index 9080d3d7d..3ab7d4347 100644 --- a/neo/assistant/hooks.go +++ b/neo/assistant/hooks.go @@ -221,7 +221,9 @@ func (ast *Assistant) call(ctx context.Context, method string, context chatctx.C // Wait for either context cancellation or method completion select { case <-ctx.Done(): - scriptCtx.Close() // Force close the script context + if scriptCtx != nil { + scriptCtx.Close() // Force close the script context + } return nil, ctx.Err() case <-done: return result, callErr diff --git a/neo/message/content.go b/neo/message/content.go index e79a8f4df..2d2466c5f 100644 --- a/neo/message/content.go +++ b/neo/message/content.go @@ -52,6 +52,12 @@ func (c *Content) String() string { data := map[string]interface{}{ "id": c.ID, "type": "function", + "text": c.Name, + "props": map[string]interface{}{ + "id": c.ID, + "name": c.Name, + "arguments": arguments, + }, "function": map[string]interface{}{ "name": c.Name, "arguments": arguments,