mirror of
https://github.com/MervinPraison/PraisonAI.git
synced 2026-11-08 01:08:39 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c14fb2ee5d | ||
|
|
31c9a6a994 | ||
|
|
b5b4370cc8 | ||
|
|
745f82b9c4 | ||
|
|
6845c7b0f6 | ||
|
|
e7be52722e | ||
|
|
e673189454 | ||
|
|
ab9192c57e | ||
|
|
819874275f | ||
|
|
0a36fdb966 |
No files matched your search
@@ -28,7 +28,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.9, 3.10, 3.11]
|
||||
python-version: ["3.10", "3.11"]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -66,13 +66,13 @@ jobs:
|
||||
|
||||
case $TEST_TYPE in
|
||||
"unit")
|
||||
python tests/test_runner.py --unit
|
||||
python tests/test_runner.py --pattern unit
|
||||
;;
|
||||
"integration")
|
||||
python tests/test_runner.py --integration
|
||||
python tests/test_runner.py --pattern integration
|
||||
;;
|
||||
"fast")
|
||||
python tests/test_runner.py --fast
|
||||
python tests/test_runner.py --pattern fast
|
||||
;;
|
||||
"performance")
|
||||
python tests/test_runner.py --pattern "performance"
|
||||
@@ -87,7 +87,7 @@ jobs:
|
||||
python tests/test_runner.py --pattern crewai
|
||||
;;
|
||||
"all"|*)
|
||||
python tests/test_runner.py --all
|
||||
python tests/test_runner.py --pattern all
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -159,7 +159,6 @@ jobs:
|
||||
echo "# 🎯 Test Matrix Summary" > matrix_summary.md
|
||||
echo "" >> matrix_summary.md
|
||||
echo "## Python Version Results:" >> matrix_summary.md
|
||||
echo "- Python 3.9: ${{ needs.comprehensive-test.result }}" >> matrix_summary.md
|
||||
echo "- Python 3.10: ${{ needs.comprehensive-test.result }}" >> matrix_summary.md
|
||||
echo "- Python 3.11: ${{ needs.comprehensive-test.result }}" >> matrix_summary.md
|
||||
echo "" >> matrix_summary.md
|
||||
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.9, 3.11]
|
||||
python-version: [3.11]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
||||
@@ -33,6 +33,13 @@ jobs:
|
||||
uv pip install --system ."[ui,gradio,api,agentops,google,openai,anthropic,cohere,chat,code,realtime,call,crewai,autogen]"
|
||||
uv pip install --system duckduckgo_search
|
||||
|
||||
- name: Set environment variables
|
||||
run: |
|
||||
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV
|
||||
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE }}" >> $GITHUB_ENV
|
||||
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME }}" >> $GITHUB_ENV
|
||||
echo "PYTHONPATH=${{ github.workspace }}/src/praisonai-agents:$PYTHONPATH" >> $GITHUB_ENV
|
||||
|
||||
- name: Test Key Example Scripts
|
||||
run: |
|
||||
echo "🧪 Testing key example scripts from praisonai-agents..."
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.9, 3.11]
|
||||
python-version: [3.11]
|
||||
framework: [autogen, crewai]
|
||||
|
||||
steps:
|
||||
@@ -120,11 +120,9 @@ jobs:
|
||||
echo "## Test Results by Framework and Python Version:" >> framework_summary.md
|
||||
echo "" >> framework_summary.md
|
||||
echo "### AutoGen Framework:" >> framework_summary.md
|
||||
echo "- Python 3.9: ${{ needs.framework-tests.result }}" >> framework_summary.md
|
||||
echo "- Python 3.11: ${{ needs.framework-tests.result }}" >> framework_summary.md
|
||||
echo "" >> framework_summary.md
|
||||
echo "### CrewAI Framework:" >> framework_summary.md
|
||||
echo "- Python 3.9: ${{ needs.framework-tests.result }}" >> framework_summary.md
|
||||
echo "- Python 3.11: ${{ needs.framework-tests.result }}" >> framework_summary.md
|
||||
echo "" >> framework_summary.md
|
||||
echo "## Overall Status:" >> framework_summary.md
|
||||
|
||||
@@ -28,15 +28,15 @@ jobs:
|
||||
|
||||
- name: Set environment variables
|
||||
run: |
|
||||
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV
|
||||
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE }}" >> $GITHUB_ENV
|
||||
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME }}" >> $GITHUB_ENV
|
||||
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}" >> $GITHUB_ENV
|
||||
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}" >> $GITHUB_ENV
|
||||
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-4o-mini' }}" >> $GITHUB_ENV
|
||||
echo "PYTHONPATH=${{ github.workspace }}/src/praisonai-agents:$PYTHONPATH" >> $GITHUB_ENV
|
||||
|
||||
- name: Run Fast Tests
|
||||
run: |
|
||||
# Run the fastest, most essential tests
|
||||
python tests/test_runner.py --fast
|
||||
python tests/test_runner.py --pattern fast
|
||||
|
||||
- name: Run Legacy Example Tests
|
||||
run: |
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
FROM python:3.11-slim
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN pip install flask praisonai==2.2.3 gunicorn markdown
|
||||
RUN pip install flask praisonai==2.2.6 gunicorn markdown
|
||||
EXPOSE 8080
|
||||
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]
|
||||
@@ -13,7 +13,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
RUN pip install --no-cache-dir \
|
||||
praisonaiagents>=0.0.4 \
|
||||
praisonai_tools \
|
||||
"praisonai==2.2.3" \
|
||||
"praisonai==2.2.6" \
|
||||
"praisonai[chat]" \
|
||||
"embedchain[github,youtube]"
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
RUN pip install --no-cache-dir \
|
||||
praisonaiagents>=0.0.4 \
|
||||
praisonai_tools \
|
||||
"praisonai==2.2.3" \
|
||||
"praisonai==2.2.6" \
|
||||
"praisonai[ui]" \
|
||||
"praisonai[chat]" \
|
||||
"praisonai[realtime]" \
|
||||
|
||||
@@ -13,7 +13,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
RUN pip install --no-cache-dir \
|
||||
praisonaiagents>=0.0.4 \
|
||||
praisonai_tools \
|
||||
"praisonai==2.2.3" \
|
||||
"praisonai==2.2.6" \
|
||||
"praisonai[ui]" \
|
||||
"praisonai[crewai]"
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ Loads environment variables from .env file or system and sets them.</p>
|
||||
file.write("FROM python:3.11-slim\n")
|
||||
file.write("WORKDIR /app\n")
|
||||
file.write("COPY . .\n")
|
||||
file.write("RUN pip install flask praisonai==2.2.3 gunicorn markdown\n")
|
||||
file.write("RUN pip install flask praisonai==2.2.6 gunicorn markdown\n")
|
||||
file.write("EXPOSE 8080\n")
|
||||
file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN pip install flask praisonai==2.2.3 watchdog
|
||||
RUN pip install flask praisonai==2.2.6 watchdog
|
||||
|
||||
EXPOSE 5555
|
||||
|
||||
|
||||
+1
-1
@@ -155,7 +155,7 @@ To facilitate local development with live reload, you can use Docker. Follow the
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN pip install flask praisonai==2.2.3 watchdog
|
||||
RUN pip install flask praisonai==2.2.6 watchdog
|
||||
|
||||
EXPOSE 5555
|
||||
|
||||
|
||||
+1
-1
@@ -208,7 +208,7 @@ To facilitate local development with live reload, you can use Docker. Follow the
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN pip install flask praisonai==2.2.3 watchdog
|
||||
RUN pip install flask praisonai==2.2.6 watchdog
|
||||
|
||||
EXPOSE 5555
|
||||
|
||||
|
||||
+4
-6
@@ -130,7 +130,7 @@ class PraisonAI:
|
||||
"""
|
||||
Run the PraisonAI application.
|
||||
"""
|
||||
self.main()
|
||||
return self.main()
|
||||
|
||||
def main(self):
|
||||
"""
|
||||
@@ -147,7 +147,7 @@ class PraisonAI:
|
||||
self.framework = args.framework or self.framework
|
||||
|
||||
if args.command:
|
||||
if args.command.startswith("tests.test"): # Argument used for testing purposes
|
||||
if args.command.startswith("tests.test") or args.command.startswith("tests/test"): # Argument used for testing purposes
|
||||
print("test")
|
||||
return "test"
|
||||
else:
|
||||
@@ -156,9 +156,7 @@ class PraisonAI:
|
||||
result = self.handle_direct_prompt(args.direct_prompt)
|
||||
print(result)
|
||||
return result
|
||||
else:
|
||||
# Default to agents.yaml if no command provided
|
||||
self.agent_file = "agents.yaml"
|
||||
# If no command or direct_prompt, preserve agent_file from constructor (don't overwrite)
|
||||
|
||||
if args.deploy:
|
||||
from .deploy import CloudDeployer
|
||||
@@ -462,7 +460,7 @@ class PraisonAI:
|
||||
|
||||
agent = PraisonAgent(**agent_config)
|
||||
result = agent.start(prompt)
|
||||
return ""
|
||||
return result
|
||||
elif CREWAI_AVAILABLE:
|
||||
agent_config = {
|
||||
"name": "DirectAgent",
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ class CloudDeployer:
|
||||
file.write("FROM python:3.11-slim\n")
|
||||
file.write("WORKDIR /app\n")
|
||||
file.write("COPY . .\n")
|
||||
file.write("RUN pip install flask praisonai==2.2.3 gunicorn markdown\n")
|
||||
file.write("RUN pip install flask praisonai==2.2.6 gunicorn markdown\n")
|
||||
file.write("EXPOSE 8080\n")
|
||||
file.write('CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]\n')
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "PraisonAI"
|
||||
version = "2.2.3"
|
||||
version = "2.2.6"
|
||||
description = "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."
|
||||
readme = "README.md"
|
||||
license = ""
|
||||
@@ -89,7 +89,7 @@ autogen = ["pyautogen>=0.2.19", "praisonai-tools>=0.0.15", "crewai"]
|
||||
|
||||
[tool.poetry]
|
||||
name = "PraisonAI"
|
||||
version = "2.2.3"
|
||||
version = "2.2.6"
|
||||
description = "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."
|
||||
authors = ["Mervin Praison"]
|
||||
license = ""
|
||||
|
||||
@@ -92,19 +92,19 @@ class TestBaseUrlApiBaseMapping:
|
||||
|
||||
@patch('litellm.image_generation')
|
||||
def test_image_agent_base_url_consistency(self, mock_image_generation):
|
||||
"""Test that ImageAgent maintains parameter consistency with base_url."""
|
||||
"""Test that ImageAgent maintains parameter consistency with api_base."""
|
||||
mock_image_generation.return_value = {
|
||||
'data': [{'url': 'http://example.com/image.png'}]
|
||||
}
|
||||
|
||||
image_agent = ImageAgent(
|
||||
base_url='http://localhost:4000',
|
||||
api_base='http://localhost:4000',
|
||||
api_key='sk-test'
|
||||
)
|
||||
|
||||
# Verify that ImageAgent was created with base_url
|
||||
assert image_agent.base_url == 'http://localhost:4000'
|
||||
assert image_agent.api_key == 'sk-test'
|
||||
# Verify that ImageAgent was created with api_base
|
||||
assert image_agent.image_config.api_base == 'http://localhost:4000'
|
||||
assert image_agent.image_config.api_key == 'sk-test'
|
||||
|
||||
@patch('litellm.completion')
|
||||
def test_koboldcpp_specific_scenario(self, mock_completion):
|
||||
|
||||
@@ -30,11 +30,11 @@ class TestMCPIntegration:
|
||||
mock_session = AsyncMock()
|
||||
mock_session_class.return_value.__aenter__.return_value = mock_session
|
||||
|
||||
# Mock session methods
|
||||
# Mock tool listing
|
||||
mock_session.initialize.return_value = None
|
||||
mock_session.list_tools.return_value = Mock(tools=[
|
||||
Mock(name='get_stock_price', description='Get stock price')
|
||||
])
|
||||
mock_tool = Mock()
|
||||
mock_tool.name = 'get_stock_price' # Set as string, not Mock
|
||||
mock_session.list_tools.return_value = Mock(tools=[mock_tool])
|
||||
|
||||
# Test MCP connection simulation
|
||||
async with mock_stdio_client(Mock()) as (read, write):
|
||||
|
||||
@@ -395,14 +395,20 @@ class TestRAGMemoryIntegration:
|
||||
def mock_update_knowledge(agent, new_documents: list, mode: str = "append"):
|
||||
"""Mock updating agent knowledge."""
|
||||
if mode == "append":
|
||||
current_knowledge = getattr(agent, 'knowledge', [])
|
||||
updated_knowledge = current_knowledge + new_documents
|
||||
current_knowledge = getattr(agent, 'knowledge', None)
|
||||
if current_knowledge is not None:
|
||||
# If Knowledge object exists, get count from it
|
||||
previous_count = 1 # Mock that there's existing knowledge
|
||||
else:
|
||||
previous_count = 0
|
||||
updated_count = previous_count + len(new_documents)
|
||||
else: # replace
|
||||
updated_knowledge = new_documents
|
||||
previous_count = 1 if getattr(agent, 'knowledge', None) else 0
|
||||
updated_count = len(new_documents)
|
||||
|
||||
return {
|
||||
'previous_count': len(getattr(agent, 'knowledge', [])),
|
||||
'new_count': len(updated_knowledge),
|
||||
'previous_count': previous_count,
|
||||
'new_count': updated_count,
|
||||
'added_documents': new_documents
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user