mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-11 02:43:44 +08:00
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
This commit is contained in:
@@ -1,19 +1,17 @@
|
||||
package anthropic
|
||||
|
||||
import (
|
||||
"github.com/songquanpeng/one-api/relay/model"
|
||||
)
|
||||
|
||||
type Metadata struct {
|
||||
UserId string `json:"user_id"`
|
||||
}
|
||||
|
||||
type Request struct {
|
||||
Model string `json:"model"`
|
||||
Prompt string `json:"prompt"`
|
||||
MaxTokensToSample int `json:"max_tokens_to_sample"`
|
||||
StopSequences []string `json:"stop_sequences,omitempty"`
|
||||
Temperature float64 `json:"temperature,omitempty"`
|
||||
TopP float64 `json:"top_p,omitempty"`
|
||||
TopK int `json:"top_k,omitempty"`
|
||||
//Metadata `json:"metadata,omitempty"`
|
||||
Stream bool `json:"stream,omitempty"`
|
||||
model.GeneralOpenAIRequest
|
||||
// System anthropic messages API use system to represent the system prompt
|
||||
System string `json:"system"`
|
||||
}
|
||||
|
||||
type Error struct {
|
||||
|
||||
Reference in New Issue
Block a user