askexperts
Version:
AskExperts SDK: build and use AI experts - ask them questions and pay with bitcoin on an open protocol
53 lines (52 loc) • 1.79 kB
TypeScript
/**
* Interface for ReplyMCP objects returned by askExperts
*/
export interface ReplyMCP {
expert_pubkey: string;
expert_offer: string;
content?: string;
amount_sats?: number;
error?: string;
}
/**
* AskExpertsSmartClient class that provides a simplified interface
* for clients to interact with the AskExpertsClient with LLM capabilities
*/
export declare class AskExpertsSmartClient {
private client;
private openai;
/**
* Creates a new AskExpertsSmartClient instance
*
* @param nwcString - NWC connection string for payments
* @param openaiApiKey - OpenAI API key
* @param openaiBaseUrl - OpenAI base URL
* @param discoveryRelays - Optional list of discovery relays
*/
constructor(nwcString: string, openaiApiKey: string, openaiBaseUrl: string, discoveryRelays?: string[]);
private parseQuestion;
private selectBids;
/**
* Asks experts a question with LLM-powered summarization and expert selection
*
* @param question - Question to ask
* @param max_amount_sats - Maximum amount to pay in satoshis
* @param requirements - Optional requirements to experts that should be selected
* @returns Promise resolving to array of ReplyMCP objects
*/
askExperts(question: string, max_amount_sats: number, requirements?: string): Promise<ReplyMCP[]>;
/**
* Internal method to ask an expert a question
*
* @param question - Question to ask
* @param bid - Bid object
* @param max_amount_sats - Maximum amount to pay in satoshis
* @returns Promise resolving to ReplyMCP object
* @private
*/
private askExpertInternal;
/**
* Disposes of resources when the object is no longer needed
*/
[Symbol.dispose](): void;
}