ai

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultOpenAIModel = "gpt-3.5-turbo"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AIClient

type AIClient interface {
	// Suggest receives a prompt and returns a suggestion or an error
	Suggest(prompt string) (string, error)
	// GetProvider returns the name of the AI provider
	GetProvider() string
	// GetModel returns the model being used
	GetModel() string
}

AIClient defines the interface that all AI providers must implement

func NewAIClient

func NewAIClient(config Config) (AIClient, error)

NewAIClient creates a new AI client based on the provider

type ClaudeClient

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

func (*ClaudeClient) GetModel

func (c *ClaudeClient) GetModel() string

func (*ClaudeClient) GetProvider

func (c *ClaudeClient) GetProvider() string

func (*ClaudeClient) Suggest

func (c *ClaudeClient) Suggest(prompt string) (string, error)

type Config

type Config struct {
	Provider string
	APIKey   string
}

Config holds the AI configuration

type OpenAIClient

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

func (*OpenAIClient) GetModel

func (c *OpenAIClient) GetModel() string

func (*OpenAIClient) GetProvider

func (c *OpenAIClient) GetProvider() string

func (*OpenAIClient) Suggest

func (c *OpenAIClient) Suggest(prompt string) (string, error)

Jump to

Keyboard shortcuts

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