agent fix
This commit is contained in:
@@ -47,7 +47,7 @@ type Facade struct {
|
||||
// it may be nil if catalogue env vars are not configured, in which case
|
||||
// catalogue endpoints will error at query time rather than at startup.
|
||||
// embedder may be nil too: scan-to-order then matches on words alone.
|
||||
func NewFacade(db *gorm.DB, catalogueDB *gorm.DB, embedder utils.Embedder, chat utils.Chat, agentsDir string) *Facade {
|
||||
func NewFacade(db *gorm.DB, catalogueDB *gorm.DB, embedder utils.Embedder, chat utils.Chat, agentsDir, assistantWhy string) *Facade {
|
||||
|
||||
// User Module
|
||||
userRepo := repositories.NewUserRepository(db)
|
||||
@@ -182,6 +182,11 @@ func NewFacade(db *gorm.DB, catalogueDB *gorm.DB, embedder utils.Embedder, chat
|
||||
log.Printf("assistant: %d agents loaded %v", len(agents), services.AgentNames(agents))
|
||||
|
||||
assistantService := services.NewAssistantService(toolRegistry, chat, agents)
|
||||
// Why there is no model, if there is not. Passed through so /assistant/status
|
||||
// can name the missing variable instead of just saying no.
|
||||
if setter, ok := assistantService.(interface{ SetUnavailableReason(string) }); ok && chat == nil {
|
||||
setter.SetUnavailableReason(assistantWhy)
|
||||
}
|
||||
assistantController := controllers.NewAssistantController(assistantService)
|
||||
|
||||
// The second door. Same registry, same agents, same session — see
|
||||
|
||||
Reference in New Issue
Block a user