35 lines
1.0 KiB
Go
35 lines
1.0 KiB
Go
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)
|
|
})
|
|
})
|
|
})
|