Tools
Github
GithubTools enables an Agent to access Github repositories and perform tasks such as listing open pull requests, issues and more.
Prerequisites
The following examples requires the PyGithub
library and a Github access token which can be obtained from here.
pip install -U PyGithub
export GITHUB_ACCESS_TOKEN=***
Example
The following agent will search Google for the latest news about “Mistral AI”:
cookbook/tools/github_tools.py
from phi.agent import Agent
from phi.tools.github import GithubTools
agent = Agent(
instructions=[
"Use your tools to answer questions about the repo: phidatahq/phidata",
"Do not create any issues or pull requests unless explicitly asked to do so",
],
tools=[GithubTools()],
show_tool_calls=True,
)
agent.print_response("List open pull requests", markdown=True)
Toolkit Params
Parameter | Type | Default | Description |
---|---|---|---|
fixed_max_results | int | None | Optional fixed maximum number of results to return. |
fixed_language | str | None | Optional fixed language for the requests. |
headers | Any | None | Optional headers to include in the requests. |
proxy | str | None | Optional proxy to be used for the requests. |
timeout | int | None | Optional timeout for the requests, in seconds. |
Toolkit Functions
Function | Description |
---|---|
google_search | Searches Google for a specified query. Parameters include: - query : the search term- max_results : maximum number of results (default is 5)- language : language of the search results (default is “en”)Returns the search results as a JSON formatted string. |
Was this page helpful?