perplexity

package
v0.0.0-...-9826bf3 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLAUDE = "claude-3-haiku-20240307"
)

Variables

View Source
var (
	ALL_MODELS = []string{
		"sonar-small-online",
		"sonar-medium-online",
		"sonar-small-chat",
		"sonar-medium-chat",
		"claude-3-haiku-20240307",
		"codellama-70b-instruct",
		"mistral-7b-instruct",
		"llava-v1.5-7b-wrapper",
		"llava-v1.6-34b",
		"mixtral-8x7b-instruct",
		"mistral-medium",
		"gemma-2b-it",
		"gemma-7b-it",
		"related",
	}
)

Functions

This section is empty.

Types

type ChatClient

type ChatClient struct {
	History []Message
	// contains filtered or unexported fields
}

func NewChatClient

func NewChatClient(debug bool, conversationMode bool) *ChatClient

func (*ChatClient) Backtrack

func (c *ChatClient) Backtrack() error

func (*ChatClient) Close

func (c *ChatClient) Close() error

func (*ChatClient) Connect

func (c *ChatClient) Connect() error

func (*ChatClient) ReadForever

func (c *ChatClient) ReadForever() error

func (*ChatClient) ReceiveMessage

func (c *ChatClient) ReceiveMessage(timeout time.Duration) (string, error)

func (*ChatClient) SendMessage

func (c *ChatClient) SendMessage(message string, model string) error

type Message

type Message struct {
	Role     string `json:"role"`
	Content  string `json:"content"`
	Priority int    `json:"priority"`
}

type Request

type Request struct {
	Version  string    `json:"version"`
	Source   string    `json:"source"`
	Model    string    `json:"model"`
	Messages []Message `json:"messages"`
	Timezone string    `json:"timezone"`
}

type Response

type Response struct {
	Output         string  `json:"output"`
	Final          bool    `json:"final"`
	ElapsedTime    float64 `json:"elapsed_time"`
	TokensStreamed int     `json:"tokens_streamed"`
	Status         string  `json:"status"`
}

Jump to

Keyboard shortcuts

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