Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Neo API assistant with improved error handling and message st… #821

Merged
merged 1 commit into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion neo/assistant/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions neo/message/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading