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: 0

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