feat: support cloudflare worker ai

This commit is contained in:
CalciumIon
2024-07-13 19:55:22 +08:00
parent c88f3741e6
commit 7b36a2b885
15 changed files with 296 additions and 28 deletions

View File

@@ -35,3 +35,8 @@ func ObjectData(c *gin.Context, object interface{}) error {
func Done(c *gin.Context) {
StringData(c, "[DONE]")
}
func GetResponseID(c *gin.Context) string {
logID := c.GetString("X-Oneapi-Request-Id")
return fmt.Sprintf("chatcmpl-%s", logID)
}