agents-go
Plugins

OpenAI

OpenAI LLM, STT, and TTS models.

The OpenAI plugin provides an LLM, speech-to-text, and text-to-speech over OpenAI's HTTP APIs.

Capabilities

LLM · STT · TTS

Install & import

import "github.com/webdeveloperben/agents-go/plugins/openai"

// or, for model-spec strings only, a blank import (self-registers):
import _ "github.com/webdeveloperben/agents-go/plugins/openai"

No build tag. Pure Go (HTTP).

Model specs

Registered as openai (aliases gpt, openai-chat-completions). The :variant suffix is the language for STT and the voice for TTS.

SpecResolves to
openai/gpt-4ochat LLM
openai/gpt-4o-mini-transcribeSTT
openai/tts-1:alloyTTS with the alloy voice
session, _ := agents.NewSession(agents.Config{
    LLM: "openai/gpt-4o",
    STT: "openai/gpt-4o-mini-transcribe",
    TTS: "openai/tts-1:alloy",
})

Constructors & options

func NewLLM(opts LLMOptions) (*LLM, error)
func NewSTT(opts STTOptions) (*STT, error)
func NewTTS(opts TTSOptions) (*TTS, error)
TypeFieldsDefault model
LLMOptionsModel, APIKey, BaseURL, Temperature *float64, HTTPClientgpt-4.1
STTOptionsembeds LLMOptions + Model, Language, Promptgpt-4o-mini-transcribe
TTSOptionsembeds LLMOptions + Model, Voice, Instructions, Speedgpt-4o-mini-tts (voice ash)
llm, err := openai.NewLLM(openai.LLMOptions{Model: "gpt-4o", Temperature: ptr(0.3)})

Credentials

Reads OPENAI_API_KEY, or pass APIKey (and BaseURL for a compatible gateway) explicitly.

Caveats

Realtime (WebSocket) transcription/speech is deferred; STT/TTS use the batch and streaming HTTP endpoints.

On this page