mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-09 10:13:42 +08:00
refactor: Relay text controller improvements
- Add client-side UI for Relaytext.
This commit is contained in:
@@ -261,6 +261,8 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
|
|||||||
} else {
|
} else {
|
||||||
requestBody = c.Request.Body
|
requestBody = c.Request.Body
|
||||||
}
|
}
|
||||||
|
|
||||||
|
common.LogInfo(c.Request.Context(), fmt.Sprintf("convert to apitype %d", apiType))
|
||||||
switch apiType {
|
switch apiType {
|
||||||
case APITypeClaude:
|
case APITypeClaude:
|
||||||
claudeRequest := requestOpenAI2Claude(textRequest)
|
claudeRequest := requestOpenAI2Claude(textRequest)
|
||||||
@@ -358,6 +360,7 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
|
|||||||
}
|
}
|
||||||
apiKey := c.Request.Header.Get("Authorization")
|
apiKey := c.Request.Header.Get("Authorization")
|
||||||
apiKey = strings.TrimPrefix(apiKey, "Bearer ")
|
apiKey = strings.TrimPrefix(apiKey, "Bearer ")
|
||||||
|
|
||||||
switch apiType {
|
switch apiType {
|
||||||
case APITypeOpenAI:
|
case APITypeOpenAI:
|
||||||
if channelType == common.ChannelTypeAzure {
|
if channelType == common.ChannelTypeAzure {
|
||||||
|
|||||||
Reference in New Issue
Block a user