mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-18 17:46:37 +08:00
refactor: Relay text controller improvements
- Add client-side UI for Relaytext.
This commit is contained in:
parent
9a94b41684
commit
75cbfd7bb6
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user