Help us shape the future of Go! Take the 2026 Go Developer Survey

openai-compatible

command
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

README

OpenAI-Compatible Example

This example calls an OpenAI-compatible Chat Completions service selected by OPENAI_COMPAT_BASE_URL.

Required environment variables:

  • OPENAI_COMPAT_BASE_URL
  • OPENAI_COMPAT_MODEL

Optional environment variable:

  • OPENAI_COMPAT_API_KEY

If the required values are missing, the example prints a skip message and exits successfully. Tools still execute locally under policy after the model requests them.

Run it with:

OPENAI_COMPAT_BASE_URL=http://localhost:11434/v1 OPENAI_COMPAT_MODEL=your-model go run ./examples/openai-compatible

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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