@relayplane/sdk
Version:
RelayPlane SDK with zero-config AI access, intelligent model selection, built-in examples, and contextual error handling. The easiest way to add AI to your app with automatic optimization and fallback.
60 lines • 1.97 kB
TypeScript
/**
* RelayPlane SDK - Multi-Agent Chaining
*
* This module provides multi-agent workflow capabilities, allowing sequential
* execution of multiple AI models with data passing between steps.
*/
import type { ChainRequest, ChainResponse, ChatMessage, SupportedModel } from '../types';
/**
* Execute a multi-agent chain workflow
*
* @param chainRequest - The chain configuration and steps
* @returns Promise<ChainResponse> - Results from all steps including final output
*/
export declare function chain(chainRequest: ChainRequest): Promise<ChainResponse>;
/**
* Create a simple chain with predefined steps
*/
export declare function createChain(): ChainBuilder;
/**
* Fluent API for building chains
*/
export declare class ChainBuilder {
private steps;
private metadata;
/**
* Add a step to the chain
*/
step(stepName: string, model: SupportedModel, options?: {
payload?: Record<string, any>;
metadata?: Record<string, any>;
transform?: (input: any) => Record<string, any>;
}): ChainBuilder;
/**
* Add metadata to the chain
*/
withMetadata(metadata: Record<string, any>): ChainBuilder;
/**
* Execute the chain
*/
run(input: string | ChatMessage[], optimize?: boolean): Promise<ChainResponse>;
}
export declare const chainTemplates: {
/**
* Research and synthesize workflow
*/
researchAndSynthesize: (researchModel?: SupportedModel, synthesisModel?: SupportedModel) => ChainBuilder;
/**
* Summarize and translate workflow
*/
summarizeAndTranslate: (summaryModel?: SupportedModel, translateModel?: SupportedModel) => ChainBuilder;
/**
* Analyze and optimize workflow
*/
analyzeAndOptimize: (analyzeModel?: SupportedModel, optimizeModel?: SupportedModel) => ChainBuilder;
/**
* Code review workflow
*/
codeReview: (model?: SupportedModel) => ChainBuilder;
};
//# sourceMappingURL=chain.d.ts.map