v0.2.2 🧁 [cupcake]
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.
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)