
    dh                     x    S r SSKJrJr  SSKJr  SSKJr  SSKJ	r	J
r
  SSKJr   " S S\	5      r " S	 S
\5      rg)zTool for the Reddit search API.    )OptionalType)CallbackManagerForToolRun)BaseTool)	BaseModelField)RedditSearchAPIWrapperc                       \ rS rSr% Sr\" SS9r\\S'   \" SS9r	\\S'   \" SS9r
\\S	'   \" S
S9r\\S'   \" SS9r\\S'   Srg)RedditSearchSchema   z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limit N)__name__
__module____qualname____firstlineno____doc__r   r   str__annotations__r   r   r   r   __static_attributes__r       d/var/www/html/shao/venv/lib/python3.13/site-packages/langchain_community/tools/reddit_search/tool.pyr   r      s|    "1E3  /D#  AK  Is  E3 r   r   c                       \ rS rSr% SrSr\\S'   Sr\\S'   \	" \
S9r\
\S'   \r\\   \S	'    SS\S\S\S\S\S\\   S\4S jjrSrg
)RedditSearchRun%   z+Tool that queries for posts on a subreddit.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_schemaNr   r   r   r   r   run_managerreturnc           	      N    U R                   R                  UUUU[        U5      S9$ )zUse the tool.)r   r   r   r   r   )r$   runint)selfr   r   r   r   r   r&   s          r   _runRedditSearchRun._run0   s5     ###e* $ 
 	
r   r   )N)r   r   r   r   r   r"   r   r   r   r   r	   r$   r   r%   r   r   r   r   r,   r   r   r   r   r   r   %   s    5D#	H   +0@V*WK'W#5Ki5 <@

 
 	

 
 
 78
 

 
r   r   N)r   typingr   r   langchain_core.callbacksr   langchain_core.toolsr   pydanticr   r   +langchain_community.utilities.reddit_searchr	   r   r   r   r   r   <module>r3      s/    % ! > ) % N 2
h 
r   