Skip to content

v0.2.2 🧁 [cupcake]

Compare
Choose a tag to compare
@k33g k33g released this 29 Oct 06:16
· 30 commits to main since this release

What's new in v0.2.2?

Flock Agents

Inspired by: Swarm by OpenAI

Flock is a Parakeet package for creating and managing AI agents using the Ollama backend. It provides a simple way to create conversational agents, orchestrate interactions between them, and implement function calling capabilities.

📝 Documentation

Example
agent := flock.Agent{
    Name: "Bob",
    Model: "qwen2.5:3b",
    OllamaUrl: "http://localhost:11434",
    Options: llm.SetOptions(map[string]interface{}{
        option.Temperature: 0.7,
        option.TopK: 40,
        option.TopP: 0.9,
    }),
}

// Setting static instructions
agent.SetInstructions("Help the user with their queries.")

// Setting dynamic instructions with context
agent.SetInstructions(func(contextVars map[string]interface{}) string {
    userName := contextVars["userName"].(string)
    return fmt.Sprintf("Help %s with their queries.", userName)
})

orchestrator := flock.Orchestrator{}

response, _ := orchestrator.Run(
    agent,
    []llm.Message{
        {Role: "user", Content: "Hello, what's the best pizza?"},
    },
    map[string]interface{}{"userName": "Sam"},
)

fmt.Println(response.GetLastMessage().Content)