gemini

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package gemini drives the gemini CLI as a subprocess and parses its JSON output into a plain text reply.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner struct {
	Command      string
	Timeout      time.Duration
	Env          map[string]string
	WorkspaceDir string
}

Runner executes the gemini CLI for a single request.

func (Runner) Run

func (r Runner) Run(ctx context.Context, userText string) (string, error)

Run is a convenience wrapper that runs without thread resumption or progress callbacks.

func (Runner) RunWithThreadAndProgress

func (r Runner) RunWithThreadAndProgress(
	ctx context.Context,
	threadID string,
	userText string,
	model string,
	env map[string]string,
	onProgress func(step string),
) (string, string, int64, int64, int64, error)

RunWithThreadAndProgress runs the gemini CLI and returns the final reply and next session ID.

  • threadID: resume an existing session when non-empty.
  • userText: the fully assembled prompt.
  • model: overrides the CLI default when non-empty.
  • env: merged over the process environment.
  • onProgress: called with the final reply; may be nil.

Jump to

Keyboard shortcuts

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