MCPcopy Index your code
hub / github.com/simstudioai/sim / extractBaseUrl

Function extractBaseUrl

apps/sim/providers/azure-openai/utils.ts:75–84  ·  view source on GitHub ↗
(fullUrl: string)

Source from the content-addressed store, hash-verified

73 * @returns The base URL (scheme + host)
74 */
75export function extractBaseUrl(fullUrl: string): string {
76 try {
77 const url = new URL(fullUrl)
78 return `${url.protocol}//${url.host}`
79 } catch {
80 // If parsing fails, try to extract up to .com or .azure.com
81 const match = fullUrl.match(/^(https?:\/\/[^/]+)/)
82 return match ? match[1] : fullUrl
83 }
84}
85
86/**
87 * Extracts the deployment name from a full Azure OpenAI URL.

Callers 1

index.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected