liveopenrouter

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package liveopenrouter provides a shared OpenRouter-backed runner for feature-example tests. OpenRouter exposes an OpenAI-compatible API, so the SDK's openai provider is reused with a custom BaseURL and chat-completions API mode.

Configuration:

OPENROUTER_API_KEY           enables live OpenRouter tests
OPENROUTER_BASE_URL          override OpenRouter base URL
                             (defaults to https://openrouter.ai/api/v1)
OPENROUTER_LIVE_MODEL        model name (defaults to deepseek/deepseek-v4-flash)
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 DefaultBaseURL = "https://openrouter.ai/api/v1"

DefaultBaseURL is OpenRouter's OpenAI-compatible endpoint.

View Source
const DefaultModel = "deepseek/deepseek-v4-flash"

DefaultModel is used when OPENROUTER_LIVE_MODEL is unset. Picked for low cost and broad availability on OpenRouter.

Variables

This section is empty.

Functions

func DefaultModelName

func DefaultModelName() string

DefaultModelName returns the model name configured via env, or DefaultModel.

func Provider

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

Provider returns the configured OpenRouter provider for tests that call provider.GetModel(...) directly.

func Runner

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

Runner returns a Runner backed by OpenRouter (via the openai-compatible provider) plus the model name to use.

Types

This section is empty.

Jump to

Keyboard shortcuts

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