接入 ChatGPT API

This commit is contained in:
RockYang
2023-03-17 18:54:26 +08:00
parent 729612275b
commit 396b7440fa
6 changed files with 156 additions and 65 deletions

View File

@@ -30,11 +30,12 @@ func (s StaticFile) Open(name string) (fs.File, error) {
}
type Server struct {
Config *types.Config
Config *types.Config
History map[string][]types.Message
}
func NewServer(config *types.Config) *Server {
return &Server{Config: config}
return &Server{Config: config, History: make(map[string][]types.Message, 16)}
}
func (s *Server) Run(webRoot embed.FS, path string) {