llm

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultOllamaEndpoint = "http://127.0.0.1:11434"

	DefaultTemperature = 0.7
	DefaultNumPredict  = 200
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LLMmodel

type LLMmodel string
const (
	Mistral LLMmodel = "mistral"
)

type OllamaOptions

type OllamaOptions struct {
	NumPredict  *int64   `json:"num_predict,omitempty"`
	Temperature *float64 `json:"temperature,omitempty"`
}

type OllamaParams

type OllamaParams struct {
	Model   LLMmodel      `json:"model"`
	Prompt  string        `json:"prompt"`
	Stream  bool          `json:"stream"`
	Options OllamaOptions `json:"options"`
}

type OllamaToken

type OllamaToken struct {
	Model    LLMmodel `json:"model"`
	Response string   `json:"response"`
	Done     bool     `json:"done"`
}

type Prompter

type Prompter struct {
	Endpoint string
	Model    LLMmodel
	Opt      OllamaOptions
}

func NewPrompter

func NewPrompter(endpoint string, model LLMmodel, opt ...OllamaOptions) Prompter

func (Prompter) GetCommitMsg

func (p Prompter) GetCommitMsg(summary, customCommitPrompt string) string

func (Prompter) GetSummary

func (p Prompter) GetSummary(diff, customSummaryPrompt string) string

Jump to

Keyboard shortcuts

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