langchain_community.utilities.reddit_search.RedditSearchAPIWrapper¶
class langchain_community.utilities.reddit_search.RedditSearchAPIWrapper[source]¶
Bases: BaseModel
Wrapper for Reddit API
To use, set the environment variables REDDIT_CLIENT_ID,
REDDIT_CLIENT_SECRET, REDDIT_USER_AGENT to set the client ID,
client secret, and user agent, respectively, as given by Reddit’s API.
Alternatively, all three can be supplied as named parameters in the
constructor: reddit_client_id, reddit_client_secret, and
reddit_user_agent, respectively.
Example
from langchain_community.utilities import RedditSearchAPIWrapper
reddit_search = RedditSearchAPIWrapper()
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 reddit_client: Any = None¶
param reddit_client_id: Optional[str] = None¶
param reddit_client_secret: Optional[str] = None¶
param reddit_user_agent: Optional[str] = None¶
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶
Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include – fields to include in new model