services

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func SaveConfigFile

func SaveConfigFile(filePath string, cfg FileConfig) error

Types

type AiModel

type AiModel string
const (
	AIMODEL_GPT35 AiModel = "gpt-3.5-turbo-1106"
)

type CommandsService

type CommandsService struct {
}

func NewCommandsService

func NewCommandsService() *CommandsService

func (*CommandsService) Auth

func (c *CommandsService) Auth() error

func (*CommandsService) Help

func (c *CommandsService) Help() error

type ConfigService

type ConfigService struct {
	ApiKey       string
	CustomPrompt string
}

func NewConfigService

func NewConfigService() (svc *ConfigService)

type FileConfig

type FileConfig struct {
	ApiKey struct {
		Key string `toml:"key"`
	} `toml:"apikey"`
	Prompt struct {
		Custom string `toml:"custom"`
	} `toml:"prompt"`
}

type OpenAiService

type OpenAiService struct {
	OpenAiRequest models.OpenAIRequest
	// contains filtered or unexported fields
}

func NewOpenAiService

func NewOpenAiService(cfg *ConfigService, aiModel AiModel, temperature float64) *OpenAiService

func (*OpenAiService) GetResponse

func (s *OpenAiService) GetResponse(prompt string) (string, error)

type PromptService

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

func NewPromptService

func NewPromptService(cfg *ConfigService) *PromptService

func (*PromptService) GetChanges

func (s *PromptService) GetChanges() (string, error)

Jump to

Keyboard shortcuts

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