Refactor translator packages for OpenAI Chat Completions

- Renamed `openai` packages to `chat_completions` across translator modules.
- Introduced `openai_responses_handlers` with handlers for `/v1/models` and OpenAI-compatible chat completions endpoints.
- Updated constants and registry identifiers for OpenAI response type.
- Simplified request/response conversions and added detailed retry/error handling.
- Added `golang.org/x/crypto` for additional cryptographic functions.
This commit is contained in:
Luis Pater
2025-09-01 08:18:59 +08:00
parent bdac24bb4e
commit e3994ace33
16 changed files with 498 additions and 24 deletions

View File

@@ -3,7 +3,7 @@
// extracting model information, system instructions, message contents, and tool declarations.
// The package performs JSON data transformation to ensure compatibility
// between OpenAI API format and Claude Code API's expected format.
package openai
package chat_completions
import (
"crypto/rand"

View File

@@ -3,7 +3,7 @@
// JSON format, transforming streaming events and non-streaming responses into the format
// expected by OpenAI API clients. It supports both streaming and non-streaming modes,
// handling text content, tool calls, reasoning content, and usage metadata appropriately.
package openai
package chat_completions
import (
"bufio"

View File

@@ -1,4 +1,4 @@
package openai
package chat_completions
import (
. "github.com/luispater/CLIProxyAPI/internal/constant"