draft

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package draft provides test utilities specific to the draft protocol version.

Index

Constants

View Source
const Version = "draft"

The draft protocol version

Variables

This section is empty.

Functions

func CreateAudioMessage

func CreateAudioMessage(role, data, mimeType string) jsonrpc.SamplingMessage

CreateAudioMessage creates an audio sampling message

func CreateAudioResponse

func CreateAudioResponse(id interface{}, data string, mimeType string, model string) []byte

CreateAudioResponse creates an audio response for the draft protocol version

func CreateCreateMessageRequest

func CreateCreateMessageRequest(id interface{}, messages []jsonrpc.SamplingMessage, modelPreferences jsonrpc.SamplingModelPreferences) []byte

CreateCreateMessageRequest creates a sampling/createMessage request for draft protocol

func CreateImageMessage

func CreateImageMessage(role, data, mimeType string) jsonrpc.SamplingMessage

CreateImageMessage creates an image sampling message

func CreateImageResponse

func CreateImageResponse(id interface{}, data string, mimeType string, model string) []byte

CreateImageResponse creates an image response for the draft protocol version

func CreateModelPreferences

func CreateModelPreferences(modelNames ...string) jsonrpc.SamplingModelPreferences

CreateModelPreferences creates sampling model preferences

func CreateRequestMatcher

func CreateRequestMatcher() func([]byte) bool

CreateRequestMatcher creates a matcher function for sampling requests

func CreateResponseWithOptions

func CreateResponseWithOptions(id interface{}, text string, options map[string]interface{}) []byte

CreateResponseWithOptions creates a custom response with specified options

func CreateTextMessage

func CreateTextMessage(role, text string) jsonrpc.SamplingMessage

CreateTextMessage creates a text sampling message

func CreateTextResponse

func CreateTextResponse(id interface{}, text string, model string) []byte

CreateTextResponse creates a standard text response for the draft protocol version

func IsStreamingSupported

func IsStreamingSupported() bool

IsStreamingSupported returns false as streaming is not supported in draft version

func SetupMockTransport

func SetupMockTransport() *test.MockTransport

SetupMockTransport configures a mock transport for draft version sampling tests

Types

This section is empty.

Jump to

Keyboard shortcuts

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