haive.core.contracts.aug_llm_adapter¶

Adapter to integrate extracted components with AugLLMConfig.

This module shows how AugLLMConfig can be refactored to use the new ToolConfig, PromptConfig, ToolRegistry, and PromptLibrary components.

Classes¶

AugLLMAdapter

Adapter showing how AugLLMConfig can use extracted components.

Module Contents¶

class haive.core.contracts.aug_llm_adapter.AugLLMAdapter(/, **data)[source]¶

Bases: pydantic.BaseModel

Adapter showing how AugLLMConfig can use extracted components.

This demonstrates the refactored architecture where: - Tool management is handled by ToolConfig and ToolRegistry - Prompt management is handled by PromptConfig and PromptLibrary - AugLLMConfig focuses on LLM configuration and orchestration

Parameters:

data (Any)

llm¶

The language model instance.

tool_config¶

Tool configuration.

prompt_config¶

Prompt configuration.

tool_registry¶

Shared tool registry.

prompt_library¶

Shared prompt library.

temperature¶

LLM temperature.

max_tokens¶

Maximum tokens.

model_name¶

Model identifier.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

class Config[source]¶

Pydantic configuration.

compose_prompts(prompt_names)[source]¶

Compose multiple prompts.

Parameters:

prompt_names (List[str]) – Prompts to compose.

Returns:

Composed prompt.

Return type:

Any

classmethod from_aug_llm_config(config)[source]¶

Create adapter from existing AugLLMConfig.

This shows the migration path from monolithic AugLLMConfig to the new component-based architecture.

Parameters:

config (Any) – Existing AugLLMConfig.

Returns:

New adapter instance.

Return type:

AugLLMAdapter

get_configuration_summary()[source]¶

Get configuration summary.

Returns:

Summary of configuration.

Return type:

Dict[str, Any]

get_prompt_from_library(name, version=None)[source]¶

Get prompt from library.

Parameters:
  • name (str) – Prompt name.

  • version (Optional[str]) – Prompt version.

Returns:

Prompt template or None.

Return type:

Any

get_safe_tools()[source]¶

Get tools without side effects.

Returns:

List of safe tools.

Return type:

List[Any]

get_tools_by_capability(capability, value=True)[source]¶

Get tools by capability.

Parameters:
  • capability (str) – Capability name.

  • value (bool) – Capability value.

Returns:

List of matching tools.

Return type:

List[Any]

to_dict()[source]¶

Convert to dictionary.

Returns:

Configuration as dictionary.

Return type:

Dict[str, Any]

validate_permissions(available_permissions)[source]¶

Validate all tool permissions.

Parameters:

available_permissions (set[str]) – Available permissions.

Returns:

Validation results by tool.

Return type:

Dict[str, bool]

with_prompt_template(template)[source]¶

Configure with prompt template using PromptConfig.

Parameters:

template (Any) – Prompt template.

Returns:

Self for chaining.

Return type:

AugLLMAdapter

with_tools(tools)[source]¶

Configure with tools using ToolConfig.

Parameters:

tools (List[Any]) – List of tools.

Returns:

Self for chaining.

Return type:

AugLLMAdapter