Documentation
¶
Overview ¶
Package reddit provides tools for Reddit via the official REST API.
Authentication: Reddit OAuth2 app (script or web type). Required env vars:
REDDIT_CLIENT_ID — app client ID REDDIT_CLIENT_SECRET — app client secret REDDIT_USERNAME — Reddit username (for script apps) REDDIT_PASSWORD — Reddit password (for script apps)
Tools planned (see GitHub issue):
reddit_search — search posts across Reddit or in a specific subreddit reddit_posts — list hot/new/top/rising posts from a subreddit reddit_post — fetch a single post with comments reddit_submit — submit a post or comment (requires auth) reddit_subreddit — fetch subreddit info and rules
Index ¶
- Constants
- Variables
- type PostsTool
- func (t *PostsTool) BackfillInput(_ context.Context, input map[string]any) map[string]any
- func (t *PostsTool) Call(_ context.Context, _ tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *PostsTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *PostsTool) Definition() tool.Definition
- func (t *PostsTool) Description(_ context.Context) (string, error)
- func (t *PostsTool) FormatResult(data any) string
- func (t *PostsTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *PostsTool) IsEnabled() bool
- func (t *PostsTool) IsReadOnly(_ map[string]any) bool
- func (t *PostsTool) ValidateInput(_ context.Context, input map[string]any) (map[string]any, error)
- type SearchTool
- func (t *SearchTool) BackfillInput(_ context.Context, input map[string]any) map[string]any
- func (t *SearchTool) Call(_ context.Context, _ tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *SearchTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *SearchTool) Definition() tool.Definition
- func (t *SearchTool) Description(_ context.Context) (string, error)
- func (t *SearchTool) FormatResult(data any) string
- func (t *SearchTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *SearchTool) IsEnabled() bool
- func (t *SearchTool) IsReadOnly(_ map[string]any) bool
- func (t *SearchTool) ValidateInput(_ context.Context, input map[string]any) (map[string]any, error)
Constants ¶
View Source
const ( SearchToolName = "reddit_search" SearchDisplayName = "Search Reddit" SearchDescription = `` /* 408-byte string literal not displayed */ )
View Source
const ( PostsToolName = "reddit_posts" PostsDisplayName = "Reddit Subreddit Posts" PostsDescription = `` /* 307-byte string literal not displayed */ )
Variables ¶
View Source
var ErrNotImplemented = errors.New("reddit tools: not implemented — see GitHub issue")
ErrNotImplemented is returned by all Reddit tools until the OAuth client and API integration are complete (see GitHub issue).
Functions ¶
This section is empty.
Types ¶
type PostsTool ¶
type PostsTool struct{}
func NewPostsTool ¶
func NewPostsTool() *PostsTool
func (*PostsTool) BackfillInput ¶
func (*PostsTool) Call ¶
func (t *PostsTool) Call(_ context.Context, _ tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
func (*PostsTool) CheckPermissions ¶
func (t *PostsTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*PostsTool) Definition ¶
func (t *PostsTool) Definition() tool.Definition
func (*PostsTool) FormatResult ¶
type SearchTool ¶
type SearchTool struct{}
func NewSearchTool ¶
func NewSearchTool() *SearchTool
func (*SearchTool) BackfillInput ¶
func (*SearchTool) Call ¶
func (t *SearchTool) Call(_ context.Context, _ tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
func (*SearchTool) CheckPermissions ¶
func (t *SearchTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult
func (*SearchTool) Definition ¶
func (t *SearchTool) Definition() tool.Definition
func (*SearchTool) Description ¶
func (t *SearchTool) Description(_ context.Context) (string, error)
func (*SearchTool) FormatResult ¶
func (t *SearchTool) FormatResult(data any) string
func (*SearchTool) IsConcurrencySafe ¶
func (t *SearchTool) IsConcurrencySafe(_ map[string]any) bool
func (*SearchTool) IsEnabled ¶
func (t *SearchTool) IsEnabled() bool
func (*SearchTool) IsReadOnly ¶
func (t *SearchTool) IsReadOnly(_ map[string]any) bool
func (*SearchTool) ValidateInput ¶
Click to show internal directories.
Click to hide internal directories.