one-api/relay/channel/anthropic/model.go
Laisky.Cai bb8755bc98 refactor: Refactor: Consolidate Anthropic model requests into GeneralOpenAIRequest
- 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
2024-03-05 03:38:26 +00:00

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"`
}