helper

package
v0.0.0-...-88682ce Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

公众号

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	OpenAIKey      string `mapstructure:"OPEN_AI_KEY"`
	AppID          string `mapstructure:"APP_ID"`
	AppSecret      string `mapstructure:"APP_SECRET"`
	Token          string `mapstructure:"TOKEN"`
	EncodingAESKey string `mapstructure:"ENCODING_AES_KEY"`
}
var DefaultConfig *Config

func LoadConfig

func LoadConfig(path string) (config Config, err error)

type OfficialAccount

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

func NewOfficialAccount

func NewOfficialAccount() *OfficialAccount

func (*OfficialAccount) GetMaterial

func (oa *OfficialAccount) GetMaterial() *material.Material

func (*OfficialAccount) GetServer

func (oa *OfficialAccount) GetServer(c *gin.Context) *server.Server

type OpenAI

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

func NewOpenAI

func NewOpenAI(contextSize int) *OpenAI

func (*OpenAI) Chat

func (oai *OpenAI) Chat(ctx context.Context, content string) (string, error)

func (*OpenAI) STT

func (oai *OpenAI) STT(ctx context.Context, filePath string) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳