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:
Laisky.Cai
2024-03-05 03:38:26 +00:00
parent fb23ea0c9a
commit bb8755bc98
4 changed files with 26 additions and 40 deletions

View File

@@ -3,13 +3,14 @@ package anthropic
import (
"errors"
"fmt"
"io"
"net/http"
"github.com/gin-gonic/gin"
"github.com/songquanpeng/one-api/relay/channel"
"github.com/songquanpeng/one-api/relay/channel/openai"
"github.com/songquanpeng/one-api/relay/model"
"github.com/songquanpeng/one-api/relay/util"
"io"
"net/http"
)
type Adaptor struct {