Skip to content

Commit e3d4b78

Browse files
committed
Update to version 2.1.1
- Incremented version number to 2.1.1 in `pyproject.toml`, `praisonai.rb`, and `uv.lock` to reflect recent changes. - Updated dependency version for `praisonaiagents` to 0.0.71 in `pyproject.toml` and `uv.lock`. - Modified Dockerfile and deployment scripts to install the updated version of `praisonai`. - Added new documentation files for various MCP integrations, including Anthropic, Gemini, Groq, Mistral, Ollama, OpenAI, and XAI. - Introduced example scripts for each MCP integration to facilitate user understanding and implementation. - Enhanced the LLM class to process tool results based on the original user query for improved response accuracy.
1 parent 60ce8dd commit e3d4b78

File tree

24 files changed

+10651
-22
lines changed

24 files changed

+10651
-22
lines changed

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM python:3.11-slim
22
WORKDIR /app
33
COPY . .
4-
RUN pip install flask praisonai==2.1.0 gunicorn markdown
4+
RUN pip install flask praisonai==2.1.1 gunicorn markdown
55
EXPOSE 8080
66
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]

docs/api/praisonai/deploy.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ <h2 id="raises">Raises</h2>
110110
file.write(&#34;FROM python:3.11-slim\n&#34;)
111111
file.write(&#34;WORKDIR /app\n&#34;)
112112
file.write(&#34;COPY . .\n&#34;)
113-
file.write(&#34;RUN pip install flask praisonai==2.1.0 gunicorn markdown\n&#34;)
113+
file.write(&#34;RUN pip install flask praisonai==2.1.1 gunicorn markdown\n&#34;)
114114
file.write(&#34;EXPOSE 8080\n&#34;)
115115
file.write(&#39;CMD [&#34;gunicorn&#34;, &#34;-b&#34;, &#34;0.0.0.0:8080&#34;, &#34;api:app&#34;]\n&#39;)
116116

docs/mcp/anthropic.mdx

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
title: "Anthropic MCP Integration"
3+
sidebarTitle: "Anthropic"
4+
description: "Guide for integrating Anthropic's Claude models with PraisonAI agents using MCP"
5+
icon: "a"
6+
---
7+
8+
## Add Anthropic Tool to AI Agent
9+
10+
```mermaid
11+
flowchart LR
12+
In[In] --> Agent[AI Agent]
13+
Agent --> Tool[Airbnb MCP]
14+
Tool --> Agent
15+
Agent --> Out[Out]
16+
17+
style In fill:#8B0000,color:#fff
18+
style Agent fill:#2E8B57,color:#fff
19+
style Tool fill:#FF5A5F,color:#fff
20+
style Out fill:#8B0000,color:#fff
21+
```
22+
23+
## Quick Start
24+
25+
<Steps>
26+
<Step title="Set API Key">
27+
Set your Anthropic API key as an environment variable in your terminal:
28+
```zsh
29+
export ANTHROPIC_API_KEY=your_anthropic_api_key_here
30+
```
31+
</Step>
32+
33+
<Step title="Create a file">
34+
Create a new file `anthropic_airbnb.py` with the following code:
35+
```python
36+
from praisonaiagents import Agent, MCP
37+
import os
38+
39+
# Get API key from environment variable
40+
anthropic_api_key = os.environ.get("ANTHROPIC_API_KEY")
41+
42+
search_agent = Agent(
43+
instructions="""You help book apartments on Airbnb.""",
44+
llm="anthropic/claude-3-7-sonnet-20250219",
45+
tools=MCP(
46+
command="npx",
47+
args=["-y", "@openbnb/mcp-server-airbnb", "--ignore-robots-txt"],
48+
env={"ANTHROPIC_API_KEY": anthropic_api_key}
49+
)
50+
)
51+
52+
search_agent.start("MUST USE airbnb_search Tool to Search. Search for Apartments in Paris for 2 nights. 04/28 - 04/30 for 2 adults. All Your Preference")
53+
```
54+
</Step>
55+
56+
<Step title="Install Dependencies">
57+
Make sure you have Node.js installed, as the MCP server requires it:
58+
```bash
59+
pip install "praisonaiagents[llm]"
60+
```
61+
</Step>
62+
63+
<Step title="Run the Agent">
64+
Execute your script:
65+
```bash
66+
python anthropic_airbnb.py
67+
```
68+
</Step>
69+
</Steps>
70+
71+
<Note>
72+
**Requirements**
73+
- Python 3.10 or higher
74+
- Node.js installed on your system
75+
- Anthropic API key
76+
</Note>
77+
78+
## Features
79+
80+
<CardGroup cols={2}>
81+
<Card title="Claude 3.7 Sonnet" icon="brain">
82+
Leverage Anthropic's powerful Claude 3.7 Sonnet model.
83+
</Card>
84+
<Card title="MCP Integration" icon="plug">
85+
Seamless integration with Model Context Protocol.
86+
</Card>
87+
<Card title="Airbnb Search" icon="hotel">
88+
Search for accommodations on Airbnb with natural language queries.
89+
</Card>
90+
<Card title="Environment Variables" icon="key">
91+
Securely pass API keys using environment variables.
92+
</Card>
93+
</CardGroup>

docs/mcp/gemini.mdx

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
title: "Gemini MCP Integration"
3+
sidebarTitle: "Gemini"
4+
description: "Guide for integrating Google's Gemini models with PraisonAI agents using MCP"
5+
icon: "google"
6+
---
7+
8+
## Add Gemini Tool to AI Agent
9+
10+
```mermaid
11+
flowchart LR
12+
In[In] --> Agent[AI Agent]
13+
Agent --> Tool[Airbnb MCP]
14+
Tool --> Agent
15+
Agent --> Out[Out]
16+
17+
style In fill:#8B0000,color:#fff
18+
style Agent fill:#2E8B57,color:#fff
19+
style Tool fill:#FF5A5F,color:#fff
20+
style Out fill:#8B0000,color:#fff
21+
```
22+
23+
## Quick Start
24+
25+
<Steps>
26+
<Step title="Set API Key">
27+
Set your Google API key as an environment variable in your terminal:
28+
```zsh
29+
export GOOGLE_API_KEY=your_google_api_key_here
30+
```
31+
</Step>
32+
33+
<Step title="Create a file">
34+
Create a new file `gemini_airbnb.py` with the following code:
35+
```python
36+
from praisonaiagents import Agent, MCP
37+
import os
38+
39+
# Get API key from environment variable
40+
google_api_key = os.environ.get("GOOGLE_API_KEY")
41+
42+
search_agent = Agent(
43+
instructions="""You help book apartments on Airbnb.""",
44+
llm="gemini/gemini-2.5-pro-exp-03-25",
45+
tools=MCP(
46+
command="npx",
47+
args=["-y", "@openbnb/mcp-server-airbnb", "--ignore-robots-txt"],
48+
env={"GOOGLE_API_KEY": google_api_key}
49+
)
50+
)
51+
52+
search_agent.start("MUST USE airbnb_search Tool to Search. Search for Apartments in Paris for 2 nights. 04/28 - 04/30 for 2 adults. All Your Preference")
53+
```
54+
</Step>
55+
56+
<Step title="Install Dependencies">
57+
Make sure you have Node.js installed, as the MCP server requires it:
58+
```bash
59+
pip install "praisonaiagents[llm]"
60+
```
61+
</Step>
62+
63+
<Step title="Run the Agent">
64+
Execute your script:
65+
```bash
66+
python gemini_airbnb.py
67+
```
68+
</Step>
69+
</Steps>
70+
71+
<Note>
72+
**Requirements**
73+
- Python 3.10 or higher
74+
- Node.js installed on your system
75+
- Google API key for Gemini models
76+
</Note>
77+
78+
## Features
79+
80+
<CardGroup cols={2}>
81+
<Card title="Gemini 2.5 Pro" icon="brain">
82+
Leverage Google's advanced Gemini 2.5 Pro model.
83+
</Card>
84+
<Card title="MCP Integration" icon="plug">
85+
Seamless integration with Model Context Protocol.
86+
</Card>
87+
<Card title="Airbnb Search" icon="hotel">
88+
Search for accommodations on Airbnb with natural language queries.
89+
</Card>
90+
<Card title="Environment Variables" icon="key">
91+
Securely pass API keys using environment variables.
92+
</Card>
93+
</CardGroup>

docs/mcp/groq.mdx

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
title: "Groq MCP Integration"
3+
sidebarTitle: "Groq"
4+
description: "Guide for integrating Groq models with PraisonAI agents using MCP"
5+
icon: "bolt"
6+
---
7+
8+
## Add Groq Tool to AI Agent
9+
10+
```mermaid
11+
flowchart LR
12+
In[In] --> Agent[AI Agent]
13+
Agent --> Tool[Airbnb MCP]
14+
Tool --> Agent
15+
Agent --> Out[Out]
16+
17+
style In fill:#8B0000,color:#fff
18+
style Agent fill:#2E8B57,color:#fff
19+
style Tool fill:#FF5A5F,color:#fff
20+
style Out fill:#8B0000,color:#fff
21+
```
22+
23+
## Quick Start
24+
25+
<Steps>
26+
<Step title="Set API Key">
27+
Set your Groq API key as an environment variable in your terminal:
28+
```bash
29+
export GROQ_API_KEY=your_groq_api_key_here
30+
```
31+
</Step>
32+
33+
<Step title="Create a file">
34+
Create a new file `groq_airbnb.py` with the following code:
35+
```python
36+
from praisonaiagents import Agent, MCP
37+
38+
search_agent = Agent(
39+
instructions="""You help book apartments on Airbnb.""",
40+
llm="groq/llama-3.2-90b-vision-preview",
41+
tools=MCP("npx -y @openbnb/mcp-server-airbnb --ignore-robots-txt")
42+
)
43+
44+
search_agent.start("MUST USE airbnb_search Tool to Search. Search for Apartments in Paris for 2 nights. 04/28 - 04/30 for 2 adults. All Your Preference")
45+
```
46+
</Step>
47+
48+
<Step title="Install Dependencies">
49+
Make sure you have Node.js installed, as the MCP server requires it:
50+
```bash
51+
pip install "praisonaiagents[llm]"
52+
```
53+
</Step>
54+
55+
<Step title="Run the Agent">
56+
Execute your script:
57+
```bash
58+
python groq_airbnb.py
59+
```
60+
</Step>
61+
</Steps>
62+
63+
<Note>
64+
**Requirements**
65+
- Python 3.10 or higher
66+
- Node.js installed on your system
67+
- Groq API key
68+
</Note>
69+
70+
## Features
71+
72+
<CardGroup cols={2}>
73+
<Card title="Ultra-Fast Inference" icon="bolt">
74+
Utilize Groq's high-performance LPU inference for rapid responses.
75+
</Card>
76+
<Card title="MCP Integration" icon="plug">
77+
Seamless integration with Model Context Protocol.
78+
</Card>
79+
<Card title="Airbnb Search" icon="hotel">
80+
Search for accommodations on Airbnb with natural language queries.
81+
</Card>
82+
<Card title="Advanced Models" icon="brain">
83+
Access to Llama 3.2 90B and other powerful models.
84+
</Card>
85+
</CardGroup>

docs/mcp/mistral.mdx

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
title: "Mistral MCP Integration"
3+
sidebarTitle: "Mistral"
4+
description: "Guide for integrating Mistral models with PraisonAI agents using MCP"
5+
icon: "wind"
6+
---
7+
8+
## Add Mistral Tool to AI Agent
9+
10+
```mermaid
11+
flowchart LR
12+
In[In] --> Agent[AI Agent]
13+
Agent --> Tool[Airbnb MCP]
14+
Tool --> Agent
15+
Agent --> Out[Out]
16+
17+
style In fill:#8B0000,color:#fff
18+
style Agent fill:#2E8B57,color:#fff
19+
style Tool fill:#FF5A5F,color:#fff
20+
style Out fill:#8B0000,color:#fff
21+
```
22+
23+
## Quick Start
24+
25+
<Steps>
26+
<Step title="Set API Key">
27+
Set your Mistral API key as an environment variable in your terminal:
28+
```zsh
29+
export MISTRAL_API_KEY=your_mistral_api_key_here
30+
```
31+
</Step>
32+
33+
<Step title="Create a file">
34+
Create a new file `mistral_airbnb.py` with the following code:
35+
```python
36+
from praisonaiagents import Agent, MCP
37+
import os
38+
39+
# Get API key from environment variable
40+
mistral_api_key = os.environ.get("MISTRAL_API_KEY")
41+
42+
search_agent = Agent(
43+
instructions="""You help book apartments on Airbnb.""",
44+
llm="mistral/mistral-large-latest",
45+
tools=MCP(
46+
command="npx",
47+
args=["-y", "@openbnb/mcp-server-airbnb", "--ignore-robots-txt"],
48+
env={"MISTRAL_API_KEY": mistral_api_key}
49+
)
50+
)
51+
52+
search_agent.start("MUST USE airbnb_search Tool to Search. Search for Apartments in Paris for 2 nights. 04/28 - 04/30 for 2 adults. All Your Preference")
53+
```
54+
</Step>
55+
56+
<Step title="Install Dependencies">
57+
Make sure you have Node.js installed, as the MCP server requires it:
58+
```bash
59+
pip install "praisonaiagents[llm]"
60+
```
61+
</Step>
62+
63+
<Step title="Run the Agent">
64+
Execute your script:
65+
```bash
66+
python mistral_airbnb.py
67+
```
68+
</Step>
69+
</Steps>
70+
71+
<Note>
72+
**Requirements**
73+
- Python 3.10 or higher
74+
- Node.js installed on your system
75+
- Mistral API key
76+
</Note>
77+
78+
## Features
79+
80+
<CardGroup cols={2}>
81+
<Card title="Mistral Large" icon="brain">
82+
Leverage Mistral's powerful large language model.
83+
</Card>
84+
<Card title="MCP Integration" icon="plug">
85+
Seamless integration with Model Context Protocol.
86+
</Card>
87+
<Card title="Airbnb Search" icon="hotel">
88+
Search for accommodations on Airbnb with natural language queries.
89+
</Card>
90+
<Card title="Environment Variables" icon="key">
91+
Securely pass API keys using environment variables.
92+
</Card>
93+
</CardGroup>

0 commit comments

Comments
 (0)