test

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockClient

type MockClient struct {
	ChatOutput string
	Err        error
}

func NewMockClient

func NewMockClient() *MockClient

func (*MockClient) Chat

func (m *MockClient) Chat(messages []chat.Message, options *chat.ChatOptions) (*chat.Message, chat.ResponseInfo, error)

func (*MockClient) ChatWithFunctions added in v0.0.6

func (c *MockClient) ChatWithFunctions(messages []chat.Message, functions []tools.FunctionConfig, options *chat.ChatOptions) (*chat.Message, chat.ResponseInfo, error)

type MockServer

type MockServer struct {
	*httptest.Server

	RequestHandler func(w http.ResponseWriter, r *http.Request)
}

func NewTestServer

func NewTestServer() *MockServer

func (*MockServer) Close

func (m *MockServer) Close()

func (*MockServer) Init

func (m *MockServer) Init()

func (*MockServer) SetRequestHandler

func (m *MockServer) SetRequestHandler(handler func(w http.ResponseWriter, r *http.Request))

func (*MockServer) Start

func (m *MockServer) Start()

func (*MockServer) URL

func (m *MockServer) URL() string

Jump to

Keyboard shortcuts

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