UNPKG

@hashgraphonline/conversational-agent

Version:

Hashgraph Online conversational AI agent implementing HCS-10 communication, HCS-2 registries, and content inscription on Hedera. https://hol.org

44 lines (42 loc) 2 kB
import { NetworkType } from '@hashgraphonline/standards-sdk'; import { FormatConverterRegistry } from './formatters'; import { EntityAssociation } from '../memory/smart-memory-manager'; /** * Service for processing tool parameters and applying entity format conversions */ export declare class ParameterService { private logger; private formatConverterRegistry; private networkType; constructor(formatConverterRegistry: FormatConverterRegistry, networkType: NetworkType); /** * Unified preprocessing entrypoint (DRY): * - Optional AI-driven resolution via provided entityResolver * - Deterministic post-pass for safe format enforcement */ preprocessParameters(toolName: string, parameters: Record<string, unknown>, entities?: EntityAssociation[], options?: { entityResolver?: { resolveReferences: (message: string, entities: EntityAssociation[]) => Promise<string>; }; sessionId?: string; preferences?: Record<string, string>; }): Promise<Record<string, unknown>>; /** * Attach unified preprocessing callback directly to the agent. */ attachToAgent(agent: unknown, deps?: { getSessionId?: () => string | null; getEntities?: (sessionId: string | null) => Promise<EntityAssociation[]>; entityResolver?: { resolveReferences: (message: string, entities: EntityAssociation[]) => Promise<string>; }; }): void; /** * Preprocess tool parameters by applying format conversions based on tool's entity resolution preferences */ preprocessToolParameters(toolName: string, parameters: Record<string, unknown>, entities?: EntityAssociation[], sessionId?: string): Promise<Record<string, unknown>>; /** * Convert entity references in a parameter value based on tool preferences */ convertParameterEntities(parameterValue: string, entities: EntityAssociation[], preferences?: Record<string, string>): Promise<string>; }