@@ -192,9 +192,9 @@ func ResponsesEndpoint(cl *config.ModelConfigLoader, ml *model.ModelLoader, eval
192192 noActionGrammar := functions.Function {
193193 Name : noActionName ,
194194 Description : noActionDescription ,
195- Parameters : map [string ]interface {} {
196- "properties" : map [string ]interface {} {
197- "message" : map [string ]interface {} {
195+ Parameters : map [string ]any {
196+ "properties" : map [string ]any {
197+ "message" : map [string ]any {
198198 "type" : "string" ,
199199 "description" : "The message to reply the user with" ,
200200 },
@@ -292,17 +292,17 @@ func ResponsesEndpoint(cl *config.ModelConfigLoader, ml *model.ModelLoader, eval
292292}
293293
294294// convertORInputToMessages converts Open Responses input to internal Messages
295- func convertORInputToMessages (input interface {} , cfg * config.ModelConfig ) ([]schema.Message , error ) {
295+ func convertORInputToMessages (input any , cfg * config.ModelConfig ) ([]schema.Message , error ) {
296296 var messages []schema.Message
297297
298298 switch v := input .(type ) {
299299 case string :
300300 // Simple string = user message
301301 return []schema.Message {{Role : "user" , StringContent : v }}, nil
302- case []interface {} :
302+ case []any :
303303 // Array of items
304304 for _ , itemRaw := range v {
305- itemMap , ok := itemRaw .(map [string ]interface {} )
305+ itemMap , ok := itemRaw .(map [string ]any )
306306 if ! ok {
307307 continue
308308 }
@@ -378,14 +378,14 @@ func convertORInputToMessages(input interface{}, cfg *config.ModelConfig) ([]sch
378378}
379379
380380// convertORReasoningItemToMessage converts an Open Responses reasoning item to an assistant Message fragment (for merging).
381- func convertORReasoningItemToMessage (itemMap map [string ]interface {} ) (schema.Message , error ) {
381+ func convertORReasoningItemToMessage (itemMap map [string ]any ) (schema.Message , error ) {
382382 var reasoning string
383383 if content := itemMap ["content" ]; content != nil {
384384 if s , ok := content .(string ); ok {
385385 reasoning = s
386- } else if parts , ok := content .([]interface {} ); ok {
386+ } else if parts , ok := content .([]any ); ok {
387387 for _ , p := range parts {
388- if partMap , ok := p .(map [string ]interface {} ); ok {
388+ if partMap , ok := p .(map [string ]any ); ok {
389389 if t , _ := partMap ["type" ].(string ); (t == "output_text" || t == "input_text" ) && partMap ["text" ] != nil {
390390 if tStr , ok := partMap ["text" ].(string ); ok {
391391 reasoning += tStr
@@ -399,7 +399,7 @@ func convertORReasoningItemToMessage(itemMap map[string]interface{}) (schema.Mes
399399}
400400
401401// convertORFunctionCallItemToMessage converts an Open Responses function_call item to an assistant Message fragment (for merging).
402- func convertORFunctionCallItemToMessage (itemMap map [string ]interface {} ) (schema.Message , error ) {
402+ func convertORFunctionCallItemToMessage (itemMap map [string ]any ) (schema.Message , error ) {
403403 callID , _ := itemMap ["call_id" ].(string )
404404 name , _ := itemMap ["name" ].(string )
405405 arguments , _ := itemMap ["arguments" ].(string )
@@ -627,7 +627,7 @@ func flushAssistantAccumulator(out *[]schema.Message, acc **schema.Message) {
627627}
628628
629629// convertORMessageItem converts an Open Responses message item to internal Message
630- func convertORMessageItem (itemMap map [string ]interface {} , cfg * config.ModelConfig ) (schema.Message , error ) {
630+ func convertORMessageItem (itemMap map [string ]any , cfg * config.ModelConfig ) (schema.Message , error ) {
631631 role , _ := itemMap ["role" ].(string )
632632 msg := schema.Message {Role : role }
633633
@@ -636,15 +636,15 @@ func convertORMessageItem(itemMap map[string]interface{}, cfg *config.ModelConfi
636636 case string :
637637 msg .StringContent = contentVal
638638 msg .Content = contentVal
639- case []interface {} :
639+ case []any :
640640 // Array of content parts
641641 var textContent string
642642 var stringImages []string
643643 var stringVideos []string
644644 var stringAudios []string
645645
646646 for _ , partRaw := range contentVal {
647- partMap , ok := partRaw .(map [string ]interface {} )
647+ partMap , ok := partRaw .(map [string ]any )
648648 if ! ok {
649649 continue
650650 }
@@ -767,7 +767,7 @@ func convertORToolsToFunctions(input *schema.OpenResponsesRequest, cfg *config.M
767767 // "auto" is the default - let model decide whether to use tools
768768 // Tools are available but not forced
769769 }
770- case map [string ]interface {} :
770+ case map [string ]any :
771771 if tcType , ok := tc ["type" ].(string ); ok && tcType == "function" {
772772 if name , ok := tc ["name" ].(string ); ok {
773773 cfg .SetFunctionCallString (name )
@@ -780,20 +780,20 @@ func convertORToolsToFunctions(input *schema.OpenResponsesRequest, cfg *config.M
780780}
781781
782782// convertTextFormatToResponseFormat converts Open Responses text_format to OpenAI response_format
783- func convertTextFormatToResponseFormat (textFormat interface {}) interface {} {
783+ func convertTextFormatToResponseFormat (textFormat any ) any {
784784 switch tf := textFormat .(type ) {
785- case map [string ]interface {} :
785+ case map [string ]any :
786786 if tfType , ok := tf ["type" ].(string ); ok {
787787 if tfType == "json_schema" {
788- return map [string ]interface {} {
788+ return map [string ]any {
789789 "type" : "json_schema" ,
790790 "json_schema" : tf ,
791791 }
792792 }
793- return map [string ]interface {} {"type" : tfType }
793+ return map [string ]any {"type" : tfType }
794794 }
795795 case string :
796- return map [string ]interface {} {"type" : tf }
796+ return map [string ]any {"type" : tf }
797797 }
798798 return nil
799799}
@@ -866,7 +866,7 @@ func handleBackgroundNonStream(ctx context.Context, store *ResponseStore, respon
866866 for i , fc := range funcCallResults {
867867 if fc .Name == noActionName {
868868 if fc .Arguments != "" {
869- var args map [string ]interface {}
869+ var args map [string ]any
870870 if err := json .Unmarshal ([]byte (fc .Arguments ), & args ); err == nil {
871871 if msg , ok := args ["message" ].(string ); ok && msg != "" {
872872 textContent = msg
@@ -1391,7 +1391,7 @@ func handleOpenResponsesNonStream(c echo.Context, responseID string, createdAt i
13911391 // This is a text response, not a tool call
13921392 // Try to extract the message from the arguments
13931393 if fc .Arguments != "" {
1394- var args map [string ]interface {}
1394+ var args map [string ]any
13951395 if err := json .Unmarshal ([]byte (fc .Arguments ), & args ); err == nil {
13961396 if msg , ok := args ["message" ].(string ); ok && msg != "" {
13971397 textContent = msg
@@ -2050,7 +2050,7 @@ func handleOpenResponsesStream(c echo.Context, responseID string, createdAt int6
20502050 if fc .Name == noActionName {
20512051 // This is a text response, not a tool call
20522052 if fc .Arguments != "" {
2053- var args map [string ]interface {}
2053+ var args map [string ]any
20542054 if err := json .Unmarshal ([]byte (fc .Arguments ), & args ); err == nil {
20552055 if msg , ok := args ["message" ].(string ); ok && msg != "" {
20562056 textContent = msg
@@ -2806,7 +2806,7 @@ func buildORResponse(responseID string, createdAt int64, completedAt *int64, sta
28062806 }
28072807
28082808 // Default tool_choice: "auto" if tools are present, "none" otherwise
2809- var toolChoice interface {}
2809+ var toolChoice any
28102810 if input .ToolChoice != nil {
28112811 toolChoice = input .ToolChoice
28122812 } else if len (tools ) > 0 {
@@ -2899,14 +2899,14 @@ func buildORResponse(responseID string, createdAt int64, completedAt *int64, sta
28992899
29002900// sendOpenResponsesError sends an error response
29012901func sendOpenResponsesError (c echo.Context , statusCode int , errorType , message , param string ) error {
2902- errorResp := map [string ]interface {} {
2903- "error" : map [string ]interface {} {
2902+ errorResp := map [string ]any {
2903+ "error" : map [string ]any {
29042904 "type" : errorType ,
29052905 "message" : message ,
29062906 },
29072907 }
29082908 if param != "" {
2909- errorResp ["error" ].(map [string ]interface {} )["param" ] = param
2909+ errorResp ["error" ].(map [string ]any )["param" ] = param
29102910 }
29112911 return c .JSON (statusCode , errorResp )
29122912}
@@ -2937,8 +2937,8 @@ func convertORToolsToOpenAIFormat(orTools []schema.ORFunctionTool) []functions.T
29372937// @Param stream query string false "Set to 'true' to resume streaming"
29382938// @Param starting_after query int false "Sequence number to resume from (for streaming)"
29392939// @Success 200 {object} schema.ORResponseResource "Response"
2940- // @Failure 400 {object} map[string]interface{} "Bad Request"
2941- // @Failure 404 {object} map[string]interface{} "Not Found"
2940+ // @Failure 400 {object} map[string]any "Bad Request"
2941+ // @Failure 404 {object} map[string]any "Not Found"
29422942// @Router /v1/responses/{id} [get]
29432943func GetResponseEndpoint () func (c echo.Context ) error {
29442944 return func (c echo.Context ) error {
@@ -3076,8 +3076,8 @@ func handleStreamResume(c echo.Context, store *ResponseStore, responseID string,
30763076// @Description Cancel a background response if it's still in progress
30773077// @Param id path string true "Response ID"
30783078// @Success 200 {object} schema.ORResponseResource "Response"
3079- // @Failure 400 {object} map[string]interface{} "Bad Request"
3080- // @Failure 404 {object} map[string]interface{} "Not Found"
3079+ // @Failure 400 {object} map[string]any "Bad Request"
3080+ // @Failure 404 {object} map[string]any "Not Found"
30813081// @Router /v1/responses/{id}/cancel [post]
30823082func CancelResponseEndpoint () func (c echo.Context ) error {
30833083 return func (c echo.Context ) error {
0 commit comments