Documentation ¶
Overview ¶
This package contains test intended to be used by the implementations of the Querier, ChatQuerier and StreamCompleter interfaces
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChatQuerier_Test ¶ added in v1.2.0
func ChatQuerier_Test(t *testing.T, q ChatQuerier)
func Querier_Context_Test ¶ added in v1.2.0
func StreamCompleter_Test ¶ added in v1.2.0
func StreamCompleter_Test(t *testing.T, s StreamCompleter)
Types ¶
type Chat ¶
type Chat struct { Created time.Time `json:"created,omitempty"` ID string `json:"id"` Messages []Message `json:"messages"` }
func (*Chat) FirstSystemMessage ¶ added in v1.3.0
FirstSystemMessage returns the first encountered Message with role 'system'
func (*Chat) FirstUserMessage ¶ added in v1.3.0
type ChatQuerier ¶
type CompletionEvent ¶ added in v1.2.0
type CompletionEvent any
type StreamCompleter ¶ added in v1.2.0
type StreamCompleter interface { // Setup the stream completer, do things like init http.Client/websocket etc // Will be called synchronously. Should return error if setup fails Setup() error // StreamCompletions and return a channel which sends CompletionsEvents. // The CompletionEvents should be a string, an error, NoopEvent or a models.Call. If there is // a catastrophic error, return the error and close the channel. StreamCompletions(context.Context, Chat) (chan CompletionEvent, error) }
Click to show internal directories.
Click to hide internal directories.