diff --git a/core/agent/agent.go b/core/agent/agent.go index 9d2ed68..432b4f6 100644 --- a/core/agent/agent.go +++ b/core/agent/agent.go @@ -100,6 +100,7 @@ func New(opts ...Option) (*Agent, error) { "character", a.Character.String(), "state", a.State().String(), "goal", a.options.permanentGoal, + "model", a.options.LLMAPI.Model, ) return a, nil @@ -131,7 +132,7 @@ func (a *Agent) ConversationChannel() chan openai.ChatCompletionMessage { // Ask is a pre-emptive, blocking call that returns the response as soon as it's ready. // It discards any other computation. func (a *Agent) Ask(opts ...JobOption) *JobResult { - xlog.Debug("Agent Ask()", "agent", a.Character.Name) + xlog.Debug("Agent Ask()", "agent", a.Character.Name, "model", a.options.LLMAPI.Model) defer func() { xlog.Debug("Agent has finished being asked", "agent", a.Character.Name) }() diff --git a/core/state/pool.go b/core/state/pool.go index 4efc4f2..f31c1db 100644 --- a/core/state/pool.go +++ b/core/state/pool.go @@ -172,12 +172,15 @@ func (a *AgentPool) startAgentWithConfig(name string, config *AgentConfig) error ctx := context.Background() model := a.defaultModel multimodalModel := a.defaultMultimodalModel + if config.MultimodalModel != "" { multimodalModel = config.MultimodalModel } + if config.Model != "" { model = config.Model } + if config.PeriodicRuns == "" { config.PeriodicRuns = "10m" } @@ -200,15 +203,14 @@ func (a *AgentPool) startAgentWithConfig(name string, config *AgentConfig) error connectors := a.connectors(config) promptBlocks := a.promptBlocks(config) - actions := a.availableActions(config)(ctx, a) - stateFile, characterFile := a.stateFiles(name) actionsLog := []string{} for _, action := range actions { actionsLog = append(actionsLog, action.Definition().Name.String()) } + connectorLog := []string{} for _, connector := range connectors { connectorLog = append(connectorLog, fmt.Sprintf("%+v", connector)) @@ -305,6 +307,7 @@ func (a *AgentPool) startAgentWithConfig(name string, config *AgentConfig) error } }), } + if config.HUD { opts = append(opts, EnableHUD) } @@ -328,9 +331,11 @@ func (a *AgentPool) startAgentWithConfig(name string, config *AgentConfig) error if config.CanStopItself { opts = append(opts, CanStopItself) } + if config.InitiateConversations { opts = append(opts, EnableInitiateConversations) } + if config.RandomIdentity { if config.IdentityGuidance != "" { opts = append(opts, WithRandomIdentity(config.IdentityGuidance)) @@ -342,6 +347,7 @@ func (a *AgentPool) startAgentWithConfig(name string, config *AgentConfig) error if config.EnableKnowledgeBase { opts = append(opts, EnableKnowledgeBase) } + if config.EnableReasoning { opts = append(opts, EnableForceReasoning) } @@ -351,6 +357,7 @@ func (a *AgentPool) startAgentWithConfig(name string, config *AgentConfig) error } xlog.Info("Starting agent", "name", name, "config", config) + agent, err := New(opts...) if err != nil { return err @@ -367,6 +374,7 @@ func (a *AgentPool) startAgentWithConfig(name string, config *AgentConfig) error }() xlog.Info("Starting connectors", "name", name, "config", config) + for _, c := range connectors { go c.Start(agent) } diff --git a/webui/app.go b/webui/app.go index 8f7c47a..08e1547 100644 --- a/webui/app.go +++ b/webui/app.go @@ -184,6 +184,8 @@ func (a *App) UpdateAgentConfig(pool *state.AgentPool) func(c *fiber.Ctx) error return errorJSONMessage(c, "Error updating agent: "+err.Error()) } + xlog.Info("Updated agent", "name", agentName, "config", fmt.Sprintf("%+v", newConfig)) + return statusJSONMessage(c, "ok") } }