web

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chat

func Chat(w http.ResponseWriter, r *http.Request)

func ChatService

func ChatService(messages []*bigmodel.Message) chan bigmodel.Result

func Error

func Error(w http.ResponseWriter, err string)

func Event

func Event(w http.ResponseWriter, event, data string)

func GetFuncSource

func GetFuncSource(w http.ResponseWriter, r *http.Request)

GetFuncSource TODO: unused

func GetPanic

func GetPanic(w http.ResponseWriter, r *http.Request)

func HTMLHandlerFunc

func HTMLHandlerFunc(path string) http.HandlerFunc

func InitConfig

func InitConfig(conf *Config)

func Run

func Run(port int) error

func Success

func Success(w http.ResponseWriter, data any)

Types

type ChatRequest

type ChatRequest struct {
	Messages []*bigmodel.Message `json:"messages"`
}

type Config

type Config struct {
	Panic          string
	Stack          string
	LocalFunctions []*parse.Function
	Functions      []*parse.Function

	BigModel   bigmodel.BigModel
	UseChinese bool
}

type JSON

type JSON map[string]any

type Response

type Response struct {
	StatusCode int    `json:"status_code"`
	StatusMsg  string `json:"status_msg"`
	Data       any    `json:"data"`
}

Jump to

Keyboard shortcuts

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