This commit is contained in:
mudler
2024-04-04 20:00:58 +02:00
parent b4fd482f66
commit 79e5dffe09
4 changed files with 187 additions and 107 deletions

View File

@@ -147,5 +147,32 @@ var _ = Describe("Agent test", func() {
Expect(result.Error).ToNot(HaveOccurred())
Expect(agent.State().Goal).To(ContainSubstring("guitar"), fmt.Sprint(agent.State()))
})
FIt("it automatically performs things in the background", func() {
agent, err := New(
WithLLMAPIURL(apiModel),
WithModel(testModel),
EnableHUD,
DebugMode,
EnableStandaloneJob,
WithRandomIdentity(),
WithPermanentGoal("get the weather of all the cities in italy"),
)
Expect(err).ToNot(HaveOccurred())
go agent.Run()
defer agent.Stop()
Eventually(func() string {
fmt.Println(agent.State())
return agent.State().NowDoing
}, "4m", "10s").Should(ContainSubstring("weather"), fmt.Sprint(agent.State()))
// result := agent.Ask(
// WithText("Update your goals such as you want to learn to play the guitar"),
// )
// fmt.Printf("%+v\n", result)
// Expect(result.Error).ToNot(HaveOccurred())
// Expect(agent.State().Goal).To(ContainSubstring("guitar"), fmt.Sprint(agent.State()))
})
})
})