Documentation
¶
Overview ¶
Package litellmtest provides a scripted Provider for testing code that calls models, without a network or a vendor.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider answers each call with the next of its replies, and records the requests it was called with. It is safe for concurrent use. A call beyond the script fails.
type Reply ¶
type Reply struct {
Blocks []litellm.Block
Usage litellm.Usage
// FinishReason defaults to tool_calls when Blocks hold a tool use, and to
// stop otherwise.
FinishReason litellm.FinishReason
Err error
// StreamErr, if set, fails the stream with it once Blocks streamed,
// instead of finishing it.
StreamErr error
// Stall, if set, holds the stream open once Blocks streamed, until the
// call is cancelled.
Stall bool
}
Reply is one scripted call: the response it streams, or the error it fails with before streaming.
Click to show internal directories.
Click to hide internal directories.