chat

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SentHttpReqToModel added in v0.1.12

func SentHttpReqToModel(ctx context.Context, reqURL string, requestBody any) (resp *http.Response, err error)

func SetSSEHeader added in v0.1.12

func SetSSEHeader(w http.ResponseWriter)

Types

type Answer added in v0.2.1

type Answer struct {
	Code     int    `json:"code"`
	Response string `json:"response"`
	Tokens   int64  `json:"tokens"`
}

func CreateStreamChat

func CreateStreamChat(ctx context.Context, w http.ResponseWriter, reqURL string, data any) (answer Answer, err error)

func SentModelSSEResp added in v0.1.12

func SentModelSSEResp(w http.ResponseWriter, sseResp *http.Response) (answer Answer, err error)

Jump to

Keyboard shortcuts

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