Skip to content

๐Ÿฆœ๐Ÿชบ Parakeet

Parakeet is the simplest Go library to create GenAI apps with Ollama.

A GenAI app is an application that uses generative AI technology. Generative AI can create new text, images, or other content based on what it's been trained on. So a GenAI app could help you write a poem, design a logo, or even compose a song! These are still under development, but they have the potential to be creative tools for many purposes. - Gemini

โœ‹ Parakeet is only for creating GenAI apps generating text (not image, music,...).

Install

Note

current release: v0.2.2 ๐Ÿง [cupcake]

go get github.com/parakeet-nest/parakeet

๐Ÿš€ Getting Started - First completion

generate

The simple completion can be used to generate a response for a given prompt with a provided model.

package main

import (
    "github.com/parakeet-nest/parakeet/completion"
    "github.com/parakeet-nest/parakeet/llm"
    "github.com/parakeet-nest/parakeet/enums/option"

    "fmt"
    "log"
)

func main() {
    ollamaUrl := "http://localhost:11434"
    model := "tinydolphin"

    options := llm.SetOptions(map[string]interface{}{
        option.Temperature: 0.5,
    })

    question := llm.GenQuery{
        Model: model,
        Prompt: "Who is James T Kirk?",
        Options: options,
    }

    answer, err := completion.Generate(ollamaUrl, question)
    if err != nil {
        log.Fatal("๐Ÿ˜ก:", err)
    }
    fmt.Println(answer.Response)
}