-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add new Databutton and Research agents in databutton-mcp.py and `mc…
#454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,15 @@ | ||||||||||||
| from praisonaiagents import Agent, MCP | ||||||||||||
| import os | ||||||||||||
|
|
||||||||||||
| # Databutton API key | ||||||||||||
| databutton_api_key = os.getenv("DATABUTTON_API_KEY") | ||||||||||||
|
|
||||||||||||
| # Create databutton agent | ||||||||||||
| databutton_agent = Agent( | ||||||||||||
| instructions="""You are a helpful assistant that can interact with Databutton. | ||||||||||||
| Use the available tools when relevant to answer user questions.""", | ||||||||||||
| llm="gpt-4o-mini", | ||||||||||||
| tools=MCP("uvx databutton-app-mcp@latest", env={"DATABUTTON_API_KEY": databutton_api_key}) | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| databutton_agent.start("Get the current stock price for AAPL, Tesla, and Amazon") | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding a
Suggested change
|
||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| from praisonaiagents import Agent, MCP | ||
| import os | ||
|
|
||
| brave_api_key = os.getenv("BRAVE_API_KEY") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the Databutton agent, add error handling to check if the brave_api_key = os.getenv("BRAVE_API_KEY")
if not brave_api_key:
raise ValueError("BRAVE_API_KEY environment variable not set") |
||
|
|
||
| research_agent = Agent( | ||
| instructions="Research Agent", | ||
| llm="groq/meta-llama/llama-4-scout-17b-16e-instruct", | ||
| tools=MCP("npx -y @modelcontextprotocol/server-brave-search", env={"BRAVE_API_KEY": brave_api_key}) | ||
| ) | ||
|
|
||
| research_agent.start("What is the latest research on the topic of AI and its impact on society?") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding error handling to check if the
DATABUTTON_API_KEYenvironment variable is set. If it's not set, the agent will not function correctly. You could raise an exception or provide a default behavior.