LLM

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log_Chat

func Log_Chat(log_file *string, role string, content string, model string) error

Types

type Anthropic

type Anthropic struct {
	API_Key string
	Tokens  int
	Client  *anthropic.Client
}

func New_Anthropic

func New_Anthropic(max_tokens int) *Anthropic

func (*Anthropic) Chat

func (cs *Anthropic) Chat(args Client_Args) (string, error)

type Client

type Client interface {
	Chat(args Client_Args) (string, error)
}

type Client_Args

type Client_Args struct {
	Prompt        *string
	System_Prompt *string
	Context       []LLM_Conversations
	Max_Tokens    *int
	Temperature   *float32
	Log           *string
}

type Google

type Google struct {
	API_Key string
	Tokens  int
	Client  *genai.Client
	Context context.Context
}

func New_Google

func New_Google(max_tokens int) *Google

func (*Google) Chat

func (cs *Google) Chat(args Client_Args) (string, error)

func (*Google) Simple_Chat

func (cs *Google) Simple_Chat(args Client_Args) error

type LLM_Conversations

type LLM_Conversations struct {
	Role      string `yaml:"role"`
	Content   string `yaml:"content"`
	Model     string `yaml:"model"`
	Timestamp string `yaml:"timestamp"`
}

func Last_n_Chats

func Last_n_Chats(log_file *string, n int) ([]LLM_Conversations, error)

func Load_Chat_Log

func Load_Chat_Log(log_file *string) ([]LLM_Conversations, error)

type OpenAI

type OpenAI struct {
	API_Key string
	Tokens  int
	Client  *openai.Client
}

func New_OpenAI

func New_OpenAI(max_tokens int) *OpenAI

func (*OpenAI) Chat

func (cs *OpenAI) Chat(args Client_Args) (string, error)

Jump to

Keyboard shortcuts

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