gemini

package
v7.2.21 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package gemini provides HTTP handlers for Gemini API endpoints. This package implements handlers for managing Gemini model operations including model listing, content generation, streaming content generation, and token counting. It serves as a proxy layer between clients and the Gemini backend service, handling request translation, client management, and response processing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeminiAPIHandler

type GeminiAPIHandler struct {
	*handlers.BaseAPIHandler
}

GeminiAPIHandler contains the handlers for Gemini API endpoints. It holds a pool of clients to interact with the backend service.

func NewGeminiAPIHandler

func NewGeminiAPIHandler(apiHandlers *handlers.BaseAPIHandler) *GeminiAPIHandler

NewGeminiAPIHandler creates a new Gemini API handlers instance. It takes an BaseAPIHandler instance as input and returns a GeminiAPIHandler.

func (*GeminiAPIHandler) GeminiGetHandler

func (h *GeminiAPIHandler) GeminiGetHandler(c *gin.Context)

GeminiGetHandler handles GET requests for specific Gemini model information. It returns detailed information about a specific Gemini model based on the action parameter.

func (*GeminiAPIHandler) GeminiHandler

func (h *GeminiAPIHandler) GeminiHandler(c *gin.Context)

GeminiHandler handles POST requests for Gemini API operations. It routes requests to appropriate handlers based on the action parameter (model:method format).

func (*GeminiAPIHandler) GeminiModels

func (h *GeminiAPIHandler) GeminiModels(c *gin.Context)

GeminiModels handles the Gemini models listing endpoint. It returns a JSON response containing available Gemini models and their specifications.

func (*GeminiAPIHandler) HandlerType

func (h *GeminiAPIHandler) HandlerType() string

HandlerType returns the identifier for this handler implementation.

func (*GeminiAPIHandler) Models

func (h *GeminiAPIHandler) Models() []map[string]any

Models returns the Gemini-compatible model metadata supported by this handler.

Jump to

Keyboard shortcuts

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