test

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package test provides common test methods and types for LLM providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chat

func Chat(t *testing.T, p testProvider, model llmproxy.ModelID)

Chat tests basic chat functionality of the provider.

func ChatWithToolUse

func ChatWithToolUse(t *testing.T, p testProvider, model llmproxy.ModelID)

ChatWithToolUse tests chat functionality with tool use.

func FileHandling

func FileHandling(t *testing.T, p testProvider)

FileHandling tests file upload and deletion functionality of the provider.

func StructuredResponse

func StructuredResponse(t *testing.T, p testProvider, model llmproxy.ModelID)

StructuredResponse tests chat functionality with structured response formats.

Types

type GetWeatherArgs

type GetWeatherArgs struct {
	City string `json:"city"`
}

GetWeatherArgs represents the arguments for the GetWeather tool.

type Temperature

type Temperature struct {
	Current float64 `json:"current"`
	High    float64 `json:"high"`
	Low     float64 `json:"low"`
	Unit    string  `json:"unit"`
}

Temperature shows nested structure support

type Weather

type Weather struct {
	City             string `json:"city"`
	TemperatureRange string `json:"temperature_range"`
	Conditions       string `json:"conditions"`
}

Weather represents the weather information returned by the GetWeather tool.

func GetWeather

func GetWeather(_ context.Context, args GetWeatherArgs) (Weather, error)

GetWeather returns the current weather information for a specified city.

type WeatherForecast

type WeatherForecast struct {
	Location    string      `json:"location"`
	Conditions  string      `json:"conditions"`
	Temperature Temperature `json:"temperature"`
	Alerts      []string    `json:"alerts"`
}

WeatherForecast demonstrates a nested response format

Jump to

Keyboard shortcuts

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