MCPcopy Index your code
hub / github.com/aiprodcoder/MIXAPI / validateEmbeddingRequest

Function validateEmbeddingRequest

relay/embedding_handler.go:24–35  ·  view source on GitHub ↗
(c *gin.Context, info *relaycommon.RelayInfo, embeddingRequest dto.EmbeddingRequest)

Source from the content-addressed store, hash-verified

22}
23
24func validateEmbeddingRequest(c *gin.Context, info *relaycommon.RelayInfo, embeddingRequest dto.EmbeddingRequest) error {
25 if embeddingRequest.Input == nil {
26 return fmt.Errorf("input is empty")
27 }
28 if info.RelayMode == relayconstant.RelayModeModerations && embeddingRequest.Model == "" {
29 embeddingRequest.Model = "omni-moderation-latest"
30 }
31 if info.RelayMode == relayconstant.RelayModeEmbeddings && embeddingRequest.Model == "" {
32 embeddingRequest.Model = c.Param("model")
33 }
34 return nil
35}
36
37func EmbeddingHelper(c *gin.Context) (newAPIError *types.NewAPIError) {
38 relayInfo := relaycommon.GenRelayInfoEmbedding(c)

Callers 1

EmbeddingHelperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected