revcatgtpservice

package
v2.0.0-...-3a70e91 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const BASEPATH = "/api/v1"

Variables

This section is empty.

Functions

func NewController

func NewController(addr, extAddr string, cert *tls.Certificate, revcatClient client.RevCatGraphQLClient, bundle *i18n.Bundle, oaiClient *openai.Client, logger zLogger.ZLogger) (*controller, error)

func NewResultMessage

func NewResultMessage(ctx *gin.Context, status int, err error)

func NumTokensFromMessages

func NumTokensFromMessages(messages []openai.ChatCompletionMessage, model string) (numTokens int)

Types

type HTTPJSONResultMessage

type HTTPJSONResultMessage struct {
	Signature string   `json:"signature"`
	URL       string   `json:"url"`
	Title     string   `json:"title"`
	Abstract  string   `json:"abstract"`
	Tags      []string `json:"tags"`
	Date      string   `json:"date"`
	Place     string   `json:"place"`
}

type HTTPResultMessage

type HTTPResultMessage struct {
	Code    int    `json:"code" example:"400"`
	Message string `json:"message" example:"status bad request"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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