modelprofile

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package modelprofile provides an init_chat_model-style registry and resolver for the v1 agent framework. It builds on the existing llms/modelprofiles capability metadata and adapts concrete langchaingo models into the v1 ChatModel interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Describe

func Describe(model string) string

Describe returns a human-readable summary of a model's capabilities.

func InitChatModel

func InitChatModel(ctx context.Context, identifier string, opts ...ModelOption) (agents.ChatModel, error)

InitChatModel resolves a model identifier (e.g. "openai:gpt-4o" or "gpt-4o") into a v1 ChatModel. It mirrors langchain's init_chat_model.

func Lookup

func Lookup(model string) *mprof.ModelProfile

Lookup returns capability metadata for a model name, or nil.

func RegisterProvider

func RegisterProvider(p Provider)

RegisterProvider registers a provider so model identifiers like "openai:gpt-4o" can be resolved.

Types

type ModelOption

type ModelOption func(*options)

ModelOption configures model resolution.

func WithProvider

func WithProvider(p string) ModelOption

WithProvider forces a specific provider when resolving a model identifier.

type Provider

type Provider interface {
	// Name returns the provider identifier (e.g. "openai").
	Name() string
	// NewModel constructs a ChatModel for the given model name.
	NewModel(ctx context.Context, model string) (agents.ChatModel, error)
}

Provider is a model provider that can construct a v1 ChatModel from a model name.

Jump to

Keyboard shortcuts

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