ads4gpts-langchain
Version:
Ads for AI applications. Enabling the Freemium model for the AI era.
27 lines • 1.63 kB
TypeScript
import { AgentOptions } from './types/ads4GPTsAgent';
/**
* Initializes and returns an ADS4GPTs agent configured with tools and prompts.
*
* @param args - A record of input arguments for configuration.
* @param args.openai_api_key - (Optional) OpenAI API key used for initializing the ChatOpenAI model.
* If not provided, it will attempt to retrieve the value from the `OPENAI_API_KEY` environment variable.
* @param args.ads4gpts_api_key - (Optional) Ads4GPTs API key used for initializing the toolkit.
* If not provided, it will attempt to retrieve the value from the `ADS4GPTS_API_KEY` environment variable.
*
* @returns An initialized ADS4GPTs agent ready for use, with tools and prompts configured.
*
* @throws Error if either `openai_api_key` or `ads4gpts_api_key` is not provided in the arguments or environment variables.
*
* @example
* // Example usage with explicit API keys
* const agent = await getADS4GPTsAgent({
* openai_api_key: 'sk-openai-12345',
* ads4gpts_api_key: 'sk-ads4gpts-67890',
* });
*
* @example
* // Example usage with API keys from environment variables
* const agent = await getADS4GPTsAgent();
*/
export declare function getADS4GPTsAgent(args?: AgentOptions): Promise<import("@langchain/core/runnables", { with: { "resolution-mode": "import" } }).Runnable<any, import("@langchain/core/messages", { with: { "resolution-mode": "import" } }).AIMessageChunk, import("@langchain/core/runnables", { with: { "resolution-mode": "import" } }).RunnableConfig<Record<string, any>>>>;
//# sourceMappingURL=agent.d.ts.map