Add connector support for AI assistants in processXgen
- Import connector package to access AIConnectors - Update processXgen function to include 'connectors' field in agent map - Add 'placeholder' field to the assistant data structure for enhanced context
This commit is contained in:
parent
97a469bc03
commit
38b910108b
1 changed files with 3 additions and 4 deletions
|
|
@ -12,6 +12,7 @@ import (
|
|||
jsoniter "github.com/json-iterator/go"
|
||||
"github.com/yaoapp/gou/api"
|
||||
"github.com/yaoapp/gou/application"
|
||||
"github.com/yaoapp/gou/connector"
|
||||
"github.com/yaoapp/gou/process"
|
||||
v8 "github.com/yaoapp/gou/runtime/v8"
|
||||
"github.com/yaoapp/gou/session"
|
||||
|
|
@ -67,10 +68,6 @@ func Load(cfg config.Config) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if data == nil {
|
||||
return fmt.Errorf("app.yao not found")
|
||||
}
|
||||
|
|
@ -574,8 +571,10 @@ func processXgen(process *process.Process) interface{} {
|
|||
"assistant_name": ast.Name,
|
||||
"assistant_avatar": ast.Avatar,
|
||||
"assistant_deleteable": false,
|
||||
"placeholder": ast.Placeholder,
|
||||
}
|
||||
}
|
||||
agent["connectors"] = connector.AIConnectors
|
||||
}
|
||||
|
||||
xgenSetting := map[string]interface{}{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue