ollama

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MemoryUsage = map[ModelName]bytesize.ByteSize{
	CodeLlama:       5077 * bytesize.MB,
	CodeLlama13b:    9055 * bytesize.MB,
	CodeGemma:       6489 * bytesize.MB,
	DeepSeekCoder:   1478 * bytesize.MB,
	DeepSeekCoderV2: 9462 * bytesize.MB,
	Gemma:           6490 * bytesize.MB,
	Gemma2b:         2321 * bytesize.MB,
	Gemma2:          6683 * bytesize.MB,
	Gemma22B:        2321 * bytesize.MB,
	Llama3:          4980 * bytesize.MB,
	Llama3Dot1:      6354 * bytesize.MB,
	Mistral:         4615 * bytesize.MB,
	Phi3:            3269 * bytesize.MB,
}

MemoryUsage Memory usage in MB

View Source
var PromptToText = map[PromptMsg]PromptText{
	CorrectGrammar: {
		// contains filtered or unexported fields
	},
	MakeItFriendly: {
		// contains filtered or unexported fields
	},
	MakeItAList: {
		// contains filtered or unexported fields
	},
	MakeItProfessional: {
		// contains filtered or unexported fields
	},
	MakeHeadline: {
		// contains filtered or unexported fields
	},
	MakeASummary: {
		// contains filtered or unexported fields
	},
	MakeExplanation: {
		// contains filtered or unexported fields
	},
	MakeExpanded: {
		// contains filtered or unexported fields
	},
	TryAgain: {
		// contains filtered or unexported fields
	},
	MakeItFriendlyRedo: {
		// contains filtered or unexported fields
	},
	MakeItProfessionalRedo: {
		// contains filtered or unexported fields
	},
	MakeItAListRedo: {
		// contains filtered or unexported fields
	},
}

Functions

func AskAI

func AskAI(guiApp fyne.App, client *api.Client, inputForPrompt string) (api.GenerateResponse, error)

func AskAIToTranslate

func AskAIToTranslate(guiApp fyne.App, client *api.Client, inputForPrompt string, fromLang, toLang Language) (api.GenerateResponse, error)

func AskAIWithContext added in v0.1.0

func AskAIWithContext(guiApp fyne.App, client *api.Client, msgContext []int, inputForPrompt string) (api.GenerateResponse, error)

func AskAIWithPromptMsg

func AskAIWithPromptMsg(guiApp fyne.App, client *api.Client, prompt PromptMsg, inputForPrompt string) (api.GenerateResponse, error)

func AskAiWithPromptAndContext added in v0.1.0

func AskAiWithPromptAndContext(guiApp fyne.App, client *api.Client, msgContext []int, prompt PromptMsg) (api.GenerateResponse, error)

func AskAiWithStringAndContext added in v0.0.9

func AskAiWithStringAndContext(guiApp fyne.App, client *api.Client, msgContext []int, prompt string) (api.GenerateResponse, error)

func CheckOllamaConnection added in v0.1.0

func CheckOllamaConnection(guiApp fyne.App, ollamaClient *ollamaApi.Client, ollamaURL *string) *ollamaApi.Client

func ConnectToOllama

func ConnectToOllama() *ollama.Client

func ConnectToOllamaWithURL added in v0.0.9

func ConnectToOllamaWithURL(rawURL string) *ollama.Client

func FindModel

func FindModel(ctx context.Context, client *ollama.Client, model string) (bool, error)

func InstallOrUpdateOllama added in v0.0.9

func InstallOrUpdateOllama()

func InstallOrUpdateOllamaWindow added in v0.1.0

func InstallOrUpdateOllamaWindow(guiApp fyne.App, ollamaClient *ollamaApi.Client)

func PullModel

func PullModel(guiApp fyne.App, client *api.Client, pf api.PullProgressFunc, update bool) error

Types

type Language

type Language string
const (
	Arabic     Language = "Arabic"
	Chinese    Language = "Chinese"
	English    Language = "English"
	French     Language = "French"
	German     Language = "German"
	Italian    Language = "Italian"
	Japanese   Language = "Japanese"
	Portuguese Language = "Portuguese"
	Russian    Language = "Russian"
	Spanish    Language = "Spanish"
	Turkish    Language = "Turkish"
)

type ModelName

type ModelName int
const (
	Llama3Dot1      ModelName = iota // llama3.1:latest
	CodeLlama                        // codellama:latest
	CodeLlama13b                     // codellama:13b
	CodeGemma                        // codegemma:7b
	DeepSeekCoder                    // deepseek-coder:latest
	DeepSeekCoderV2                  // deepseek-coder-v2:latest
	Gemma                            // gemma:latest
	Gemma2b                          // gemma:2b
	Gemma2                           // gemma2:latest
	Gemma22B                         // gemma2:2b
	Llama3                           // llama3:latest
	Llava                            // llava:latest
	Mistral                          // mistral:latest
	Phi3                             // phi3:latest
)

func GetActiveModel added in v0.1.0

func GetActiveModel(guiApp fyne.App) ModelName

func StringToModel added in v0.1.0

func StringToModel(s string) ModelName

func (ModelName) String

func (i ModelName) String() string

type PromptMsg

type PromptMsg int
const (
	CorrectGrammar PromptMsg = iota // Correct Grammar

	MakeItAList        // Make it a List
	MakeItFriendly     // Make it Friendly
	MakeItProfessional // Make it Professional
	MakeASummary       // Make a Summary
	MakeExplanation    // Explain it like I'm 5
	MakeExpanded       // Expand on the text
	MakeHeadline       // Make a Headline

	TryAgain               // Try Again
	MakeItFriendlyRedo     // Make it Friendly
	MakeItProfessionalRedo // Make it Professional
	MakeItAListRedo        // Make it a List
)

func (PromptMsg) PromptExtraToText

func (prompt PromptMsg) PromptExtraToText() string

func (PromptMsg) PromptToText

func (prompt PromptMsg) PromptToText() string

func (PromptMsg) String

func (i PromptMsg) String() string

type PromptText

type PromptText struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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