Help us shape the future of Go! Take the 2026 Go Developer Survey

adapter

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package adapter holds the host-model injection bridge.

In the Python port this wrapped langchain ChatModel/Embeddings objects. The Go port integrates langchain-golang: hosts inject their ChatModel / Embeddings via WrapChatModel / WrapEmbeddings and assign the results to ModelRouting. Unset fields fall back to Config / heuristic mode.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapChatModel

func WrapChatModel(cm language.ChatModel, structuredMethod string) providers.LLMProvider

WrapChatModel adapts a host-owned langchain-golang ChatModel into an LLMProvider suitable for ModelRouting — the Go equivalent of Python's ModelRouting fields accepting langchain BaseChatModel objects directly. structuredMethod mirrors Python's structured_method ("function_calling" | "json_mode" | "json_schema"; "" = provider default).

func WrapEmbeddings

WrapEmbeddings bridges a host-owned langchain-golang Embeddings into ladyM's EmbeddingProvider, mirroring Python's LangChainEmbeddingAdapter. Dim starts at 0 and is probed on the first Embed call (deferred-dim pattern, same as OllamaEmbedding / Python's dim=None).

Types

type ModelRouting

type ModelRouting struct {
	Embedding       storage.EmbeddingProvider
	Consolidate     providers.LLMProvider
	Proceduralize   providers.LLMProvider
	AttentionGate   providers.LLMProvider
	L5MentalModel   providers.LLMProvider
	L6ForwardIntent providers.LLMProvider
	L4Backfill      providers.LLMProvider
	L4Link          providers.LLMProvider
	L4AliasMerge    providers.LLMProvider
}

ModelRouting injects host-owned models, bypassing LadyM's own config. Unset fields fall back to Config / heuristic. Field names mirror providers.NAMED_OPS.

func (*ModelRouting) Get

Get returns the injected LLM provider for op, or nil.

Jump to

Keyboard shortcuts

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