MCPcopy
hub / github.com/QuantumNous/new-api / getJSONStringValue

Function getJSONStringValue

middleware/distributor.go:242–250  ·  view source on GitHub ↗
(result gjson.Result, field string)

Source from the content-addressed store, hash-verified

240}
241
242func getJSONStringValue(result gjson.Result, field string) (string, error) {
243 if !result.Exists() || result.Type == gjson.Null {
244 return "", nil
245 }
246 if result.Type != gjson.String {
247 return "", fmt.Errorf("field %s must be a string", field)
248 }
249 return result.String(), nil
250}
251
252func getModelRequest(c *gin.Context) (*ModelRequest, bool, error) {
253 var modelRequest ModelRequest

Callers 1

getModelFromJSONBodyFunction · 0.85

Calls 2

ExistsMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected