langchain.tools.openapi.utils.api_models.APIOperation¶
- class langchain.tools.openapi.utils.api_models.APIOperation(*, operation_id: str, description: Optional[str] = None, base_url: str, path: str, method: HTTPVerb, properties: Sequence[APIProperty], request_body: Optional[APIRequestBody] = None)[source]¶
Bases:
BaseModelA model for a single API operation.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- param base_url: str [Required]¶
The base URL of the operation.
- param description: Optional[str] = None¶
The description of the operation.
- param method: langchain.utilities.openapi.HTTPVerb [Required]¶
The HTTP method of the operation.
- param operation_id: str [Required]¶
The unique identifier of the operation.
- param path: str [Required]¶
The path of the operation.
- param properties: Sequence[langchain.tools.openapi.utils.api_models.APIProperty] [Required]¶
- param request_body: Optional[langchain.tools.openapi.utils.api_models.APIRequestBody] = None¶
The request body of the operation.
- classmethod from_openapi_spec(spec: OpenAPISpec, path: str, method: str) APIOperation[source]¶
Create an APIOperation from an OpenAPI spec.
- classmethod from_openapi_url(spec_url: str, path: str, method: str) APIOperation[source]¶
Create an APIOperation from an OpenAPI URL.
- property body_params: List[str]¶
- property path_params: List[str]¶
- property query_params: List[str]¶