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 ¶
const ChatEchoPath = "/openai/v1/chat-echo"
ChatEchoPath answers with the request's last user message as the assistant's reply, so a scenario controls the response text a gateway policy sees. With "stream": true the reply is sent as OpenAI chat-completion chunks over server-sent events, one word per chunk.
const ChatEchoProviderPath = "/openai-echo/v1/chat/completions"
ChatEchoProviderPath answers like ChatEchoPath at the chat-completions path an OpenAI-template LLM provider calls, so a provider whose upstream is http://testbench:3008/openai-echo/v1 gets echoed, optionally streamed replies.
const Port = 3008
Port is the container port used by the testbench.
const ReadinessPath = "/__readiness"
ReadinessPath is used by provider readiness probes.
const StreamErrorTrigger = "STREAM_ERROR"
StreamErrorTrigger, anywhere in a streaming request, ends the stream with the provider's error event instead of a clean finish.
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.