vmodelclient

package
v0.260806.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package vmodelclient provides in-process implementations of the client interfaces backed by vmodel registries. They let virtual providers traverse the exact same dispatch path as real upstream providers — no short-circuits, no HTTP overhead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnthropicClient

type AnthropicClient struct {
	// contains filtered or unexported fields
}

AnthropicClient implements client.AnthropicClientInterface using the in-process vmodel Anthropic registry. No HTTP, no auth.

func NewAnthropicClient

func NewAnthropicClient(reg *anthropicvm.Registry, provider *typ.Provider) *AnthropicClient

NewAnthropicClient creates an in-process Anthropic vmodel client backed by reg.

func (*AnthropicClient) APIStyle

func (c *AnthropicClient) APIStyle() protocol.APIStyle

func (*AnthropicClient) BetaMessagesNew

BetaMessagesNew calls the vmodel synchronously and returns an *anthropic.BetaMessage built via JSON round-trip.

func (*AnthropicClient) BetaMessagesNewStreaming

BetaMessagesNewStreaming wraps vm.HandleAnthropicStream with a channel-based decoder so the caller gets a standard anthropicstream.Stream.

func (*AnthropicClient) Client

func (c *AnthropicClient) Client() *anthropic.Client

func (*AnthropicClient) Close

func (c *AnthropicClient) Close() error

func (*AnthropicClient) GetProvider

func (c *AnthropicClient) GetProvider() *typ.Provider

func (*AnthropicClient) ListModels

func (c *AnthropicClient) ListModels(_ context.Context) ([]string, error)

func (*AnthropicClient) MessagesNew

MessagesNew handles v1 (non-beta) Anthropic messages by lifting the params to beta, delegating to BetaMessagesNew, then converting the BetaMessage result to a Message (both share the same wire shape for the fields vmodel produces).

func (*AnthropicClient) MessagesNewStreaming

MessagesNewStreaming handles v1 streaming by lifting params to beta and reusing the beta decoder. MessageStreamEventUnion and BetaRawMessageStreamEventUnion share the same SSE wire format, so the same decoder drives both stream types.

func (*AnthropicClient) SetRecordSink

func (c *AnthropicClient) SetRecordSink(_ *obs.Sink)

type OpenAIClient

type OpenAIClient struct {
	// contains filtered or unexported fields
}

OpenAIClient implements client.OpenAIClientInterface using the in-process vmodel OpenAI registry. No HTTP, no auth — just direct function calls.

func NewOpenAIClient

func NewOpenAIClient(reg *openaivm.Registry, provider *typ.Provider) *OpenAIClient

NewOpenAIClient creates an in-process OpenAI vmodel client backed by reg.

func (*OpenAIClient) APIStyle

func (c *OpenAIClient) APIStyle() protocol.APIStyle

func (*OpenAIClient) ChatCompletionsNew

ChatCompletionsNew calls the vmodel synchronously and returns an *openai.ChatCompletion built via JSON round-trip.

func (*OpenAIClient) ChatCompletionsNewStreaming

ChatCompletionsNewStreaming wraps vm.HandleOpenAIChatStream with a channel-based decoder so the caller gets a standard ssestream.Stream.

func (*OpenAIClient) Client

func (c *OpenAIClient) Client() *openai.Client

func (*OpenAIClient) Close

func (c *OpenAIClient) Close() error

func (*OpenAIClient) EmbeddingsNew

func (*OpenAIClient) GetProvider

func (c *OpenAIClient) GetProvider() *typ.Provider

func (*OpenAIClient) ImagesGenerate

func (*OpenAIClient) ListModels

func (c *OpenAIClient) ListModels(_ context.Context) ([]string, error)

func (*OpenAIClient) ResponsesNew

func (*OpenAIClient) SetRecordSink

func (c *OpenAIClient) SetRecordSink(_ *obs.Sink)

Jump to

Keyboard shortcuts

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