PraisonAI 2.2.99__tar.gz → 2.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {praisonai-2.2.99 → praisonai-2.3.2}/PKG-INFO +100 -13
- {praisonai-2.2.99 → praisonai-2.3.2}/PraisonAI.egg-info/PKG-INFO +100 -13
- {praisonai-2.2.99 → praisonai-2.3.2}/PraisonAI.egg-info/requires.txt +1 -1
- {praisonai-2.2.99 → praisonai-2.3.2}/README.md +98 -11
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/cli.py +142 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/deploy.py +1 -1
- praisonai-2.3.2/praisonai/version.py +1 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/pyproject.toml +1 -1
- {praisonai-2.2.99 → praisonai-2.3.2}/tests/test.py +5 -2
- praisonai-2.2.99/praisonai/version.py +0 -1
- {praisonai-2.2.99 → praisonai-2.3.2}/PraisonAI.egg-info/SOURCES.txt +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/PraisonAI.egg-info/dependency_links.txt +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/PraisonAI.egg-info/entry_points.txt +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/PraisonAI.egg-info/top_level.txt +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/__init__.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/__main__.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/agents_generator.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/api/call.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/auto.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/chainlit_ui.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/inbuilt_tools/__init__.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/inbuilt_tools/autogen_tools.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/inc/__init__.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/inc/config.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/inc/models.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/scheduler.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/setup/__init__.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/setup/build.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/setup/post_install.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/setup/setup_conda_env.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/setup.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/test.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/train.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/train_vision.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/ui/agents.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/ui/callbacks.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/ui/chat.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/ui/code.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/ui/colab.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/ui/colab_chainlit.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/ui/components/aicoder.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/ui/context.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/ui/database_config.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/ui/db.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/ui/realtime.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/ui/realtimeclient/__init__.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/ui/realtimeclient/tools.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/ui/sql_alchemy.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/praisonai/upload_vision.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/setup.cfg +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/tests/test_agents_playbook.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/tests/test_basic.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/tests/test_custom_tools_fix.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/tests/test_double_api_fix.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/tests/test_phase2_refactor.py +0 -0
- {praisonai-2.2.99 → praisonai-2.3.2}/tests/test_runner.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PraisonAI
|
|
3
|
-
Version: 2.2
|
|
3
|
+
Version: 2.3.2
|
|
4
4
|
Summary: PraisonAI is an AI Agents Framework with Self Reflection. PraisonAI application combines PraisonAI Agents, AutoGen, and CrewAI into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customisation, and efficient human-agent collaboration.
|
|
5
5
|
Author: Mervin Praison
|
|
6
6
|
License: MIT
|
|
@@ -11,7 +11,7 @@ Description-Content-Type: text/markdown
|
|
|
11
11
|
Requires-Dist: rich>=13.7
|
|
12
12
|
Requires-Dist: markdown>=3.5
|
|
13
13
|
Requires-Dist: pyparsing>=3.0.0
|
|
14
|
-
Requires-Dist: praisonaiagents>=0.0.
|
|
14
|
+
Requires-Dist: praisonaiagents>=0.0.175
|
|
15
15
|
Requires-Dist: python-dotenv>=0.19.0
|
|
16
16
|
Requires-Dist: instructor>=1.3.3
|
|
17
17
|
Requires-Dist: PyYAML>=6.0
|
|
@@ -152,6 +152,9 @@ PraisonAI is a production-ready Multi-AI Agents framework with self-reflection,
|
|
|
152
152
|
- 💯 100+ LLM Support
|
|
153
153
|
- 🔬 **Deep Research Agents** (OpenAI & Gemini)
|
|
154
154
|
- 🔄 **Query Rewriter Agent** (HyDE, Step-back, Multi-query)
|
|
155
|
+
- 🌐 **Native Web Search** (OpenAI, Gemini, Anthropic, xAI, Perplexity)
|
|
156
|
+
- 📥 **Web Fetch** (Retrieve full content from URLs - Anthropic)
|
|
157
|
+
- 💾 **Prompt Caching** (Reduce costs & latency - OpenAI, Anthropic, Bedrock, Deepseek)
|
|
155
158
|
|
|
156
159
|
## Using Python Code
|
|
157
160
|
|
|
@@ -815,6 +818,97 @@ agent = Agent(tools=["my_tool"]) # Works automatically!
|
|
|
815
818
|
```
|
|
816
819
|
|
|
817
820
|
|
|
821
|
+
## Prompt Expansion
|
|
822
|
+
|
|
823
|
+
Expand short prompts into detailed, actionable prompts:
|
|
824
|
+
|
|
825
|
+
### CLI Usage
|
|
826
|
+
|
|
827
|
+
```bash
|
|
828
|
+
# Expand a short prompt into detailed prompt
|
|
829
|
+
praisonai "write a movie script in 3 lines" --expand-prompt
|
|
830
|
+
|
|
831
|
+
# With verbose output
|
|
832
|
+
praisonai "blog about AI" --expand-prompt -v
|
|
833
|
+
|
|
834
|
+
# With tools for context gathering
|
|
835
|
+
praisonai "latest AI trends" --expand-prompt --expand-tools tools.py
|
|
836
|
+
|
|
837
|
+
# Combine with query rewrite
|
|
838
|
+
praisonai "AI news" --query-rewrite --expand-prompt
|
|
839
|
+
```
|
|
840
|
+
|
|
841
|
+
### Programmatic Usage
|
|
842
|
+
|
|
843
|
+
```python
|
|
844
|
+
from praisonaiagents import PromptExpanderAgent, ExpandStrategy
|
|
845
|
+
|
|
846
|
+
# Basic usage
|
|
847
|
+
agent = PromptExpanderAgent()
|
|
848
|
+
result = agent.expand("write a movie script in 3 lines")
|
|
849
|
+
print(result.expanded_prompt)
|
|
850
|
+
|
|
851
|
+
# With specific strategy
|
|
852
|
+
result = agent.expand("blog about AI", strategy=ExpandStrategy.DETAILED)
|
|
853
|
+
|
|
854
|
+
# Available strategies: BASIC, DETAILED, STRUCTURED, CREATIVE, AUTO
|
|
855
|
+
```
|
|
856
|
+
|
|
857
|
+
**Key Difference:**
|
|
858
|
+
- `--query-rewrite`: Optimizes queries for **search/retrieval** (RAG)
|
|
859
|
+
- `--expand-prompt`: Expands prompts for **detailed task execution**
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
## Web Search, Web Fetch & Prompt Caching
|
|
863
|
+
|
|
864
|
+
### CLI Usage
|
|
865
|
+
|
|
866
|
+
```bash
|
|
867
|
+
# Web Search - Get real-time information
|
|
868
|
+
praisonai "What are the latest AI news today?" --web-search --llm openai/gpt-4o-search-preview
|
|
869
|
+
|
|
870
|
+
# Web Fetch - Retrieve and analyze URL content (Anthropic only)
|
|
871
|
+
praisonai "Summarize https://docs.praison.ai" --web-fetch --llm anthropic/claude-sonnet-4-20250514
|
|
872
|
+
|
|
873
|
+
# Prompt Caching - Reduce costs for repeated prompts
|
|
874
|
+
praisonai "Analyze this document..." --prompt-caching --llm anthropic/claude-sonnet-4-20250514
|
|
875
|
+
```
|
|
876
|
+
|
|
877
|
+
### Programmatic Usage
|
|
878
|
+
|
|
879
|
+
```python
|
|
880
|
+
from praisonaiagents import Agent
|
|
881
|
+
|
|
882
|
+
# Web Search
|
|
883
|
+
agent = Agent(
|
|
884
|
+
instructions="You are a research assistant",
|
|
885
|
+
llm="openai/gpt-4o-search-preview",
|
|
886
|
+
web_search=True
|
|
887
|
+
)
|
|
888
|
+
|
|
889
|
+
# Web Fetch (Anthropic only)
|
|
890
|
+
agent = Agent(
|
|
891
|
+
instructions="You are a content analyzer",
|
|
892
|
+
llm="anthropic/claude-sonnet-4-20250514",
|
|
893
|
+
web_fetch=True
|
|
894
|
+
)
|
|
895
|
+
|
|
896
|
+
# Prompt Caching
|
|
897
|
+
agent = Agent(
|
|
898
|
+
instructions="You are an AI assistant..." * 50, # Long system prompt
|
|
899
|
+
llm="anthropic/claude-sonnet-4-20250514",
|
|
900
|
+
prompt_caching=True
|
|
901
|
+
)
|
|
902
|
+
```
|
|
903
|
+
|
|
904
|
+
**Supported Providers:**
|
|
905
|
+
| Feature | Providers |
|
|
906
|
+
|---------|-----------|
|
|
907
|
+
| Web Search | OpenAI, Gemini, Anthropic, xAI, Perplexity |
|
|
908
|
+
| Web Fetch | Anthropic |
|
|
909
|
+
| Prompt Caching | OpenAI (auto), Anthropic, Bedrock, Deepseek |
|
|
910
|
+
|
|
911
|
+
|
|
818
912
|
## Development:
|
|
819
913
|
|
|
820
914
|
Below is used for development only.
|
|
@@ -832,21 +926,14 @@ uv pip install -r pyproject.toml --extra code
|
|
|
832
926
|
uv pip install -r pyproject.toml --extra "crewai,autogen"
|
|
833
927
|
```
|
|
834
928
|
|
|
835
|
-
###
|
|
929
|
+
### Bump and Release
|
|
836
930
|
|
|
837
931
|
```bash
|
|
838
|
-
# From project root
|
|
839
|
-
python src/praisonai/scripts/
|
|
932
|
+
# From project root - bumps version and releases in one command
|
|
933
|
+
python src/praisonai/scripts/bump_and_release.py 2.2.99
|
|
840
934
|
|
|
841
935
|
# With praisonaiagents dependency
|
|
842
|
-
python src/praisonai/scripts/
|
|
843
|
-
```
|
|
844
|
-
|
|
845
|
-
### Release
|
|
846
|
-
|
|
847
|
-
```bash
|
|
848
|
-
# From project root (runs uv lock, build, git tag, gh release)
|
|
849
|
-
python src/praisonai/scripts/release.py
|
|
936
|
+
python src/praisonai/scripts/bump_and_release.py 2.2.99 --agents 0.0.169
|
|
850
937
|
|
|
851
938
|
# Then publish
|
|
852
939
|
cd src/praisonai && uv publish
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PraisonAI
|
|
3
|
-
Version: 2.2
|
|
3
|
+
Version: 2.3.2
|
|
4
4
|
Summary: PraisonAI is an AI Agents Framework with Self Reflection. PraisonAI application combines PraisonAI Agents, AutoGen, and CrewAI into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customisation, and efficient human-agent collaboration.
|
|
5
5
|
Author: Mervin Praison
|
|
6
6
|
License: MIT
|
|
@@ -11,7 +11,7 @@ Description-Content-Type: text/markdown
|
|
|
11
11
|
Requires-Dist: rich>=13.7
|
|
12
12
|
Requires-Dist: markdown>=3.5
|
|
13
13
|
Requires-Dist: pyparsing>=3.0.0
|
|
14
|
-
Requires-Dist: praisonaiagents>=0.0.
|
|
14
|
+
Requires-Dist: praisonaiagents>=0.0.175
|
|
15
15
|
Requires-Dist: python-dotenv>=0.19.0
|
|
16
16
|
Requires-Dist: instructor>=1.3.3
|
|
17
17
|
Requires-Dist: PyYAML>=6.0
|
|
@@ -152,6 +152,9 @@ PraisonAI is a production-ready Multi-AI Agents framework with self-reflection,
|
|
|
152
152
|
- 💯 100+ LLM Support
|
|
153
153
|
- 🔬 **Deep Research Agents** (OpenAI & Gemini)
|
|
154
154
|
- 🔄 **Query Rewriter Agent** (HyDE, Step-back, Multi-query)
|
|
155
|
+
- 🌐 **Native Web Search** (OpenAI, Gemini, Anthropic, xAI, Perplexity)
|
|
156
|
+
- 📥 **Web Fetch** (Retrieve full content from URLs - Anthropic)
|
|
157
|
+
- 💾 **Prompt Caching** (Reduce costs & latency - OpenAI, Anthropic, Bedrock, Deepseek)
|
|
155
158
|
|
|
156
159
|
## Using Python Code
|
|
157
160
|
|
|
@@ -815,6 +818,97 @@ agent = Agent(tools=["my_tool"]) # Works automatically!
|
|
|
815
818
|
```
|
|
816
819
|
|
|
817
820
|
|
|
821
|
+
## Prompt Expansion
|
|
822
|
+
|
|
823
|
+
Expand short prompts into detailed, actionable prompts:
|
|
824
|
+
|
|
825
|
+
### CLI Usage
|
|
826
|
+
|
|
827
|
+
```bash
|
|
828
|
+
# Expand a short prompt into detailed prompt
|
|
829
|
+
praisonai "write a movie script in 3 lines" --expand-prompt
|
|
830
|
+
|
|
831
|
+
# With verbose output
|
|
832
|
+
praisonai "blog about AI" --expand-prompt -v
|
|
833
|
+
|
|
834
|
+
# With tools for context gathering
|
|
835
|
+
praisonai "latest AI trends" --expand-prompt --expand-tools tools.py
|
|
836
|
+
|
|
837
|
+
# Combine with query rewrite
|
|
838
|
+
praisonai "AI news" --query-rewrite --expand-prompt
|
|
839
|
+
```
|
|
840
|
+
|
|
841
|
+
### Programmatic Usage
|
|
842
|
+
|
|
843
|
+
```python
|
|
844
|
+
from praisonaiagents import PromptExpanderAgent, ExpandStrategy
|
|
845
|
+
|
|
846
|
+
# Basic usage
|
|
847
|
+
agent = PromptExpanderAgent()
|
|
848
|
+
result = agent.expand("write a movie script in 3 lines")
|
|
849
|
+
print(result.expanded_prompt)
|
|
850
|
+
|
|
851
|
+
# With specific strategy
|
|
852
|
+
result = agent.expand("blog about AI", strategy=ExpandStrategy.DETAILED)
|
|
853
|
+
|
|
854
|
+
# Available strategies: BASIC, DETAILED, STRUCTURED, CREATIVE, AUTO
|
|
855
|
+
```
|
|
856
|
+
|
|
857
|
+
**Key Difference:**
|
|
858
|
+
- `--query-rewrite`: Optimizes queries for **search/retrieval** (RAG)
|
|
859
|
+
- `--expand-prompt`: Expands prompts for **detailed task execution**
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
## Web Search, Web Fetch & Prompt Caching
|
|
863
|
+
|
|
864
|
+
### CLI Usage
|
|
865
|
+
|
|
866
|
+
```bash
|
|
867
|
+
# Web Search - Get real-time information
|
|
868
|
+
praisonai "What are the latest AI news today?" --web-search --llm openai/gpt-4o-search-preview
|
|
869
|
+
|
|
870
|
+
# Web Fetch - Retrieve and analyze URL content (Anthropic only)
|
|
871
|
+
praisonai "Summarize https://docs.praison.ai" --web-fetch --llm anthropic/claude-sonnet-4-20250514
|
|
872
|
+
|
|
873
|
+
# Prompt Caching - Reduce costs for repeated prompts
|
|
874
|
+
praisonai "Analyze this document..." --prompt-caching --llm anthropic/claude-sonnet-4-20250514
|
|
875
|
+
```
|
|
876
|
+
|
|
877
|
+
### Programmatic Usage
|
|
878
|
+
|
|
879
|
+
```python
|
|
880
|
+
from praisonaiagents import Agent
|
|
881
|
+
|
|
882
|
+
# Web Search
|
|
883
|
+
agent = Agent(
|
|
884
|
+
instructions="You are a research assistant",
|
|
885
|
+
llm="openai/gpt-4o-search-preview",
|
|
886
|
+
web_search=True
|
|
887
|
+
)
|
|
888
|
+
|
|
889
|
+
# Web Fetch (Anthropic only)
|
|
890
|
+
agent = Agent(
|
|
891
|
+
instructions="You are a content analyzer",
|
|
892
|
+
llm="anthropic/claude-sonnet-4-20250514",
|
|
893
|
+
web_fetch=True
|
|
894
|
+
)
|
|
895
|
+
|
|
896
|
+
# Prompt Caching
|
|
897
|
+
agent = Agent(
|
|
898
|
+
instructions="You are an AI assistant..." * 50, # Long system prompt
|
|
899
|
+
llm="anthropic/claude-sonnet-4-20250514",
|
|
900
|
+
prompt_caching=True
|
|
901
|
+
)
|
|
902
|
+
```
|
|
903
|
+
|
|
904
|
+
**Supported Providers:**
|
|
905
|
+
| Feature | Providers |
|
|
906
|
+
|---------|-----------|
|
|
907
|
+
| Web Search | OpenAI, Gemini, Anthropic, xAI, Perplexity |
|
|
908
|
+
| Web Fetch | Anthropic |
|
|
909
|
+
| Prompt Caching | OpenAI (auto), Anthropic, Bedrock, Deepseek |
|
|
910
|
+
|
|
911
|
+
|
|
818
912
|
## Development:
|
|
819
913
|
|
|
820
914
|
Below is used for development only.
|
|
@@ -832,21 +926,14 @@ uv pip install -r pyproject.toml --extra code
|
|
|
832
926
|
uv pip install -r pyproject.toml --extra "crewai,autogen"
|
|
833
927
|
```
|
|
834
928
|
|
|
835
|
-
###
|
|
929
|
+
### Bump and Release
|
|
836
930
|
|
|
837
931
|
```bash
|
|
838
|
-
# From project root
|
|
839
|
-
python src/praisonai/scripts/
|
|
932
|
+
# From project root - bumps version and releases in one command
|
|
933
|
+
python src/praisonai/scripts/bump_and_release.py 2.2.99
|
|
840
934
|
|
|
841
935
|
# With praisonaiagents dependency
|
|
842
|
-
python src/praisonai/scripts/
|
|
843
|
-
```
|
|
844
|
-
|
|
845
|
-
### Release
|
|
846
|
-
|
|
847
|
-
```bash
|
|
848
|
-
# From project root (runs uv lock, build, git tag, gh release)
|
|
849
|
-
python src/praisonai/scripts/release.py
|
|
936
|
+
python src/praisonai/scripts/bump_and_release.py 2.2.99 --agents 0.0.169
|
|
850
937
|
|
|
851
938
|
# Then publish
|
|
852
939
|
cd src/praisonai && uv publish
|
|
@@ -55,6 +55,9 @@ PraisonAI is a production-ready Multi-AI Agents framework with self-reflection,
|
|
|
55
55
|
- 💯 100+ LLM Support
|
|
56
56
|
- 🔬 **Deep Research Agents** (OpenAI & Gemini)
|
|
57
57
|
- 🔄 **Query Rewriter Agent** (HyDE, Step-back, Multi-query)
|
|
58
|
+
- 🌐 **Native Web Search** (OpenAI, Gemini, Anthropic, xAI, Perplexity)
|
|
59
|
+
- 📥 **Web Fetch** (Retrieve full content from URLs - Anthropic)
|
|
60
|
+
- 💾 **Prompt Caching** (Reduce costs & latency - OpenAI, Anthropic, Bedrock, Deepseek)
|
|
58
61
|
|
|
59
62
|
## Using Python Code
|
|
60
63
|
|
|
@@ -718,6 +721,97 @@ agent = Agent(tools=["my_tool"]) # Works automatically!
|
|
|
718
721
|
```
|
|
719
722
|
|
|
720
723
|
|
|
724
|
+
## Prompt Expansion
|
|
725
|
+
|
|
726
|
+
Expand short prompts into detailed, actionable prompts:
|
|
727
|
+
|
|
728
|
+
### CLI Usage
|
|
729
|
+
|
|
730
|
+
```bash
|
|
731
|
+
# Expand a short prompt into detailed prompt
|
|
732
|
+
praisonai "write a movie script in 3 lines" --expand-prompt
|
|
733
|
+
|
|
734
|
+
# With verbose output
|
|
735
|
+
praisonai "blog about AI" --expand-prompt -v
|
|
736
|
+
|
|
737
|
+
# With tools for context gathering
|
|
738
|
+
praisonai "latest AI trends" --expand-prompt --expand-tools tools.py
|
|
739
|
+
|
|
740
|
+
# Combine with query rewrite
|
|
741
|
+
praisonai "AI news" --query-rewrite --expand-prompt
|
|
742
|
+
```
|
|
743
|
+
|
|
744
|
+
### Programmatic Usage
|
|
745
|
+
|
|
746
|
+
```python
|
|
747
|
+
from praisonaiagents import PromptExpanderAgent, ExpandStrategy
|
|
748
|
+
|
|
749
|
+
# Basic usage
|
|
750
|
+
agent = PromptExpanderAgent()
|
|
751
|
+
result = agent.expand("write a movie script in 3 lines")
|
|
752
|
+
print(result.expanded_prompt)
|
|
753
|
+
|
|
754
|
+
# With specific strategy
|
|
755
|
+
result = agent.expand("blog about AI", strategy=ExpandStrategy.DETAILED)
|
|
756
|
+
|
|
757
|
+
# Available strategies: BASIC, DETAILED, STRUCTURED, CREATIVE, AUTO
|
|
758
|
+
```
|
|
759
|
+
|
|
760
|
+
**Key Difference:**
|
|
761
|
+
- `--query-rewrite`: Optimizes queries for **search/retrieval** (RAG)
|
|
762
|
+
- `--expand-prompt`: Expands prompts for **detailed task execution**
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
## Web Search, Web Fetch & Prompt Caching
|
|
766
|
+
|
|
767
|
+
### CLI Usage
|
|
768
|
+
|
|
769
|
+
```bash
|
|
770
|
+
# Web Search - Get real-time information
|
|
771
|
+
praisonai "What are the latest AI news today?" --web-search --llm openai/gpt-4o-search-preview
|
|
772
|
+
|
|
773
|
+
# Web Fetch - Retrieve and analyze URL content (Anthropic only)
|
|
774
|
+
praisonai "Summarize https://docs.praison.ai" --web-fetch --llm anthropic/claude-sonnet-4-20250514
|
|
775
|
+
|
|
776
|
+
# Prompt Caching - Reduce costs for repeated prompts
|
|
777
|
+
praisonai "Analyze this document..." --prompt-caching --llm anthropic/claude-sonnet-4-20250514
|
|
778
|
+
```
|
|
779
|
+
|
|
780
|
+
### Programmatic Usage
|
|
781
|
+
|
|
782
|
+
```python
|
|
783
|
+
from praisonaiagents import Agent
|
|
784
|
+
|
|
785
|
+
# Web Search
|
|
786
|
+
agent = Agent(
|
|
787
|
+
instructions="You are a research assistant",
|
|
788
|
+
llm="openai/gpt-4o-search-preview",
|
|
789
|
+
web_search=True
|
|
790
|
+
)
|
|
791
|
+
|
|
792
|
+
# Web Fetch (Anthropic only)
|
|
793
|
+
agent = Agent(
|
|
794
|
+
instructions="You are a content analyzer",
|
|
795
|
+
llm="anthropic/claude-sonnet-4-20250514",
|
|
796
|
+
web_fetch=True
|
|
797
|
+
)
|
|
798
|
+
|
|
799
|
+
# Prompt Caching
|
|
800
|
+
agent = Agent(
|
|
801
|
+
instructions="You are an AI assistant..." * 50, # Long system prompt
|
|
802
|
+
llm="anthropic/claude-sonnet-4-20250514",
|
|
803
|
+
prompt_caching=True
|
|
804
|
+
)
|
|
805
|
+
```
|
|
806
|
+
|
|
807
|
+
**Supported Providers:**
|
|
808
|
+
| Feature | Providers |
|
|
809
|
+
|---------|-----------|
|
|
810
|
+
| Web Search | OpenAI, Gemini, Anthropic, xAI, Perplexity |
|
|
811
|
+
| Web Fetch | Anthropic |
|
|
812
|
+
| Prompt Caching | OpenAI (auto), Anthropic, Bedrock, Deepseek |
|
|
813
|
+
|
|
814
|
+
|
|
721
815
|
## Development:
|
|
722
816
|
|
|
723
817
|
Below is used for development only.
|
|
@@ -735,21 +829,14 @@ uv pip install -r pyproject.toml --extra code
|
|
|
735
829
|
uv pip install -r pyproject.toml --extra "crewai,autogen"
|
|
736
830
|
```
|
|
737
831
|
|
|
738
|
-
###
|
|
832
|
+
### Bump and Release
|
|
739
833
|
|
|
740
834
|
```bash
|
|
741
|
-
# From project root
|
|
742
|
-
python src/praisonai/scripts/
|
|
835
|
+
# From project root - bumps version and releases in one command
|
|
836
|
+
python src/praisonai/scripts/bump_and_release.py 2.2.99
|
|
743
837
|
|
|
744
838
|
# With praisonaiagents dependency
|
|
745
|
-
python src/praisonai/scripts/
|
|
746
|
-
```
|
|
747
|
-
|
|
748
|
-
### Release
|
|
749
|
-
|
|
750
|
-
```bash
|
|
751
|
-
# From project root (runs uv lock, build, git tag, gh release)
|
|
752
|
-
python src/praisonai/scripts/release.py
|
|
839
|
+
python src/praisonai/scripts/bump_and_release.py 2.2.99 --agents 0.0.169
|
|
753
840
|
|
|
754
841
|
# Then publish
|
|
755
842
|
cd src/praisonai && uv publish
|
|
@@ -579,9 +579,14 @@ class PraisonAI:
|
|
|
579
579
|
parser.add_argument("--research", action="store_true", help="Run deep research on a topic")
|
|
580
580
|
parser.add_argument("--query-rewrite", action="store_true", help="Rewrite query for better results (works with any command)")
|
|
581
581
|
parser.add_argument("--rewrite-tools", type=str, help="Tools for query rewriter (e.g., 'internet_search' or path to tools.py)")
|
|
582
|
+
parser.add_argument("--expand-prompt", action="store_true", help="Expand short prompt into detailed prompt (works with any command)")
|
|
583
|
+
parser.add_argument("--expand-tools", type=str, help="Tools for prompt expander (e.g., 'internet_search' or path to tools.py)")
|
|
582
584
|
parser.add_argument("--tools", "-t", type=str, help="Path to tools.py file for research agent")
|
|
583
585
|
parser.add_argument("--save", "-s", action="store_true", help="Save research output to file (output/research/)")
|
|
584
586
|
parser.add_argument("--verbose", "-v", action="store_true", help="Enable verbose output for research")
|
|
587
|
+
parser.add_argument("--web-search", action="store_true", help="Enable native web search (OpenAI, Gemini, Anthropic, xAI, Perplexity)")
|
|
588
|
+
parser.add_argument("--web-fetch", action="store_true", help="Enable web fetch to retrieve URL content (Anthropic only)")
|
|
589
|
+
parser.add_argument("--prompt-caching", action="store_true", help="Enable prompt caching to reduce costs (OpenAI, Anthropic, Bedrock, Deepseek)")
|
|
585
590
|
|
|
586
591
|
# If we're in a test environment, parse with empty args to avoid pytest interference
|
|
587
592
|
if in_test_env:
|
|
@@ -839,12 +844,135 @@ class PraisonAI:
|
|
|
839
844
|
verbose = getattr(self.args, 'verbose', False)
|
|
840
845
|
return self._rewrite_query(query, rewrite_tools, verbose)
|
|
841
846
|
|
|
847
|
+
def _expand_prompt(self, prompt: str, expand_tools: str = None, verbose: bool = False) -> str:
|
|
848
|
+
"""
|
|
849
|
+
Expand prompt using PromptExpanderAgent.
|
|
850
|
+
|
|
851
|
+
Args:
|
|
852
|
+
prompt: The prompt to expand
|
|
853
|
+
expand_tools: Tool names (comma-separated) or path to tools.py
|
|
854
|
+
verbose: Enable verbose output
|
|
855
|
+
|
|
856
|
+
Returns:
|
|
857
|
+
Expanded prompt or original if expansion fails
|
|
858
|
+
"""
|
|
859
|
+
try:
|
|
860
|
+
from praisonaiagents import PromptExpanderAgent, ExpandStrategy
|
|
861
|
+
from rich import print
|
|
862
|
+
|
|
863
|
+
print("[bold cyan]Expanding prompt for detailed execution...[/bold cyan]")
|
|
864
|
+
|
|
865
|
+
# Load expand tools if specified
|
|
866
|
+
expand_tools_list = []
|
|
867
|
+
if expand_tools:
|
|
868
|
+
if os.path.isfile(expand_tools):
|
|
869
|
+
# Load from file
|
|
870
|
+
try:
|
|
871
|
+
import inspect
|
|
872
|
+
import importlib.util
|
|
873
|
+
spec = importlib.util.spec_from_file_location("expand_tools_module", expand_tools)
|
|
874
|
+
if spec and spec.loader:
|
|
875
|
+
module = importlib.util.module_from_spec(spec)
|
|
876
|
+
spec.loader.exec_module(module)
|
|
877
|
+
for name, obj in inspect.getmembers(module):
|
|
878
|
+
if inspect.isfunction(obj) and not name.startswith('_'):
|
|
879
|
+
expand_tools_list.append(obj)
|
|
880
|
+
if expand_tools_list:
|
|
881
|
+
print(f"[cyan]Loaded {len(expand_tools_list)} tools for prompt expander[/cyan]")
|
|
882
|
+
except Exception as e:
|
|
883
|
+
print(f"[yellow]Warning: Failed to load expand tools: {e}[/yellow]")
|
|
884
|
+
else:
|
|
885
|
+
# Treat as comma-separated tool names
|
|
886
|
+
try:
|
|
887
|
+
from praisonaiagents.tools import TOOL_MAPPINGS
|
|
888
|
+
import praisonaiagents.tools as tools_module
|
|
889
|
+
|
|
890
|
+
tool_names = [t.strip() for t in expand_tools.split(',')]
|
|
891
|
+
for tool_name in tool_names:
|
|
892
|
+
if tool_name in TOOL_MAPPINGS:
|
|
893
|
+
try:
|
|
894
|
+
tool = getattr(tools_module, tool_name)
|
|
895
|
+
expand_tools_list.append(tool)
|
|
896
|
+
except Exception as e:
|
|
897
|
+
print(f"[yellow]Warning: Failed to load expand tool '{tool_name}': {e}[/yellow]")
|
|
898
|
+
else:
|
|
899
|
+
print(f"[yellow]Warning: Unknown expand tool '{tool_name}'[/yellow]")
|
|
900
|
+
if expand_tools_list:
|
|
901
|
+
print(f"[cyan]Using expand tools: {', '.join(tool_names)}[/cyan]")
|
|
902
|
+
except ImportError:
|
|
903
|
+
print("[yellow]Warning: Could not import tools module[/yellow]")
|
|
904
|
+
|
|
905
|
+
expander = PromptExpanderAgent(
|
|
906
|
+
model="gpt-4o-mini",
|
|
907
|
+
verbose=verbose,
|
|
908
|
+
tools=expand_tools_list if expand_tools_list else None
|
|
909
|
+
)
|
|
910
|
+
result = expander.expand(prompt, strategy=ExpandStrategy.AUTO)
|
|
911
|
+
expanded = result.expanded_prompt
|
|
912
|
+
|
|
913
|
+
print(f"[cyan]Original:[/cyan] {prompt}")
|
|
914
|
+
print(f"[cyan]Expanded:[/cyan] {expanded}")
|
|
915
|
+
|
|
916
|
+
return expanded
|
|
917
|
+
|
|
918
|
+
except ImportError:
|
|
919
|
+
from rich import print
|
|
920
|
+
print("[yellow]Warning: PromptExpanderAgent not available, using original prompt[/yellow]")
|
|
921
|
+
return prompt
|
|
922
|
+
except Exception as e:
|
|
923
|
+
from rich import print
|
|
924
|
+
print(f"[yellow]Warning: Prompt expansion failed ({e}), using original prompt[/yellow]")
|
|
925
|
+
return prompt
|
|
926
|
+
|
|
927
|
+
def _expand_prompt_if_enabled(self, prompt: str) -> str:
|
|
928
|
+
"""
|
|
929
|
+
Expand prompt using PromptExpanderAgent if --expand-prompt is enabled.
|
|
930
|
+
Returns the expanded prompt or original if expansion is disabled/fails.
|
|
931
|
+
"""
|
|
932
|
+
if not hasattr(self, 'args') or not getattr(self.args, 'expand_prompt', False):
|
|
933
|
+
return prompt
|
|
934
|
+
|
|
935
|
+
expand_tools = getattr(self.args, 'expand_tools', None)
|
|
936
|
+
verbose = getattr(self.args, 'verbose', False)
|
|
937
|
+
return self._expand_prompt(prompt, expand_tools, verbose)
|
|
938
|
+
|
|
939
|
+
def _save_output(self, prompt: str, result: str):
|
|
940
|
+
"""
|
|
941
|
+
Save output to output/prompts/ folder.
|
|
942
|
+
|
|
943
|
+
Args:
|
|
944
|
+
prompt: The original prompt
|
|
945
|
+
result: The output result to save
|
|
946
|
+
"""
|
|
947
|
+
from datetime import datetime
|
|
948
|
+
from rich import print
|
|
949
|
+
|
|
950
|
+
# Create output directory
|
|
951
|
+
output_dir = os.path.join(os.getcwd(), "output", "prompts")
|
|
952
|
+
os.makedirs(output_dir, exist_ok=True)
|
|
953
|
+
|
|
954
|
+
# Generate filename with timestamp
|
|
955
|
+
timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
|
956
|
+
# Create a safe filename from prompt (first 30 chars)
|
|
957
|
+
safe_prompt = "".join(c if c.isalnum() or c in " -_" else "" for c in prompt[:30]).strip().replace(" ", "_")
|
|
958
|
+
filename = f"{timestamp}_{safe_prompt}.md"
|
|
959
|
+
filepath = os.path.join(output_dir, filename)
|
|
960
|
+
|
|
961
|
+
# Write output
|
|
962
|
+
with open(filepath, "w", encoding="utf-8") as f:
|
|
963
|
+
f.write(f"# Prompt\n\n{prompt}\n\n")
|
|
964
|
+
f.write(f"# Output\n\n{result}\n")
|
|
965
|
+
|
|
966
|
+
print(f"[green]✅ Output saved to: {filepath}[/green]")
|
|
967
|
+
|
|
842
968
|
def handle_direct_prompt(self, prompt):
|
|
843
969
|
"""
|
|
844
970
|
Handle direct prompt by creating a single agent and running it.
|
|
845
971
|
"""
|
|
846
972
|
# Apply query rewriting if enabled
|
|
847
973
|
prompt = self._rewrite_query_if_enabled(prompt)
|
|
974
|
+
# Apply prompt expansion if enabled
|
|
975
|
+
prompt = self._expand_prompt_if_enabled(prompt)
|
|
848
976
|
|
|
849
977
|
if PRAISONAI_AVAILABLE:
|
|
850
978
|
agent_config = {
|
|
@@ -858,8 +986,22 @@ class PraisonAI:
|
|
|
858
986
|
if hasattr(self, 'args') and self.args.llm:
|
|
859
987
|
agent_config["llm"] = self.args.llm
|
|
860
988
|
|
|
989
|
+
# Add feature flags if enabled
|
|
990
|
+
if hasattr(self, 'args'):
|
|
991
|
+
if getattr(self.args, 'web_search', False):
|
|
992
|
+
agent_config["web_search"] = True
|
|
993
|
+
if getattr(self.args, 'web_fetch', False):
|
|
994
|
+
agent_config["web_fetch"] = True
|
|
995
|
+
if getattr(self.args, 'prompt_caching', False):
|
|
996
|
+
agent_config["prompt_caching"] = True
|
|
997
|
+
|
|
861
998
|
agent = PraisonAgent(**agent_config)
|
|
862
999
|
result = agent.start(prompt)
|
|
1000
|
+
|
|
1001
|
+
# Save output if --save is enabled
|
|
1002
|
+
if hasattr(self, 'args') and getattr(self.args, 'save', False):
|
|
1003
|
+
self._save_output(prompt, result)
|
|
1004
|
+
|
|
863
1005
|
return result
|
|
864
1006
|
elif CREWAI_AVAILABLE:
|
|
865
1007
|
from crewai import Agent, Task, Crew
|
|
@@ -57,7 +57,7 @@ class CloudDeployer:
|
|
|
57
57
|
file.write("FROM python:3.11-slim\n")
|
|
58
58
|
file.write("WORKDIR /app\n")
|
|
59
59
|
file.write("COPY . .\n")
|
|
60
|
-
file.write("RUN pip install flask praisonai==2.2
|
|
60
|
+
file.write("RUN pip install flask praisonai==2.3.2 gunicorn markdown\n")
|
|
61
61
|
file.write("EXPOSE 8080\n")
|
|
62
62
|
file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
|
|
63
63
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.3.2"
|
|
@@ -59,8 +59,11 @@ class TestPraisonAICommandLine(unittest.TestCase):
|
|
|
59
59
|
# In CI, it should be set by the workflow
|
|
60
60
|
print("Warning: OPENAI_API_KEY not found in CLI test environment. API calls might fail if not mocked.")
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
try:
|
|
63
|
+
result = subprocess.run(command, shell=True, capture_output=True, text=True, env=env, timeout=120)
|
|
64
|
+
return result.stdout + result.stderr
|
|
65
|
+
except subprocess.TimeoutExpired:
|
|
66
|
+
return "TIMEOUT: Command exceeded 120 seconds"
|
|
64
67
|
|
|
65
68
|
@pytest.mark.real
|
|
66
69
|
def test_praisonai_command(self):
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.2.99"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|