summarize

package
v0.0.0-...-eb4b608 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Unlicense Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpenAIApiUrl         = "https://api.openai.com/v1/chat/completions"
	CloudflareGatewayUrl = "https://gateway.ai.cloudflare.com/v1/%s/openai/chat/completions"
	Model                = "gpt-3.5-turbo"
	User                 = "user"
	System               = "system"
)
View Source
const (
	MinArticleLength = 500
	MaxArticleLength = 12000
	MaxTokens        = 600
	SystemPrompt     = "" /* 175-byte string literal not displayed */
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiMessage

type ApiMessage struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type Plugin

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

func New

func New(credentialService model.CredentialService) *Plugin

func (*Plugin) Commands

func (p *Plugin) Commands() []telebot.Command

func (*Plugin) Handlers

func (p *Plugin) Handlers(botInfo *telebot.User) []plugin.Handler

func (*Plugin) Name

func (p *Plugin) Name() string

type Request

type Request struct {
	Model           string       `json:"model"`
	Messages        []ApiMessage `json:"messages"`
	PresencePenalty float32      `json:"presence_penalty"`
	MaxTokens       int          `json:"max_tokens"`
	Temperature     float32      `json:"temperature"`
}

type Response

type Response struct {
	Choices []struct {
		Message ApiMessage `json:"message"`
	} `json:"choices"`
	Error struct {
		Message string `json:"message"`
		Type    string `json:"type"`
	} `json:"error"`
}

Jump to

Keyboard shortcuts

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