Initial import

This commit is contained in:
mudler
2024-01-20 19:41:09 +01:00
parent a1203c8f14
commit d22154e9be
9 changed files with 326 additions and 0 deletions

34
agent/state_test.go Normal file
View File

@@ -0,0 +1,34 @@
package agent_test
import (
"fmt"
. "github.com/mudler/local-agent-framework/agent"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
var _ = Describe("Agent test", func() {
Context("identity", func() {
It("generates all the fields", func() {
agent, err := New(
WithLLMAPIURL("http://192.168.68.113:8080"),
WithModel("echidna"))
Expect(err).ToNot(HaveOccurred())
err = agent.GenerateIdentity("An old man with a long beard, a wizard, who lives in a tower.")
Expect(err).ToNot(HaveOccurred())
Expect(agent.Character.Name).ToNot(BeEmpty())
Expect(agent.Character.Age).ToNot(BeZero())
Expect(agent.Character.Occupation).ToNot(BeEmpty())
Expect(agent.Character.NowDoing).ToNot(BeEmpty())
Expect(agent.Character.DoingNext).ToNot(BeEmpty())
Expect(agent.Character.DoneHistory).ToNot(BeEmpty())
Expect(agent.Character.Memories).ToNot(BeEmpty())
Expect(agent.Character.Hobbies).ToNot(BeEmpty())
Expect(agent.Character.MusicTaste).ToNot(BeEmpty())
fmt.Printf("%+v\n", agent.Character)
})
})
})