summarize

package
v0.0.0-...-3c1c031 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Unlicense Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpenAIApiUrl = "https://api.openai.com/v1/chat/completions"
	Model        = "gpt-4o-mini"
	User         = "user"
	System       = "system"
)
View Source
const (
	MinArticleLength = 500
	MaxArticleLength = 600000 // ~120.000 tokens
	MaxOutputTokens  = 1000
	PresencePenalty  = 1.0
	Temperature      = 0.3
	SystemPrompt     = "Fasse den folgenden Artikel in fünf kurzen Stichpunkten zusammen. Antworte IMMER nur Deutsch. Formatiere deine Ausgabe wie folgt:\n" +
		"Der Artikel handelt von [Zusammenfassung in einem Satz]\n\n" +
		"- [Stichpunkt 1]..."
)

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() []gotgbot.BotCommand

func (*Plugin) Handlers

func (p *Plugin) Handlers(botInfo *gotgbot.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