generate_content

package
v0.16.21 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 2 Imported by: 1 module, 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 DummyThoughtSignature = "c2tpcF90aG91Z2h0X3NpZ25hdHVyZV92YWxpZGF0b3I="

DummyThoughtSignature is the base64 sentinel for "skip_thought_signature_validator". Gemini accepts any non-empty base64 string when a real thought signature is unavailable.

Variables

View Source
var AllowedGeminiKeys = map[string]bool{
	"contents": true, "systemInstruction": true, "cachedContent": true,
	"safetySettings": true, "generationConfig": true, "tools": true,
	"toolConfig": true, "labels": true, "model": true,
}

AllowedGeminiKeys are the 9 keys forwarded to the Gemini API.

Functions

func BuildGeminiGenerateContentRequestFromOpenAi

func BuildGeminiGenerateContentRequestFromOpenAi(openaiBody map[string]any, modelName string) map[string]any

BuildGeminiGenerateContentRequestFromOpenAi converts an OpenAI body to Gemini format.

func NormalizeRequest

func NormalizeRequest(body map[string]any, modelName string) map[string]any

NormalizeRequest filters and normalizes an incoming Gemini request body.

func ReasoningToThinkingConfig

func ReasoningToThinkingConfig(effort string, budgetTokens int) map[string]any

ReasoningToThinkingConfig converts OpenAI reasoning settings to Gemini thinkingConfig.

func ResolveGeminiThinkingConfigFromRequest

func ResolveGeminiThinkingConfigFromRequest(modelName string, body map[string]any) map[string]any

ResolveGeminiThinkingConfigFromRequest extracts thinking config from request params.

Types

This section is empty.

Jump to

Keyboard shortcuts

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