Closed WhiteNightMo closed 2 months ago
But the baseURL
comes from the config file, and it's really the suffix
that should be of concern.
baseURL := c.config.BaseURL
baseURL = strings.TrimRight(baseURL, "/")
parseURL, _ := url.Parse(baseURL)
Here's what I printed and it didn't change anything.
@eiixy @sashabaranov
@WhiteNightMo Could you please check if the unit tests cover your use case? #817
@WhiteNightMo Could you please check if the unit tests cover your use case? #817
Thanks for the fix. For me, the /audio/speech
interface was missing from the judgment here. I'm not sure if there are other interfaces missing here.
if !containsSubstr([]string{
"/completions",
"/embeddings",
"/chat/completions",
"/audio/transcriptions",
"/audio/translations",
"/images/generations",
}, parseSuffix.Path) {
return fmt.Sprintf("%s/%s%s?%s", baseURL, azureAPIPrefix, parseSuffix.Path, query.Encode())
}
@WhiteNightMo Could you please check if the unit tests cover your use case? #817
Thanks for the fix. For me, the
/audio/speech
interface was missing from the judgment here. I'm not sure if there are other interfaces missing here.if !containsSubstr([]string{ "/completions", "/embeddings", "/chat/completions", "/audio/transcriptions", "/audio/translations", "/images/generations", }, parseSuffix.Path) { return fmt.Sprintf("%s/%s%s?%s", baseURL, azureAPIPrefix, parseSuffix.Path, query.Encode()) }
I couldn't find any information about /audio/speech
in the official Azure OpenAI documentation. Could you please provide a reference link to the documentation or further explain the origin and purpose of this endpoint?
https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2024-06-01/inference.yaml
Environment:
Screenshots/Logs
Additional context If the parameter contains paging information, the generated url will contain two question marks. The output I printed: