langchain_community.utilities.requests.GenericRequestsWrapper¶

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

Bases: BaseModel

Lightweight wrapper around requests library.

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 aiosession: Optional[ClientSession] = None¶
param auth: Optional[Any] = None¶
param headers: Optional[Dict[str, str]] = None¶
param response_content_type: Literal['text', 'json'] = 'text'¶
param verify: bool = True¶
async adelete(url: str, **kwargs: Any) Union[str, Dict[str, Any]][source]¶

DELETE the URL and return the text asynchronously.

Parameters
  • url (str) –

  • kwargs (Any) –

Return type

Union[str, Dict[str, Any]]

async aget(url: str, **kwargs: Any) Union[str, Dict[str, Any]][source]¶

GET the URL and return the text asynchronously.

Parameters
  • url (str) –

  • kwargs (Any) –

Return type

Union[str, Dict[str, Any]]

async apatch(url: str, data: Dict[str, Any], **kwargs: Any) Union[str, Dict[str, Any]][source]¶

PATCH the URL and return the text asynchronously.

Parameters
  • url (str) –

  • data (Dict[str, Any]) –

  • kwargs (Any) –

Return type

Union[str, Dict[str, Any]]

async apost(url: str, data: Dict[str, Any], **kwargs: Any) Union[str, Dict[str, Any]][source]¶

POST to the URL and return the text asynchronously.

Parameters
  • url (str) –

  • data (Dict[str, Any]) –

  • kwargs (Any) –

Return type

Union[str, Dict[str, Any]]

async aput(url: str, data: Dict[str, Any], **kwargs: Any) Union[str, Dict[str, Any]][source]¶

PUT the URL and return the text asynchronously.

Parameters
  • url (str) –

  • data (Dict[str, Any]) –

  • kwargs (Any) –

Return type

Union[str, Dict[str, Any]]

delete(url: str, **kwargs: Any) Union[str, Dict[str, Any]][source]¶

DELETE the URL and return the text.

Parameters
  • url (str) –

  • kwargs (Any) –

Return type

Union[str, Dict[str, Any]]

get(url: str, **kwargs: Any) Union[str, Dict[str, Any]][source]¶

GET the URL and return the text.

Parameters
  • url (str) –

  • kwargs (Any) –

Return type

Union[str, Dict[str, Any]]

patch(url: str, data: Dict[str, Any], **kwargs: Any) Union[str, Dict[str, Any]][source]¶

PATCH the URL and return the text.

Parameters
  • url (str) –

  • data (Dict[str, Any]) –

  • kwargs (Any) –

Return type

Union[str, Dict[str, Any]]

post(url: str, data: Dict[str, Any], **kwargs: Any) Union[str, Dict[str, Any]][source]¶

POST to the URL and return the text.

Parameters
  • url (str) –

  • data (Dict[str, Any]) –

  • kwargs (Any) –

Return type

Union[str, Dict[str, Any]]

put(url: str, data: Dict[str, Any], **kwargs: Any) Union[str, Dict[str, Any]][source]¶

PUT the URL and return the text.

Parameters
  • url (str) –

  • data (Dict[str, Any]) –

  • kwargs (Any) –

Return type

Union[str, Dict[str, Any]]

property requests: Requests¶