models

package
v0.0.0-...-17cbd25 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultModelName = "gemini-3.5-flash-lite"

Anonymous upstream responses reported "3.5 Flash-Lite" (mode 6) for every tested chat selector. Expose that single route instead of invented versions.

View Source
const UnknownUpstreamModel = "gemini-web"

Variables

View Source
var MODELS = map[string]Model{
	DefaultModelName: {Mode: 6, Think: 4, Desc: "Gemini web chat; anonymous upstream metadata reported 3.5 Flash-Lite. Account routing can change."},
}

Functions

func ResponseName

func ResponseName(label string) string

ResponseName uses the model label from upstream metadata, never model prose or the name requested by the caller. Missing metadata stays explicitly unknown.

Types

type GoogleCandidate

type GoogleCandidate struct {
	Index        int            `json:"index"`
	Content      *GoogleContent `json:"content,omitempty"`
	FinishReason string         `json:"finishReason,omitempty"`
}

type GoogleContent

type GoogleContent struct {
	Role  string       `json:"role,omitempty"`
	Parts []GooglePart `json:"parts"`
}

type GoogleFunctionCall

type GoogleFunctionCall struct {
	Name string         `json:"name"`
	Args map[string]any `json:"args,omitempty"`
}

type GoogleFunctionCallResp

type GoogleFunctionCallResp struct {
	Name     string         `json:"name"`
	Response map[string]any `json:"response,omitempty"`
}

type GoogleFunctionCallingConfig

type GoogleFunctionCallingConfig struct {
	Mode                 string   `json:"mode,omitempty"`
	AllowedFunctionNames []string `json:"allowedFunctionNames,omitempty"`
}

type GoogleFunctionDeclaration

type GoogleFunctionDeclaration struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Parameters  any    `json:"parameters,omitempty"`
}

type GoogleGenerateRequest

type GoogleGenerateRequest struct {
	Contents          []GoogleContent   `json:"contents"`
	Tools             []GoogleTool      `json:"tools"`
	ToolConfig        *GoogleToolConfig `json:"toolConfig"`
	SystemInstruction *GoogleContent    `json:"systemInstruction"`
}

type GoogleGenerateResponse

type GoogleGenerateResponse struct {
	Candidates    []GoogleCandidate    `json:"candidates"`
	UsageMetadata *GoogleUsageMetadata `json:"usageMetadata,omitempty"`
	ModelVersion  string               `json:"modelVersion,omitempty"`
}

type GoogleInlineData

type GoogleInlineData struct {
	MIMEType string `json:"mimeType"`
	Data     string `json:"data"`
}

type GooglePart

type GooglePart struct {
	Text             string                  `json:"text,omitempty"`
	InlineData       *GoogleInlineData       `json:"inlineData,omitempty"`
	FunctionCall     *GoogleFunctionCall     `json:"functionCall,omitempty"`
	FunctionResponse *GoogleFunctionCallResp `json:"functionResponse,omitempty"`
}

type GoogleTool

type GoogleTool struct {
	FunctionDeclarations []GoogleFunctionDeclaration `json:"functionDeclarations"`
}

type GoogleToolConfig

type GoogleToolConfig struct {
	FunctionCallingConfig *GoogleFunctionCallingConfig `json:"functionCallingConfig"`
}

type GoogleUsageMetadata

type GoogleUsageMetadata struct {
	PromptTokenCount     int `json:"promptTokenCount"`
	CandidatesTokenCount int `json:"candidatesTokenCount"`
	TotalTokenCount      int `json:"totalTokenCount"`
}

type Model

type Model struct {
	Mode  int         `json:"mode"`
	Think int         `json:"think"`
	Desc  string      `json:"desc"`
	Extra map[int]any `json:"extra,omitempty"`
	Image bool        `json:"image,omitempty"`
}

type OpenAIChatRequest

type OpenAIChatRequest struct {
	Model      string          `json:"model"`
	Messages   []OpenAIMessage `json:"messages"`
	Tools      []OpenAITool    `json:"tools"`
	ToolChoice any             `json:"tool_choice"`
	Stream     bool            `json:"stream"`
}

type OpenAIChatResponse

type OpenAIChatResponse struct {
	ID      string         `json:"id"`
	Object  string         `json:"object"`
	Created int64          `json:"created"`
	Model   string         `json:"model"`
	Choices []OpenAIChoice `json:"choices"`
	Usage   *OpenAIUsage   `json:"usage,omitempty"`
}

type OpenAIChoice

type OpenAIChoice struct {
	Index        int            `json:"index"`
	Message      *OpenAIMessage `json:"message,omitempty"`
	Delta        *OpenAIMessage `json:"delta,omitempty"`
	FinishReason *string        `json:"finish_reason"`
}

type OpenAIFunction

type OpenAIFunction struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Parameters  any    `json:"parameters,omitempty"`
}

type OpenAIMessage

type OpenAIMessage struct {
	Role      string           `json:"role"`
	Content   any              `json:"content"`
	Name      string           `json:"name,omitempty"`
	ToolCalls []OpenAIToolCall `json:"tool_calls,omitempty"`
}

type OpenAITool

type OpenAITool struct {
	Type     string         `json:"type"`
	Function OpenAIFunction `json:"function"`

	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Parameters  any    `json:"parameters,omitempty"`
}

type OpenAIToolCall

type OpenAIToolCall struct {
	ID       string                 `json:"id"`
	Type     string                 `json:"type"`
	Function OpenAIToolCallFunction `json:"function"`
}

type OpenAIToolCallFunction

type OpenAIToolCallFunction struct {
	Name      string `json:"name"`
	Arguments string `json:"arguments"`
}

type OpenAIUsage

type OpenAIUsage struct {
	PromptTokens     int `json:"prompt_tokens"`
	CompletionTokens int `json:"completion_tokens"`
	TotalTokens      int `json:"total_tokens"`
}

type Resolved

type Resolved struct {
	Name  string
	Mode  int
	Think int
	Extra map[int]any
}

func Resolve

func Resolve(modelName, defaultName string) (Resolved, error)

Jump to

Keyboard shortcuts

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