mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
Remove RedditCredentialsBlock
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
# type: ignore
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
from typing import ClassVar
|
||||
|
||||
import praw
|
||||
from pydantic import BaseModel
|
||||
@@ -34,26 +33,6 @@ def get_praw(creds: RedditCredentials) -> praw.Reddit:
|
||||
)
|
||||
|
||||
|
||||
class RedditCredentialsBlock(Block):
|
||||
class Input(BlockSchema, RedditCredentials):
|
||||
pass
|
||||
|
||||
class Output(BlockSchema):
|
||||
reddit: RedditCredentials
|
||||
|
||||
def __init__(self):
|
||||
super().__init__(
|
||||
id="0c391c35-be7f-40e1-ac27-c3009391f244",
|
||||
input_schema=RedditCredentialsBlock.Input,
|
||||
output_schema=RedditCredentialsBlock.Output,
|
||||
)
|
||||
|
||||
def run(self, input_data: RedditCredentials) -> BlockOutput:
|
||||
client = get_praw(input_data)
|
||||
client.user.me()
|
||||
yield "credential", input_data
|
||||
|
||||
|
||||
class RedditGetPostsBlock(Block):
|
||||
class Input(BlockSchema):
|
||||
creds: RedditCredentials
|
||||
|
||||
Reference in New Issue
Block a user