Do not let age to be either a string or an int

This commit is contained in:
mudler
2024-04-15 12:09:22 +02:00
parent f0bc2be678
commit 7db2b10bd2
2 changed files with 7 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ type PromptHUD struct {
type Character struct { type Character struct {
Name string `json:"name"` Name string `json:"name"`
Age string `json:"age"` Age any `json:"age"`
Occupation string `json:"job_occupation"` Occupation string `json:"job_occupation"`
Hobbies []string `json:"hobbies"` Hobbies []string `json:"hobbies"`
MusicTaste []string `json:"music_taste"` MusicTaste []string `json:"music_taste"`

View File

@@ -423,7 +423,12 @@ func (a *AgentPool) Stop(name string) {
func (a *AgentPool) Start(name string) error { func (a *AgentPool) Start(name string) error {
if agent, ok := a.agents[name]; ok { if agent, ok := a.agents[name]; ok {
return agent.Run() err := agent.Run()
if err != nil {
return fmt.Errorf("agent %s failed to start: %w", name, err)
}
slog.Info("Agent started", "name", name)
return nil
} }
if config, ok := a.pool[name]; ok { if config, ok := a.pool[name]; ok {
return a.startAgentWithConfig(name, &config) return a.startAgentWithConfig(name, &config)