convchat

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConvAI

type ConvAI struct {
	ChatSystemInstruction []byte
	ChatInstruction       []byte
	PromptKeys            map[string][]byte
	ModelType             map[string]string
	MongoDB               *mongo.Collection
	ModelKwargs           []struct {
		MaxTokens     int      `json:"max_tokens"`
		Temperature   float64  `json:"temperature"`
		Stream        bool     `json:"stream"`
		StopSequences []string `json:"stop_sequences"`
	}
	APIKey []byte
}

func (ConvAI) Chat

func (ai ConvAI) Chat(prompt string) (string, error)

func (ConvAI) Stream

func (ai ConvAI) Stream(prompt string, ipcChan chan string)

type LLM

type LLM interface {
	// Define common methods that both LLMs should have
	StreamCompleteChat(input0 string, input1 string, input2 string) (string, error)
	StreamChat(input0 string, input1 string, input2 string) <-chan string
	Chat(input0 string, input1 string, input2 string) (string, error)
}

Define a common interface that both LLM types will implement.

Jump to

Keyboard shortcuts

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