a
    bg                     @   sl   d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	m
Z
 ddlmZ G dd de	ZG d	d
 d
eZdS )zTool for the Reddit search API.    )OptionalType)CallbackManagerForToolRun)BaseTool)	BaseModelField)RedditSearchAPIWrapperc                   @   sl   e Zd ZU dZeddZeed< eddZeed< eddZ	eed< ed	dZ
eed
< eddZeed< dS )RedditSearchSchemazInput for Reddit search.z]should be query string that post title should         contain, or '*' if anything is allowed.)descriptionqueryzashould be sort method, which is one of: "relevance"         , "hot", "top", "new", or "comments".sortzlshould be time period to filter by, which is         one of "all", "day", "hour", "month", "week", or "year"time_filterz9should be name of subreddit, like "all" for         r/all	subredditzMa positive integer indicating the maximum number         of results to returnlimitN)__name__
__module____qualname____doc__r   r   str__annotations__r   r   r   r    r   r   z/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/langchain_community/tools/reddit_search/tool.pyr	      s    
r	   c                	   @   sl   e Zd ZU dZdZeed< dZeed< ee	dZ
e	ed< eZee ed< deeeeeee ed
ddZd	S )RedditSearchRunz+Tool that queries for posts on a subreddit.Zreddit_searchnamezfA tool that searches for posts on Reddit.Useful when you need to know post information on a subreddit.r
   )default_factoryapi_wrapperargs_schemaN)r   r   r   r   r   run_managerreturnc                 C   s   | j j||||t|dS )zUse the tool.)r   r   r   r   r   )r   runint)selfr   r   r   r   r   r   r   r   r   _run0   s    
zRedditSearchRun._run)N)r   r   r   r   r   r   r   r
   r   r   r   r	   r   r   r   r   r   r"   r   r   r   r   r   %   s    

	 r   N)r   typingr   r   Zlangchain_core.callbacksr   Zlangchain_core.toolsr   Zpydanticr   r   Z+langchain_community.utilities.reddit_searchr   r	   r   r   r   r   r   <module>   s   