geminitool

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package geminitool provides access to Gemini native tools. You can use any tool from genai with geminitool.New().

For example, to create a Gemini retrieval tool:

geminitool.New("data_retrieval", &genai.Tool{
	Retrieval: &genai.Retrieval{
		ExternalAPI: &genai.ExternalAPI{
			Endpoint: ,
			AuthConfig:
		},
	},
})

Package also provides default tools like GoogleSearch.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(name string, t *genai.Tool) tool.Tool

New creates gemini API tool.

Types

type GoogleSearch

type GoogleSearch struct{}

GoogleSearch is a built-in tool that is automatically invoked by Gemini 2 models to retrieve search results from Google Search. The tool operates internally within the model and does not require or perform local code execution.

func (GoogleSearch) Description

func (s GoogleSearch) Description() string

Description implements tool.Tool.

func (GoogleSearch) IsLongRunning

func (t GoogleSearch) IsLongRunning() bool

IsLongRunning implements tool.Tool.

func (GoogleSearch) Name

func (s GoogleSearch) Name() string

Name implements tool.Tool.

func (GoogleSearch) ProcessRequest

func (s GoogleSearch) ProcessRequest(ctx tool.Context, req *model.LLMRequest) error

ProcessRequest adds the GoogleSearch tool to the LLM request.

Jump to

Keyboard shortcuts

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