-
Notifications
You must be signed in to change notification settings - Fork 18.2k
community: add include_comment_forest to RedditSearch #29699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…and format the entire comment forest - Introduce `include_comment_forest` as a boolean parameter in the `RedditSearchSchema` and `RedditSearchRun` tool. - Update `RedditSearchAPIWrapper` methods to fetch and recursively parse all nested comments (`_parse_comment_forest`) when `include_comment_forest` is True. - Add `_format_comment_forest` to output the entire comment tree in a readable format. - Extend the `run` and `results` methods to utilize this new parameter and display the retrieved comment hierarchy.
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it makes more sense to initialize the tool with include_comment_forest
, instead of requiring the model to populate True/False?
Note that as-is, this PR would require all models using this tool to populate the new parameter. Some models will also start filling out True, will pull a huge comment history, and cause problems for maintainers. IMO this should be an opt-in feature.
Thanks for the thoughtful feedback! My original reason for having
However, I understand your concern that this could lead to unintended large data pulls if an LLM or user call sets Proposed Compromise:
This way:
Would that address both the need for runtime flexibility and your concern about possibly large or unintended data pulls? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. This could work but it would be confusing for a model to specify include_comment_forest
with no effect. You could dynamically select the schema. But I think ideally we get this out of langchain-community so we can test and version changes like this properly (there also appear to be no tests on this tool, which makes reviewing new features difficult).
I believe you contributed the Discord integration, would you be interested in doing something similar for Reddit?
Thanks for the feedback! Yes, I did contribute the Discord integration. I’d be happy to work on a similar, fully-tested and separately versioned Reddit integration if that’s the direction you prefer. Do you want to close this PR? |
Awesome, yes. Will close for now. Thank you! |
Description:
Introduces a new
include_comment_forest
boolean parameter in theRedditSearchSchema
andRedditSearchRun
tool. When set toTrue
, this fetches and recursively parses the entire nested comment tree using_parse_comment_forest
, and formats it using_format_comment_forest
. Updatedrun
andresults
methods to support displaying the full comment hierarchy.Issue:
(No specific issue to reference.)
Dependencies:
None.