inferencewrapper

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MPL-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDebugConfig added in v0.0.91

func DefaultDebugConfig() debugclient.DebugConfig

Types

type MCPCompletionHydrationRequest added in v0.1.11

type MCPCompletionHydrationRequest struct {
	Context *mcpConversation.MCPConversationContext

	// ExistingToolChoices are parent-created choices. MCP hydration uses them
	// only to reject duplicate provider names and choice IDs.
	ExistingToolChoices []inferenceSpec.ToolChoice
}

type MCPCompletionHydrationResult added in v0.1.11

type MCPCompletionHydrationResult struct {
	SystemPromptParts []string
	CurrentInputs     []inferenceSpec.InputUnion
	ToolChoices       []inferenceSpec.ToolChoice
	ToolMappings      []mcpConversation.MCPProviderToolMapping

	DebugDetails map[string]any
}

type MCPInferenceBridge added in v0.1.11

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

func NewMCPInferenceBridge added in v0.1.11

func NewMCPInferenceBridge(rt MCPRuntime) *MCPInferenceBridge

func (*MCPInferenceBridge) HydrateCompletion added in v0.1.11

type MCPRuntime added in v0.1.11

type MCPRuntime interface {
	Status(
		ctx context.Context,
		server mcpServer.ServerID,
	) (*mcpServer.MCPServerRuntimeSnapshot, error)

	ListTools(
		ctx context.Context,
		server mcpServer.ServerID,
	) ([]mcpServer.MCPToolCapability, error)

	ListResources(
		ctx context.Context,
		server mcpServer.ServerID,
	) ([]mcpServer.MCPResourceRef, error)

	ListResourceTemplates(
		ctx context.Context,
		server mcpServer.ServerID,
	) ([]mcpServer.MCPResourceTemplateRef, error)

	ListPrompts(
		ctx context.Context,
		server mcpServer.ServerID,
	) ([]mcpServer.MCPPromptRef, error)

	ReadResource(
		ctx context.Context,
		server mcpServer.ServerID,
		uri string,
	) (*mcpServer.MCPReadResourceResponseBody, error)

	GetPrompt(
		ctx context.Context,
		server mcpServer.ServerID,
		name string,
		arguments map[string]string,
	) (*mcpServer.MCPGetPromptResponseBody, error)
}

type ProviderSetAPI

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

ProviderSetAPI is a thin aggregator on top of inference-go's ProviderSetAPI. It owns:

  • provider lifecycle (add/delete/set API key),
  • attachment/tool hydration,
  • mapping Conversation+CurrentTurn -> inference-go FetchCompletionRequest.

func NewProviderSetAPI

func NewProviderSetAPI(
	ts *toolStore.ToolStore,
	mps *modelpresetStore.ModelPresetStore,
	artifactSkills *skillAggregate.Service,
	mcpBridge *MCPInferenceBridge,
	workspaceBridge *WorkspaceInferenceBridge,
	opts ...ProviderSetOption,
) (*ProviderSetAPI, error)

NewProviderSetAPI creates a new ProviderSetAPI wrapper.

  • ts: tool store used to hydrate ToolChoices when needed.
  • opts: functional options for configuring the wrapper (e.g. WithLogger, WithDebugConfig).

func (*ProviderSetAPI) AddProvider

AddProvider forwards to inference-go ProviderSetAPI.AddProvider.

func (*ProviderSetAPI) DeleteProvider

DeleteProvider forwards to inference-go ProviderSetAPI.DeleteProvider.

func (*ProviderSetAPI) FetchCompletion

func (ps *ProviderSetAPI) FetchCompletion(
	ctx context.Context,
	req *spec.CompletionRequest,
) (*spec.CompletionResponse, error)

FetchCompletion builds a normalized inference-go FetchCompletionRequest from app-level conversation types and calls inference-go's FetchCompletion.

func (*ProviderSetAPI) GetDebugConfig added in v0.0.91

func (ps *ProviderSetAPI) GetDebugConfig() *debugclient.DebugConfig

GetDebugConfig returns a defensive copy of the live debug configuration.

func (*ProviderSetAPI) SetDebugConfig added in v0.0.91

func (ps *ProviderSetAPI) SetDebugConfig(cfg *debugclient.DebugConfig)

SetDebugConfig updates the live debug client configuration used for future completions. Passing nil disables debugging while keeping the transport wrapper installed, so debugging can be enabled again later without reinitializing providers.

func (*ProviderSetAPI) SetProviderAPIKey

SetProviderAPIKey forwards to inference-go ProviderSetAPI.SetProviderAPIKey.

type ProviderSetOption

type ProviderSetOption func(*ProviderSetAPI)

func WithDebugConfig

func WithDebugConfig(debugConfig *debugclient.DebugConfig) ProviderSetOption

func WithLogger

func WithLogger(logger *slog.Logger) ProviderSetOption

func WithSkillsRunScriptEnabled added in v0.0.82

func WithSkillsRunScriptEnabled(enabled bool) ProviderSetOption

WithSkillsRunScriptEnabled controls whether skills-runscript is advertised to the model. Default: false (safer; matches the default fsskillprovider which disables scripts).

type WorkspaceCompletionHydrationResult added in v0.2.12

type WorkspaceCompletionHydrationResult struct {
	CurrentInputs []inferenceSpec.InputUnion
	Usage         *workspaceConversation.ConversationUsage
	DebugDetails  map[string]any
}

type WorkspaceConversationResolver added in v0.2.12

type WorkspaceConversationResolver interface {
	ResolveConversationSelection(
		ctx context.Context,
		selection workspaceConversation.ConversationSelection,
	) (workspaceConversation.ConversationResolution, error)
}

type WorkspaceInferenceBridge added in v0.2.12

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

func NewWorkspaceInferenceBridge added in v0.2.12

func NewWorkspaceInferenceBridge(
	resolver WorkspaceConversationResolver,
) *WorkspaceInferenceBridge

func (*WorkspaceInferenceBridge) HydrateCompletion added in v0.2.12

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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