langchain_community.utilities.openapi.OpenAPISpec¶
- class langchain_community.utilities.openapi.OpenAPISpec[source]¶
OpenAPI模型,用于删除规范中格式错误的部分。
Attributes
base_url获取基本URL。
openapiMethods
__init__()from_file(path)从文件路径获取一个OpenAPI规范。
from_spec_dict(spec_dict)从字典中获取一个OpenAPI规范。
from_text(text)从文本中获取一个OpenAPI规范。
from_url(url)从URL获取一个OpenAPI规范。
get_cleaned_operation_id(operation, path, method)从操作ID中获取一个清理过的操作ID。
get_methods_for_path(path)返回指定路径的有效方法列表。
get_operation(path, method)获取给定路径和HTTP方法的操作对象。
get_parameters_for_operation(operation)获取给定操作的组件。
get_parameters_for_path(path)获取模式(或嵌套引用)或错误。
get_request_body_for_operation(operation)获取给定操作的请求主体。
get_schema(schema)parse_obj(obj)- __init__()¶
- classmethod from_file(path: Union[str, Path]) OpenAPISpec[source]¶
从文件路径获取一个OpenAPI规范。
- Parameters
path (Union[str, Path]) –
- Return type
- classmethod from_spec_dict(spec_dict: dict) OpenAPISpec[source]¶
从字典中获取一个OpenAPI规范。
- Parameters
spec_dict (dict) –
- Return type
- classmethod from_text(text: str) OpenAPISpec[source]¶
从文本中获取一个OpenAPI规范。
- Parameters
text (str) –
- Return type
- classmethod from_url(url: str) OpenAPISpec[source]¶
从URL获取一个OpenAPI规范。
- Parameters
url (str) –
- Return type
- static get_cleaned_operation_id(operation: Operation, path: str, method: str) str[source]¶
从操作ID中获取一个清理过的操作ID。
- Parameters
operation (Operation) –
path (str) –
method (str) –
- Return type
str
- get_methods_for_path(path: str) List[str][source]¶
返回指定路径的有效方法列表。
- Parameters
path (str) –
- Return type
List[str]
- get_operation(path: str, method: str) Operation[source]¶
获取给定路径和HTTP方法的操作对象。
- Parameters
path (str) –
method (str) –
- Return type
- get_parameters_for_path(path: str) List[Parameter][source]¶
- Parameters
path (str) –
- Return type
List[Parameter]
- get_referenced_schema(ref: Reference) Schema[source]¶
获取模式(或嵌套引用)或错误。
- Parameters
ref (Reference) –
- Return type
- get_request_body_for_operation(operation: Operation) Optional[RequestBody][source]¶
获取给定操作的请求主体。
- Parameters
operation (Operation) –
- Return type
Optional[RequestBody]
- classmethod parse_obj(obj: dict) OpenAPISpec[source]¶
- Parameters
obj (dict) –
- Return type