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 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.