feat: 完成每日早报函数开发

This commit is contained in:
RockYang
2023-07-10 18:59:53 +08:00
parent 941a24c75b
commit 3630099234
11 changed files with 235 additions and 73 deletions

View File

@@ -28,7 +28,7 @@ type AppServer struct {
// 保存 Websocket 会话 UserId, 每个 UserId 只能连接一次
// 防止第三方直接连接 socket 调用 OpenAI API
ChatSession *types.LMap[string, types.ChatSession] //map[sessionId]UserId
ChatClients *types.LMap[string, *types.WsClient] // Websocket 连接集合
ChatClients *types.LMap[string, *types.WsClient] // map[sessionId]Websocket 连接集合
ReqCancelFunc *types.LMap[string, context.CancelFunc] // HttpClient 请求取消 handle function
}

View File

@@ -15,11 +15,6 @@ type Message struct {
FunctionCall FunctionCall `json:"function_call"`
}
type FunctionCall struct {
Name string `json:"name"`
Arguments string `json:"arguments"`
}
type ApiResponse struct {
Choices []ChoiceItem `json:"choices"`
}

View File

@@ -0,0 +1,18 @@
package types
type FunctionCall struct {
Name string `json:"name"`
Arguments string `json:"arguments"`
}
type Function struct {
Name string
Description string
Parameters []Parameter
}
type Parameter struct {
Type string
Required []string
Properties map[string]interface{}
}