mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
feat: field to pass number of posts as a parameter
This commit is contained in:
@@ -11,6 +11,7 @@ class RedditPostsLoaderRemote(BaseRemote):
|
||||
categories = data.get("categories", ["new", "hot"])
|
||||
mode = data.get("mode", "subreddit")
|
||||
search_queries = data.get("search_queries")
|
||||
number_posts = data.get("number_posts", 10)
|
||||
self.loader = RedditPostsLoader(
|
||||
client_id=client_id,
|
||||
client_secret=client_secret,
|
||||
@@ -18,7 +19,7 @@ class RedditPostsLoaderRemote(BaseRemote):
|
||||
categories=categories,
|
||||
mode=mode,
|
||||
search_queries=search_queries,
|
||||
number_posts=10,
|
||||
number_posts=number_posts,
|
||||
)
|
||||
documents = self.loader.load()
|
||||
print(f"Loaded {len(documents)} documents from Reddit")
|
||||
|
||||
@@ -22,6 +22,7 @@ export default function Upload({
|
||||
client_secret: '',
|
||||
user_agent: '',
|
||||
search_queries: [''],
|
||||
number_posts: 10,
|
||||
});
|
||||
const urlOptions: { label: string; value: string }[] = [
|
||||
{ label: 'Crawler', value: 'crawler' },
|
||||
@@ -388,6 +389,19 @@ export default function Upload({
|
||||
Search queries
|
||||
</span>
|
||||
</div>
|
||||
<input
|
||||
placeholder="Enter number of posts"
|
||||
type="number"
|
||||
className="h-10 w-full rounded-full border-2 border-silver px-3 outline-none dark:bg-transparent dark:text-silver"
|
||||
name="number_posts"
|
||||
value={redditData.number_posts}
|
||||
onChange={handleChange}
|
||||
></input>
|
||||
<div className="relative bottom-12 left-2 mt-[-18.39px]">
|
||||
<span className="bg-white px-2 text-xs text-silver dark:bg-outer-space dark:text-silver">
|
||||
Number of posts
|
||||
</span>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user