Merge pull request #821 from trheyi/main
Enhance Neo API assistant with improved error handling and message st…
This commit is contained in:
commit
883dd07fb0
2 changed files with 9 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue