refactor: Migrate AI relay APIs and add audit logging

- Handle all the cases in `relayMode` and `apiType` switch in a consistent manner.
- Retire AI Proxy Library API call pattern.
- Add new cases (Zhipu, Ali, Tencent, Gemini) to generalize the conversion and handling of requests.
- Log the requests if conservation audit is enabled.
This commit is contained in:
Laisky.Cai
2024-01-05 05:58:44 +00:00
parent 021affc81a
commit 9d4d9af915
2 changed files with 45 additions and 0 deletions

View File

@@ -328,6 +328,7 @@ type TextResponse struct {
Choices []OpenAITextResponseChoice `json:"choices"`
Usage `json:"usage"`
Error OpenAIError `json:"error"`
Content string `json:"-"`
}
type OpenAITextResponseChoice struct {