@hashgraphonline/conversational-agent
Version:
Hashgraph Online conversational AI agent implementing HCS-10 communication, HCS-2 registries, and content inscription on Hedera
38 lines (36 loc) • 1.21 kB
TypeScript
import { ContentStorage } from '../memory/ContentStorage';
import { Logger } from '@hashgraphonline/standards-sdk';
export interface MCPResponseContent {
content: unknown;
type: 'text' | 'image' | 'resource' | 'text[]' | 'image[]';
sizeBytes: number;
mimeType?: string;
}
export interface ProcessedResponse {
content: unknown;
wasProcessed: boolean;
referenceCreated?: boolean;
referenceId?: string;
originalSize?: number;
errors?: string[];
}
export interface ContentAnalysis {
shouldProcess: boolean;
contents: MCPResponseContent[];
totalSize: number;
largestContentSize: number;
}
export declare class MCPContentProcessor {
private contentStorage;
private logger;
constructor(contentStorage: ContentStorage, logger: Logger);
analyzeResponse(response: unknown): ContentAnalysis;
processResponse(response: unknown, serverName: string, toolName: string): Promise<ProcessedResponse>;
private extractContentFromResponse;
private createReferencedResponse;
private createLightweightReference;
private replaceContentInResponse;
private detectMimeType;
private mapMimeTypeToContentType;
private deepClone;
}