Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion service/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func ClaudeToOpenAIRequest(claudeRequest dto.ClaudeRequest, info *relaycommon.Re

for _, mediaMsg := range contents {
switch mediaMsg.Type {
case "text":
case "text", "input_text":
message := dto.MediaContent{
Type: "text",
Text: mediaMsg.GetText(),
Expand Down
6 changes: 5 additions & 1 deletion service/openaicompat/chat_to_responses.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,12 @@ func ChatCompletionsRequestToResponsesRequest(req *dto.GeneralOpenAIRequest) (*d
for _, part := range parts {
switch part.Type {
case dto.ContentTypeText:
textType := "input_text"
if role == "assistant" {
textType = "output_text"
}
contentParts = append(contentParts, map[string]any{
"type": "input_text",
"type": textType,
"text": part.Text,
})
case dto.ContentTypeImageURL:
Expand Down