@@ -14,7 +14,6 @@ import (
14
14
"github.com/llamastack/llama-stack-client-go/option"
15
15
"github.com/llamastack/llama-stack-client-go/packages/param"
16
16
"github.com/llamastack/llama-stack-client-go/packages/respjson"
17
- "github.com/llamastack/llama-stack-client-go/shared"
18
17
"github.com/llamastack/llama-stack-client-go/shared/constant"
19
18
)
20
19
@@ -92,7 +91,7 @@ type ScoringFn struct {
92
91
Identifier string `json:"identifier,required"`
93
92
Metadata map [string ]ScoringFnMetadataUnion `json:"metadata,required"`
94
93
ProviderID string `json:"provider_id,required"`
95
- ReturnType shared. ReturnType `json:"return_type,required"`
94
+ ReturnType ScoringFnReturnType `json:"return_type,required"`
96
95
// The resource type, always scoring_function
97
96
Type constant.ScoringFunction `json:"type,required"`
98
97
Description string `json:"description"`
@@ -172,6 +171,24 @@ func (r *ScoringFnMetadataUnion) UnmarshalJSON(data []byte) error {
172
171
return apijson .UnmarshalRoot (data , r )
173
172
}
174
173
174
+ type ScoringFnReturnType struct {
175
+ // Any of "string", "number", "boolean", "array", "object", "json", "union",
176
+ // "chat_completion_input", "completion_input", "agent_turn_input".
177
+ Type string `json:"type,required"`
178
+ // JSON contains metadata for fields, check presence with [respjson.Field.Valid].
179
+ JSON struct {
180
+ Type respjson.Field
181
+ ExtraFields map [string ]respjson.Field
182
+ raw string
183
+ } `json:"-"`
184
+ }
185
+
186
+ // Returns the unmodified JSON received from the API
187
+ func (r ScoringFnReturnType ) RawJSON () string { return r .JSON .raw }
188
+ func (r * ScoringFnReturnType ) UnmarshalJSON (data []byte ) error {
189
+ return apijson .UnmarshalRoot (data , r )
190
+ }
191
+
175
192
// ScoringFnParamsUnionResp contains all possible properties and values from
176
193
// [ScoringFnParamsLlmAsJudgeResp], [ScoringFnParamsRegexParserResp],
177
194
// [ScoringFnParamsBasicResp].
@@ -541,8 +558,8 @@ func (r *ScoringFnParamsBasic) UnmarshalJSON(data []byte) error {
541
558
542
559
type ScoringFunctionRegisterParams struct {
543
560
// The description of the scoring function.
544
- Description string `json:"description,required"`
545
- ReturnType shared. ReturnTypeParam `json:"return_type,omitzero,required"`
561
+ Description string `json:"description,required"`
562
+ ReturnType ScoringFunctionRegisterParamsReturnType `json:"return_type,omitzero,required"`
546
563
// The ID of the scoring function to register.
547
564
ScoringFnID string `json:"scoring_fn_id,required"`
548
565
// The ID of the provider to use for the scoring function.
@@ -562,3 +579,25 @@ func (r ScoringFunctionRegisterParams) MarshalJSON() (data []byte, err error) {
562
579
func (r * ScoringFunctionRegisterParams ) UnmarshalJSON (data []byte ) error {
563
580
return apijson .UnmarshalRoot (data , r )
564
581
}
582
+
583
+ // The property Type is required.
584
+ type ScoringFunctionRegisterParamsReturnType struct {
585
+ // Any of "string", "number", "boolean", "array", "object", "json", "union",
586
+ // "chat_completion_input", "completion_input", "agent_turn_input".
587
+ Type string `json:"type,omitzero,required"`
588
+ paramObj
589
+ }
590
+
591
+ func (r ScoringFunctionRegisterParamsReturnType ) MarshalJSON () (data []byte , err error ) {
592
+ type shadow ScoringFunctionRegisterParamsReturnType
593
+ return param .MarshalObject (r , (* shadow )(& r ))
594
+ }
595
+ func (r * ScoringFunctionRegisterParamsReturnType ) UnmarshalJSON (data []byte ) error {
596
+ return apijson .UnmarshalRoot (data , r )
597
+ }
598
+
599
+ func init () {
600
+ apijson .RegisterFieldValidator [ScoringFunctionRegisterParamsReturnType ](
601
+ "type" , "string" , "number" , "boolean" , "array" , "object" , "json" , "union" , "chat_completion_input" , "completion_input" , "agent_turn_input" ,
602
+ )
603
+ }
0 commit comments