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

Function buildProxyUrl

internal/server/web/proxy/proxy.go:717–907  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

715}
716
717func buildProxyUrl(c *gin.Context) (string, error) {
718 if c.FullPath() == "/api/providers/openai/v1/assistants" && c.Request.Method == http.MethodPost {
719 return "https://api.openai.com/v1/assistants", nil
720 }
721
722 if c.FullPath() == "/api/providers/openai/v1/assistants/:assistant_id" && c.Request.Method == http.MethodGet {
723 return "https://api.openai.com/v1/assistants/" + c.Param("assistant_id"), nil
724 }
725
726 if c.FullPath() == "/api/providers/openai/v1/assistants/:assistant_id" && c.Request.Method == http.MethodPost {
727 return "https://api.openai.com/v1/assistants/" + c.Param("assistant_id"), nil
728 }
729
730 if c.FullPath() == "/api/providers/openai/v1/assistants/:assistant_id" && c.Request.Method == http.MethodDelete {
731 return "https://api.openai.com/v1/assistants/" + c.Param("assistant_id"), nil
732 }
733
734 if c.FullPath() == "/api/providers/openai/v1/assistants" && c.Request.Method == http.MethodGet {
735 return "https://api.openai.com/v1/assistants", nil
736 }
737
738 if c.FullPath() == "/api/providers/openai/v1/assistants/:assistant_id/files" && c.Request.Method == http.MethodPost {
739 return "https://api.openai.com/v1/assistants/" + c.Param("assistant_id") + "/files", nil
740 }
741
742 if c.FullPath() == "/api/providers/openai/v1/assistants/:assistant_id/files/:file_id" && c.Request.Method == http.MethodGet {
743 return "https://api.openai.com/v1/assistants/" + c.Param("assistant_id") + "/files/" + c.Param("file_id"), nil
744 }
745
746 if c.FullPath() == "/api/providers/openai/v1/assistants/:assistant_id/files/:file_id" && c.Request.Method == http.MethodDelete {
747 return "https://api.openai.com/v1/assistants/" + c.Param("assistant_id") + "/files/" + c.Param("file_id"), nil
748 }
749
750 if c.FullPath() == "/api/providers/openai/v1/assistants/:assistant_id/files" && c.Request.Method == http.MethodGet {
751 return "https://api.openai.com/v1/assistants/" + c.Param("assistant_id") + "/files", nil
752 }
753
754 if c.FullPath() == "/api/providers/openai/v1/threads" && c.Request.Method == http.MethodPost {
755 return "https://api.openai.com/v1/threads", nil
756 }
757
758 if c.FullPath() == "/api/providers/openai/v1/threads/:thread_id" && c.Request.Method == http.MethodGet {
759 return "https://api.openai.com/v1/threads/" + c.Param("thread_id"), nil
760 }
761
762 if c.FullPath() == "/api/providers/openai/v1/threads/:thread_id" && c.Request.Method == http.MethodPost {
763 return "https://api.openai.com/v1/threads/" + c.Param("thread_id"), nil
764 }
765
766 if c.FullPath() == "/api/providers/openai/v1/threads/:thread_id" && c.Request.Method == http.MethodDelete {
767 return "https://api.openai.com/v1/threads/" + c.Param("thread_id"), nil
768 }
769
770 if c.FullPath() == "/api/providers/openai/v1/threads/:thread_id/messages" && c.Request.Method == http.MethodPost {
771 return "https://api.openai.com/v1/threads/" + c.Param("thread_id") + "/messages", nil
772 }
773
774 if c.FullPath() == "/api/providers/openai/v1/threads/:thread_id/messages/:message_id" && c.Request.Method == http.MethodGet {

Callers 1

getPassThroughHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected