openai

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package openai provides a deterministic, stateless mock upstream for several LLM providers. Responses preserve the provider-specific shapes and usage fields consumed by gateway policies.

Index

Constants

View Source
const Port = 3008

Port is the container port used by the testbench.

View Source
const ReadinessPath = "/__readiness"

ReadinessPath is used by provider readiness probes.

View Source
const StreamErrorTrigger = "STREAM_ERROR"

StreamErrorTrigger, anywhere in a streaming request, ends the stream with the provider's error event instead of a clean finish.

View Source
const StreamedReply = "This is a streamed reply from the mock model."

StreamedReply is the assistant text every streamed reply carries, one word per delta.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct{}

Service implements the stateless LLM mock used by the testbench.

func New

func New() *Service

New returns a new Service.

func (*Service) Handler

func (s *Service) Handler() http.Handler

Handler returns the HTTP handler for the service.

func (*Service) Name

func (s *Service) Name() string

Name returns the service registration name.

func (*Service) Port

func (s *Service) Port() int

Port returns the service's listening port.

func (*Service) Stateful

func (s *Service) Stateful() bool

Stateful reports whether the service keeps request-specific state.

Jump to

Keyboard shortcuts

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