mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-09 18:53:43 +08:00
refactor: 更改 OpenAI 请求 Body 数据结构,兼容函数调用请求
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"chatplus/store"
|
||||
"context"
|
||||
"embed"
|
||||
"errors"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
@@ -101,9 +102,12 @@ func main() {
|
||||
}),
|
||||
|
||||
// 创建函数
|
||||
fx.Provide(func() *function.FuncZaoBao {
|
||||
fx.Provide(func() (*function.FuncZaoBao, error) {
|
||||
token := os.Getenv("AL_API_TOKEN")
|
||||
return function.NewZaoBao(token)
|
||||
if token == "" {
|
||||
return nil, errors.New("invalid AL api token")
|
||||
}
|
||||
return function.NewZaoBao(token), nil
|
||||
}),
|
||||
|
||||
// 创建控制器
|
||||
|
||||
Reference in New Issue
Block a user