mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-13 04:14:56 +00:00
feat(providers): add native Azure OpenAI and Foundry header support (#319)
This commit is contained in:
1 parent
551b6670d5
commit
7200ecb7fe
1 file changed
+6
-1
@@ -412,7 +412,12 @@ func (p *OpenAIProvider) doRequest(ctx context.Context, body any) (io.ReadCloser
|
||||
}
|
||||
|
||||
httpReq.Header.Set("Content-Type", "application/json")
|
||||
httpReq.Header.Set("Authorization", "Bearer "+p.apiKey)
|
||||
// Azure OpenAI/Foundry support for now atleast
|
||||
if strings.Contains(strings.ToLower(p.apiBase), "azure.com") {
|
||||
httpReq.Header.Set("api-key", p.apiKey)
|
||||
} else {
|
||||
httpReq.Header.Set("Authorization", "Bearer "+p.apiKey)
|
||||
}
|
||||
|
||||
resp, err := p.client.Do(httpReq)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user