-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
161fedd
commit d52b3fa
Showing
5 changed files
with
354 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# GitHub Issues Tool | ||
|
||
This tool integrates with GitHub's API to fetch issues from specified repositories. It provides a clean, structured way to retrieve open issues, making it ideal for monitoring and analysis purposes in AI applications and automation workflows. | ||
|
||
## Components | ||
|
||
The tool uses the following components: | ||
|
||
- A GitHub API client instance | ||
- Optional GitHub Personal Access Token for authentication | ||
- A custom HTTP client (ky) for making API requests | ||
- Input validation using Zod schema | ||
- Configurable issue limit parameter | ||
- Automatic pagination handling | ||
|
||
## Key Features | ||
|
||
- Fetches open issues from any public GitHub repository | ||
- Handles pagination automatically | ||
- Returns structured data with issue details | ||
- Includes metadata like issue numbers, titles, labels, and descriptions | ||
- Configurable limit for number of issues to fetch | ||
- Built-in error handling and validation | ||
- Support for both authenticated and unauthenticated requests | ||
|
||
## Authentication | ||
|
||
The tool supports two authentication modes: | ||
- Unauthenticated: Works with public repositories (60 requests/hour limit) | ||
- Authenticated: Uses GitHub Personal Access Token (5,000 requests/hour limit) | ||
|
||
## Input | ||
|
||
The input should be a JSON object with a "repoUrl" field containing the GitHub repository URL (e.g., https://github.com/owner/repo). | ||
|
||
## Output | ||
|
||
The output is a structured JSON object containing: | ||
- Repository information (name, URL, owner) | ||
- Metadata (total issues, last updated date, limit) | ||
- Array of issues with details (number, title, URL, labels, description) | ||
|
||
## Example | ||
|
||
```javascript | ||
// Basic usage | ||
const tool = new GithubIssues({ | ||
token: 'github_pat_...', // Optional: GitHub personal access token | ||
limit: 20 // Optional: number of issues to fetch (default: 10) | ||
}); | ||
|
||
const result = await tool._call({ | ||
repoUrl: 'https://github.com/owner/repo' | ||
}); | ||
``` | ||
|
||
## Advanced Example with Error Handling | ||
|
||
```javascript | ||
const tool = new GithubIssues({ | ||
token: process.env.GITHUB_TOKEN, | ||
limit: 50 | ||
}); | ||
|
||
try { | ||
const result = await tool._call({ | ||
repoUrl: 'https://github.com/facebook/react' | ||
}); | ||
|
||
// Access structured data | ||
console.log('Repository:', result.repository.name); | ||
console.log('Total Issues:', result.metadata.totalIssues); | ||
|
||
// Process issues | ||
result.issues.forEach(issue => { | ||
console.log(`#${issue.number}: ${issue.title}`); | ||
console.log(`Labels: ${issue.labels.join(', ')}`); | ||
console.log(`URL: ${issue.url}\n`); | ||
}); | ||
} catch (error) { | ||
console.error('Error fetching GitHub issues:', error); | ||
} | ||
``` | ||
|
||
### Rate Limits | ||
|
||
- Authenticated requests: 5,000 requests per hour | ||
- Unauthenticated requests: 60 requests per hour | ||
|
||
### Disclaimer | ||
|
||
Ensure you have proper API credentials if needed and respect GitHub's API rate limits and terms of service. For private repositories, authentication is required. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Serper Tool | ||
|
||
This tool integrates with Serper (https://serper.dev/), a Google Search API service that provides programmatic access to Google Search results. It enables various types of Google searches including web search, image search, news search, and more, making it ideal for AI applications that need real-time information from the web. | ||
|
||
## Components | ||
|
||
The tool uses the following components: | ||
|
||
- A Serper API client instance | ||
- An API Key for authentication | ||
- A custom HTTP client (ky) for making API requests | ||
- Input validation using Zod schema | ||
- Search type configuration | ||
- Optional search parameters | ||
|
||
## Search Types | ||
|
||
The tool supports multiple search types: | ||
- "search" (default): For general search queries | ||
- "images": For image search | ||
- "videos": For video search | ||
- "places": For location-based search | ||
- "maps": For map search | ||
- "news": For news search | ||
- "shopping": For shopping search | ||
- "scholar": For academic publications search | ||
- "patents": For patents search | ||
- "webpage": For scraping webpages (Beta) | ||
|
||
## Key Features | ||
|
||
- Multiple search types for different use cases | ||
- Clean, structured JSON responses | ||
- High-performance API with good uptime | ||
- Webpage scraping capability (Beta) | ||
- Customizable search parameters | ||
- Error handling and validation | ||
|
||
## Input | ||
|
||
The input depends on the search type: | ||
- For webpage scraping: A JSON object with a "url" field | ||
- For all other search types: A JSON object with a "query" field | ||
|
||
## Output | ||
|
||
The output is a structured JSON response from Serper containing search results based on the search type and query. | ||
|
||
## Example | ||
|
||
```javascript | ||
// Basic search | ||
const tool = new Serper({ | ||
apiKey: 'your-api-key', | ||
type: 'search' // Optional, defaults to 'search' | ||
}); | ||
|
||
const result = await tool._call({ | ||
query: 'latest AI developments' | ||
}); | ||
|
||
// Webpage scraping | ||
const webScraperTool = new Serper({ | ||
apiKey: 'your-api-key', | ||
type: 'webpage' | ||
}); | ||
|
||
const scrapingResult = await webScraperTool._call({ | ||
url: 'https://example.com' | ||
}); | ||
``` | ||
|
||
## Advanced Example with Custom Parameters | ||
|
||
```javascript | ||
const tool = new Serper({ | ||
apiKey: process.env.SERPER_API_KEY, | ||
type: 'news', | ||
params: { | ||
num: 10, // Number of results | ||
gl: 'us' // Geographic location | ||
} | ||
}); | ||
|
||
try { | ||
const result = await tool._call({ | ||
query: 'artificial intelligence breakthroughs' | ||
}); | ||
console.log(result); | ||
} catch (error) { | ||
console.error('Error processing Serper query:', error); | ||
} | ||
``` | ||
|
||
### Disclaimer | ||
|
||
Ensure you have proper API credentials and respect Serper's usage terms and rate limits. The webpage scraping feature is in Beta and may be subject to changes. |
Oops, something went wrong.