import { BaseChain } from "../base.js"; import { LLMChainInput } from "../llm_chain.js"; import { SequentialChain } from "../sequential_chain.js"; import { OpenAPISpec } from "../../util/openapi.js"; import { BasePromptTemplate } from "@langchain/core/prompts"; import { BaseFunctionCallOptions } from "@langchain/core/language_models/base"; import { JsonSchema7Type } from "@langchain/core/utils/json_schema"; import { OpenAIClient } from "@langchain/openai"; import { BaseChatModel } from "@langchain/core/language_models/chat_models"; import { OpenAPIV3_1 } from "openapi-types"; //#region src/chains/openai_functions/openapi.d.ts /** * Type representing a function for executing OpenAPI requests. */ type OpenAPIExecutionMethod = (name: string, requestArgs: Record, options?: { headers?: Record; params?: Record; }) => Promise; /** * Converts OpenAPI schemas to JSON schema format. * @param schema The OpenAPI schema to convert. * @param spec The OpenAPI specification that contains the schema. * @returns The JSON schema representation of the OpenAPI schema. */ /** * Converts an OpenAPI specification to OpenAI functions. * @param spec The OpenAPI specification to convert. * @returns An object containing the OpenAI functions derived from the OpenAPI specification and a default execution method. */ declare function convertOpenAPISpecToOpenAIFunctions(spec: OpenAPISpec): { openAIFunctions: OpenAIClient.Chat.ChatCompletionCreateParams.Function[]; defaultExecutionMethod?: OpenAPIExecutionMethod; }; /** * Type representing the options for creating an OpenAPI chain. */ type OpenAPIChainOptions = { llm?: BaseChatModel; prompt?: BasePromptTemplate; requestChain?: BaseChain; llmChainInputs?: LLMChainInput; headers?: Record; params?: Record; verbose?: boolean; }; /** * Create a chain for querying an API from a OpenAPI spec. * @param spec OpenAPISpec or url/file/text string corresponding to one. * @param options Custom options passed into the chain * @returns OpenAPIChain */ declare function createOpenAPIChain(spec: OpenAPIV3_1.Document | string, options?: OpenAPIChainOptions): Promise; //#endregion export { OpenAPIChainOptions, convertOpenAPISpecToOpenAIFunctions, createOpenAPIChain }; //# sourceMappingURL=openapi.d.ts.map