From 58ba4db1ddceaef1ca862e4c5808400e98d32f4d Mon Sep 17 00:00:00 2001 From: mudler Date: Tue, 2 Apr 2024 20:29:23 +0200 Subject: [PATCH] fix tests --- agent/agent_test.go | 14 +++++++++++++- agent/jobs.go | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/agent/agent_test.go b/agent/agent_test.go index 1f19c18..b52d4a2 100644 --- a/agent/agent_test.go +++ b/agent/agent_test.go @@ -53,7 +53,7 @@ func (a *TestAction) Definition() action.ActionDefinition { var _ = Describe("Agent test", func() { Context("jobs", func() { - FIt("pick the correct action", func() { + It("pick the correct action", func() { agent, err := New( WithLLMAPIURL(apiModel), WithModel(testModel), @@ -76,6 +76,18 @@ var _ = Describe("Agent test", func() { } Expect(reasons).To(ContainElement(testActionResult), fmt.Sprint(res)) Expect(reasons).To(ContainElement(testActionResult2), fmt.Sprint(res)) + reasons = []string{} + + res = agent.Ask(WithText("Now I want to know the weather in Paris")) + conversation := agent.CurrentConversation() + Expect(len(conversation)).To(Equal(10), fmt.Sprint(conversation)) + for _, r := range res { + reasons = append(reasons, r.Result) + } + Expect(reasons).ToNot(ContainElement(testActionResult), fmt.Sprint(res)) + Expect(reasons).ToNot(ContainElement(testActionResult2), fmt.Sprint(res)) + Expect(reasons).To(ContainElement(testActionResult3), fmt.Sprint(res)) + }) It("pick the correct action", func() { agent, err := New( diff --git a/agent/jobs.go b/agent/jobs.go index 1d1640a..08a9b3b 100644 --- a/agent/jobs.go +++ b/agent/jobs.go @@ -154,6 +154,7 @@ func (a *Agent) consumeJob(job *Job) { if job.Image != "" { // TODO: Use llava to explain the image content + } if job.Text != "" {