JsonRequestsWrapper#
- class langchain_community.utilities.requests.JsonRequestsWrapper[源代码]#
-
轻量级的requests库封装,支持异步操作。
此包装器的主要目的是始终返回一个json输出。
通过解析和验证来自关键字参数的输入数据来创建一个新模型。
如果输入数据无法验证以形成有效模型,则引发 [ValidationError][pydantic_core.ValidationError]。
self 被显式地设为仅位置参数,以允许 self 作为字段名称。
- param aiosession: aiohttp.ClientSession | None = None#
- param auth: Any | None = None#
- param headers: Dict[str, str] | None = None#
- param response_content_type: Literal['text', 'json'] = 'json'#
- param verify: bool = True#
- async adelete(url: str, **kwargs: Any) str | Dict[str, Any] #
删除URL并异步返回文本。
- Parameters:
url (str)
kwargs (Any)
- Return type:
str | Dict[str, Any]
- async aget(url: str, **kwargs: Any) str | Dict[str, Any] #
获取URL并异步返回文本。
- Parameters:
url (str)
kwargs (Any)
- Return type:
str | Dict[str, Any]
- async apatch(url: str, data: Dict[str, Any], **kwargs: Any) str | Dict[str, Any] #
PATCH URL 并异步返回文本。
- Parameters:
url (str)
data (Dict[str, Any])
kwargs (Any)
- Return type:
str | Dict[str, Any]
- async apost(url: str, data: Dict[str, Any], **kwargs: Any) str | Dict[str, Any] #
向URL发送POST请求并异步返回文本。
- Parameters:
url (str)
data (Dict[str, Any])
kwargs (Any)
- Return type:
str | Dict[str, Any]
- async aput(url: str, data: Dict[str, Any], **kwargs: Any) str | Dict[str, Any] #
PUT URL 并异步返回文本。
- Parameters:
url (str)
data (Dict[str, Any])
kwargs (Any)
- Return type:
str | Dict[str, Any]
- delete(url: str, **kwargs: Any) str | Dict[str, Any] #
删除URL并返回文本。
- Parameters:
url (str)
kwargs (Any)
- Return type:
str | Dict[str, Any]
- get(url: str, **kwargs: Any) str | Dict[str, Any] #
获取URL并返回文本。
- Parameters:
url (str)
kwargs (Any)
- Return type:
str | Dict[str, Any]
- patch(url: str, data: Dict[str, Any], **kwargs: Any) str | Dict[str, Any] #
PATCH URL 并返回文本。
- Parameters:
url (str)
data (Dict[str, Any])
kwargs (Any)
- Return type:
str | Dict[str, Any]
- post(url: str, data: Dict[str, Any], **kwargs: Any) str | Dict[str, Any] #
向URL发送POST请求并返回文本。
- Parameters:
url (str)
data (Dict[str, Any])
kwargs (Any)
- Return type:
str | Dict[str, Any]
- put(url: str, data: Dict[str, Any], **kwargs: Any) str | Dict[str, Any] #
PUT URL 并返回文本。
- Parameters:
url (str)
data (Dict[str, Any])
kwargs (Any)
- Return type:
str | Dict[str, Any]