(path string, req *goopenai.EmbeddingRequest)
| 9 | ) |
| 10 | |
| 11 | func ComputeCacheKeyForEmbeddingsRequest(path string, req *goopenai.EmbeddingRequest) string { |
| 12 | if req == nil { |
| 13 | return "" |
| 14 | } |
| 15 | |
| 16 | input, _ := util.ConvertAnyToStr(req.Input) |
| 17 | |
| 18 | return hasher.Hash(fmt.Sprintf("%s-%s-%s-%s", path, input, req.EncodingFormat, req.User)) |
| 19 | } |
| 20 | |
| 21 | func ComputeCacheKeyForChatCompletionRequest(path string, req *goopenai.ChatCompletionRequest) string { |
| 22 | if req == nil { |
no test coverage detected