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

Function buildRequestUrl

internal/route/route.go:651–672  ·  view source on GitHub ↗
(provider string, runEmbeddings bool, resourceName string, params map[string]string)

Source from the content-addressed store, hash-verified

649}
650
651func buildRequestUrl(provider string, runEmbeddings bool, resourceName string, params map[string]string) string {
652 if provider == "openai" && runEmbeddings {
653 return "https://api.openai.com/v1/embeddings"
654 }
655
656 if provider == "openai" && !runEmbeddings {
657 return "https://api.openai.com/v1/chat/completions"
658 }
659
660 deploymentId := params["deploymentId"]
661 apiVersion := params["apiVersion"]
662
663 if provider == "azure" && runEmbeddings {
664 return fmt.Sprintf("https://%s.openai.azure.com/openai/deployments/%s/embeddings?api-version=%s", resourceName, deploymentId, apiVersion)
665 }
666
667 if provider == "azure" && !runEmbeddings {
668 return fmt.Sprintf("https://%s.openai.azure.com/openai/deployments/%s/chat/completions?api-version=%s", resourceName, deploymentId, apiVersion)
669 }
670
671 return ""
672}
673
674func setHttpRequestAuthHeader(provider string, req *http.Request, key string) {
675 if provider == "azure" {

Callers 2

RunStepsMethod · 0.85
createHttpRequestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected