mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-19 18:16:38 +08:00
- Refactor Anthropic adapter to work with the new Anthropic API and model requests - Remove the default value for `MaxTokensToSample` - Set `MaxTokens` to 500 instead of 1000000 - Use `system` messages as the system prompt instead of the first message
28 lines
554 B
Go
28 lines
554 B
Go
package anthropic
|
|
|
|
import (
|
|
"github.com/songquanpeng/one-api/relay/model"
|
|
)
|
|
|
|
type Metadata struct {
|
|
UserId string `json:"user_id"`
|
|
}
|
|
|
|
type Request struct {
|
|
model.GeneralOpenAIRequest
|
|
// System anthropic messages API use system to represent the system prompt
|
|
System string `json:"system"`
|
|
}
|
|
|
|
type Error struct {
|
|
Type string `json:"type"`
|
|
Message string `json:"message"`
|
|
}
|
|
|
|
type Response struct {
|
|
Completion string `json:"completion"`
|
|
StopReason string `json:"stop_reason"`
|
|
Model string `json:"model"`
|
|
Error Error `json:"error"`
|
|
}
|