pkg

package
v0.0.0-...-90be5e7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CHAT_URL = "https://api.groq.com/openai/v1/chat/completions"
)

Variables

This section is empty.

Functions

func CreateTask

func CreateTask(tasksService *taskV1.Service, taskList string, title string, note string) *taskV1.Task

func DeleteTask

func DeleteTask(tasksService *taskV1.Service, taskList string, taskID string)

func GetTask

func GetTask(tasksService *taskV1.Service, taskList string, taskID string) *taskV1.Task

func ListAllTasks

func ListAllTasks(tasksService *taskV1.Service)

func ListTaskLists

func ListTaskLists(tasksService *taskV1.Service)

func ListTasks

func ListTasks(tasksService *taskV1.Service, taskList string) []*taskV1.Task

func UpdateTask

func UpdateTask(tasksService *taskV1.Service, taskList string, taskID string, title string, note string, completed bool) *taskV1.Task

Types

type ChatRequest

type ChatRequest struct {
	Messages       []Message         `json:"messages"`
	Model          string            `json:"model"`
	ResponseFormat map[string]string `json:"response_format,omitempty"`
	Temperature    float64           `json:"temperature,omitempty"`
}

type ChatResponse

type ChatResponse struct {
	Choices []Choice `json:"choices"`
}

type Choice

type Choice struct {
	Message ChoiceMessage `json:"message"`
}

type ChoiceMessage

type ChoiceMessage struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type Groq

type Groq struct {
	APIKey string
	Model  string
}

func NewGroq

func NewGroq(apiKey string) *Groq

func (*Groq) Chat

func (g *Groq) Chat(request ChatRequest) (*ChatResponse, error)

type LLM

type LLM interface {
	Chat(request ChatRequest) (*ChatResponse, error)
}

type Message

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type RecommendationItem

type RecommendationItem struct {
	Title string `json:"title"`
	Notes string `json:"notes"`
}

type Recommendations

type Recommendations struct {
	Recommendations []RecommendationItem `json:"recommendations"`
}

func Recommendation

func Recommendation(llm LLM, tasks []*tasks.Task, content string) *Recommendations

type StoreToken

type StoreToken struct {
	AccessToken  string    `json:"access_token"`
	ExpiresIn    int       `json:"expires_in"`
	RefreshToken string    `json:"refresh_token"`
	Scope        string    `json:"scope"`
	TokenType    string    `json:"token_type"`
	Expiry       time.Time `json:"expiry"`
}

type Storer

type Storer interface {
	Store(storeToken StoreToken) error
	Retrieve() []byte
	ToToken(data []byte) (oauth2.Token, error)
}

func NewStorer

func NewStorer(path string) Storer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL