Remove OpenAI API references from Assistant struct and initialization
- Eliminate the `openai` field from the `Assistant` struct and its initialization in the `initialize` method, streamlining the Assistant's internal structure. - This change simplifies the codebase by removing unnecessary dependencies on the OpenAI API, enhancing maintainability.
This commit is contained in:
parent
d598394337
commit
464f1abf63
3 changed files with 1 additions and 11 deletions
|
|
@ -215,7 +215,6 @@ func (ast *Assistant) Clone() *Assistant {
|
||||||
UpdatedAt: ast.UpdatedAt,
|
UpdatedAt: ast.UpdatedAt,
|
||||||
},
|
},
|
||||||
HookScript: ast.HookScript,
|
HookScript: ast.HookScript,
|
||||||
openai: ast.openai,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deep copy tags
|
// Deep copy tags
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ import (
|
||||||
"github.com/yaoapp/yao/agent/i18n"
|
"github.com/yaoapp/yao/agent/i18n"
|
||||||
searchTypes "github.com/yaoapp/yao/agent/search/types"
|
searchTypes "github.com/yaoapp/yao/agent/search/types"
|
||||||
store "github.com/yaoapp/yao/agent/store/types"
|
store "github.com/yaoapp/yao/agent/store/types"
|
||||||
"github.com/yaoapp/yao/openai"
|
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -796,12 +795,6 @@ func (ast *Assistant) initialize() error {
|
||||||
}
|
}
|
||||||
ast.Connector = conn
|
ast.Connector = conn
|
||||||
|
|
||||||
api, err := openai.New(conn)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
ast.openai = api
|
|
||||||
|
|
||||||
// Register scripts as process handlers
|
// Register scripts as process handlers
|
||||||
if len(ast.Scripts) > 0 {
|
if len(ast.Scripts) > 0 {
|
||||||
if err := ast.RegisterScripts(); err != nil {
|
if err := ast.RegisterScripts(); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import (
|
||||||
|
|
||||||
outputMessage "github.com/yaoapp/yao/agent/output/message"
|
outputMessage "github.com/yaoapp/yao/agent/output/message"
|
||||||
store "github.com/yaoapp/yao/agent/store/types"
|
store "github.com/yaoapp/yao/agent/store/types"
|
||||||
api "github.com/yaoapp/yao/openai"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -34,8 +33,7 @@ type Assistant struct {
|
||||||
|
|
||||||
// Internal
|
// Internal
|
||||||
// ===============================
|
// ===============================
|
||||||
openai *api.OpenAI // OpenAI API
|
vision bool // Whether this assistant supports vision
|
||||||
vision bool // Whether this assistant supports vision
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MCPTool represents a simplified MCP tool for building LLM requests
|
// MCPTool represents a simplified MCP tool for building LLM requests
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue