vertexai

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ModelList = []string{
	"claude-3-haiku@20240307",
	"claude-3-sonnet@20240229",
	"claude-3-opus@20240229",
	"claude-3-5-sonnet@20240620",
	"claude-3-5-sonnet-v2@20241022",
	"claude-3-5-haiku@20241022",
}

Functions

This section is empty.

Types

type Adaptor

type Adaptor struct {
}

func (*Adaptor) ConvertRequest

func (a *Adaptor) ConvertRequest(c *gin.Context, relayMode int, request *model.GeneralOpenAIRequest) (any, error)

func (*Adaptor) DoResponse

func (a *Adaptor) DoResponse(c *gin.Context, resp *http.Response, meta *meta.Meta) (usage *model.Usage, err *model.ErrorWithStatusCode)

type Request

type Request struct {
	// AnthropicVersion must be "vertex-2023-10-16"
	AnthropicVersion string `json:"anthropic_version"`
	// Model            string              `json:"model"`
	Messages      []anthropic.Message `json:"messages"`
	System        string              `json:"system,omitempty"`
	MaxTokens     int                 `json:"max_tokens,omitempty"`
	StopSequences []string            `json:"stop_sequences,omitempty"`
	Stream        bool                `json:"stream,omitempty"`
	Temperature   *float64            `json:"temperature,omitempty"`
	TopP          *float64            `json:"top_p,omitempty"`
	TopK          int                 `json:"top_k,omitempty"`
	Tools         []anthropic.Tool    `json:"tools,omitempty"`
	ToolChoice    any                 `json:"tool_choice,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL