liveopenai

package
v0.0.58 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package liveopenai provides a shared OpenAI OAuth-backed runner for feature-example tests. Every non-skipped example test exercises real OpenAI via OAuth. Tests skip when credentials are missing unless GRATEFUL_LIVE_TESTS=required is set. Determinism is provided by loose, semantic assertions rather than deterministic mocks.

Configuration:

OPENAI_OAUTH_AUTH_JSON_PATH   path to Codex auth.json (defaults to
                              $HOME/.codex/auth.json when present)
OPENAI_OAUTH_ACCOUNT_ID       optional account ID to bind
OPENAI_OAUTH_ACCOUNT_ID_PATH  optional path containing the account ID
OPENAI_BASE_URL               override Codex backend base URL
OPENAI_LIVE_MODEL             model name (defaults to gpt-5.5)
GRATEFUL_LIVE_TESTS=skip      skip live tests without touching provider
                              credentials or network
GRATEFUL_LIVE_TESTS=required  fail when required credentials are missing

Index

Constants

View Source
const DefaultModel = "gpt-5.5"

DefaultModel is the model name used when OPENAI_LIVE_MODEL is unset.

Variables

This section is empty.

Functions

func Provider

func Provider(t *testing.T) agentsdk.ModelProvider

Provider returns just the configured live OpenAI provider, for tests that need to call provider.GetModel(...) directly (e.g. low-level streaming).

func Runner

func Runner(t *testing.T) (*agentsdk.Runner, string)

Runner returns a Runner backed by the OpenAI OAuth provider plus the model name to use. Tests should pass the model name into Agent.Model and RunConfig.Model. Skips immediately when GRATEFUL_LIVE_TESTS=skip is set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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