MCPcopy Create free account
hub / github.com/bricks-cloud/BricksLLM / ComputeCacheKeyForEmbeddingsRequest

Function ComputeCacheKeyForEmbeddingsRequest

internal/route/util.go:11–19  ·  view source on GitHub ↗
(path string, req *goopenai.EmbeddingRequest)

Source from the content-addressed store, hash-verified

9)
10
11func 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
21func ComputeCacheKeyForChatCompletionRequest(path string, req *goopenai.ChatCompletionRequest) string {
22 if req == nil {

Callers 1

getMiddlewareFunction · 0.92

Calls 2

ConvertAnyToStrFunction · 0.92
HashFunction · 0.92

Tested by

no test coverage detected