通用请求包装器#

class langchain_community.utilities.requests.GenericRequestsWrapper[source]#

基础类:BaseModel

轻量级的requests库封装。

通过解析和验证来自关键字参数的输入数据来创建一个新模型。

如果输入数据无法验证以形成有效模型,则引发 [ValidationError][pydantic_core.ValidationError]。

self 被显式地设为仅位置参数,以允许 self 作为字段名称。

param aiosession: ClientSession | None = None#
param auth: Any | None = None#
param headers: Dict[str, str] | None = None#
param response_content_type: Literal['text', 'json'] = 'text'#
param verify: bool = True#
async adelete(url: str, **kwargs: Any) str | Dict[str, Any][source]#

删除URL并异步返回文本。

Parameters:
  • url (str)

  • kwargs (Any)

Return type:

str | Dict[str, Any]

async aget(url: str, **kwargs: Any) str | Dict[str, Any][source]#

获取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][source]#

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][source]#

向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][source]#

删除URL并返回文本。

Parameters:
  • url (str)

  • kwargs (Any)

Return type:

str | Dict[str, Any]

get(url: str, **kwargs: Any) str | Dict[str, Any][source]#

获取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][source]#

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]

property requests: Requests#