Refactor assistant type assertion in Xgen processing
- Improve type safety when accessing Neo's assistant - Use type assertion with ok check to handle potential nil or incorrect type - Simplify assistant context retrieval in Xgen settings
This commit is contained in:
parent
dc6967805e
commit
8f57c38b26
1 changed files with 1 additions and 2 deletions
|
|
@ -568,8 +568,7 @@ func processXgen(process *process.Process) interface{} {
|
||||||
// The default assistant
|
// The default assistant
|
||||||
agent := map[string]interface{}{}
|
agent := map[string]interface{}{}
|
||||||
if neo.Neo != nil {
|
if neo.Neo != nil {
|
||||||
ast := neo.Neo.Assistant.(*assistant.Assistant)
|
if ast, ok := neo.Neo.Assistant.(*assistant.Assistant); ok {
|
||||||
if ast != nil {
|
|
||||||
agent["default"] = map[string]interface{}{
|
agent["default"] = map[string]interface{}{
|
||||||
"assistant_id": ast.ID,
|
"assistant_id": ast.ID,
|
||||||
"assistant_name": ast.Name,
|
"assistant_name": ast.Name,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue