ollamautils

package
v0.489.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultPort

func GetDefaultPort() int

func GetFastModelName

func GetFastModelName() string

func GetModerateSpeedModelName

func GetModerateSpeedModelName() string

func GetSlowModelName

func GetSlowModelName() string

func SendPrompt

func SendPrompt(ctx context.Context, prompt string, options *PromptOptions) (string, error)

Send a single prompt (no conversation) to a ollama server and return the complete response.

This function is not streaming the result, it waits until the answer is complete and returns it as a whole.

Types

type PromptOptions

type PromptOptions struct {
	Hostname string

	Port int

	// Name of the model to use
	ModelName string
}

func (*PromptOptions) GetGenerateUrl

func (p *PromptOptions) GetGenerateUrl(ctx context.Context) (string, error)

func (*PromptOptions) GetHostnameOrDefault

func (p *PromptOptions) GetHostnameOrDefault() (string, error)

func (*PromptOptions) GetModelNameOrDefault

func (p *PromptOptions) GetModelNameOrDefault(ctx context.Context) (string, error)

func (*PromptOptions) GetPortOrDefault

func (p *PromptOptions) GetPortOrDefault() (int, error)

Jump to

Keyboard shortcuts

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