Add CrowPay tools — payment service for AI agents #187
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Windows Tests | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| workflow_dispatch: | |
| jobs: | |
| test-windows: | |
| runs-on: windows-latest | |
| timeout-minutes: 5 | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| OPENAI_MODEL_NAME: gpt-4o-mini | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install praisonaiagents | |
| run: | | |
| python -m pip install --upgrade pip | |
| cd src/praisonai-agents | |
| pip install . | |
| shell: bash | |
| - name: Install praisonai wrapper | |
| run: | | |
| cd src/praisonai | |
| pip install .[dev] | |
| shell: bash | |
| # ==================== CORE IMPORTS ==================== | |
| - name: Test core imports | |
| run: | | |
| python -c "from praisonaiagents import Agent, Agents, Workflow; print('Core imports OK')" | |
| python -c "from praisonaiagents import tool, Tools; print('Tool imports OK')" | |
| python -c "from praisonaiagents import Task, WorkflowStep; print('Task/Step imports OK')" | |
| # ==================== AGENT FEATURES ==================== | |
| - name: Test Agent instantiation | |
| run: | | |
| python -c " | |
| from praisonaiagents import Agent | |
| a = Agent(name='Test', instructions='You are helpful') | |
| print('Agent created:', a.name) | |
| a2 = Agent(name='ToolAgent', instructions='Use tools', tools=[]) | |
| print('Agent with tools:', a2.name) | |
| " | |
| - name: Test Agents orchestration | |
| run: | | |
| python -c " | |
| from praisonaiagents import Agent, Agents, Task | |
| a1 = Agent(name='Agent1', instructions='First agent') | |
| a2 = Agent(name='Agent2', instructions='Second agent') | |
| t = Task(description='Do something', agent=a1) | |
| agents = Agents(agents=[a1, a2], tasks=[t]) | |
| print('Agents:', len(agents.agents), 'Tasks:', len(agents.tasks)) | |
| " | |
| # ==================== WORKFLOW FEATURES ==================== | |
| - name: Test Workflow and WorkflowStep | |
| run: | | |
| python -c " | |
| from praisonaiagents import Workflow, WorkflowStep | |
| from praisonaiagents.workflows import WorkflowOutputConfig | |
| w = Workflow(name='test') | |
| s1 = WorkflowStep(name='step1') | |
| s2 = WorkflowStep(name='step2', context=['step1']) | |
| print('Workflow:', w.name) | |
| print('Steps:', s1.name, s2.name) | |
| cfg = WorkflowOutputConfig(verbose=True, stream=False) | |
| w2 = Workflow(name='configured', output=cfg) | |
| print('Configured workflow verbose:', w2.verbose) | |
| " | |
| # ==================== MEMORY FEATURES ==================== | |
| - name: Test Memory classes | |
| run: | | |
| python -c " | |
| from praisonaiagents.memory import FileMemory | |
| from praisonaiagents.config import MemoryConfig | |
| cfg = MemoryConfig(backend='file', user_id='test_user') | |
| print('MemoryConfig backend:', cfg.backend) | |
| mem = FileMemory(user_id='test_user', base_path='.praison/test_memory') | |
| print('FileMemory user:', mem.user_id) | |
| " | |
| # ==================== TOOL DECORATOR ==================== | |
| - name: Test tool decorator | |
| run: | | |
| python -c " | |
| from praisonaiagents import tool | |
| @tool | |
| def my_tool(query: str) -> str: | |
| '''A test tool''' | |
| return f'Echo: {query}' | |
| result = my_tool('hello') | |
| print('Tool result:', result) | |
| " | |
| # ==================== CONFIG CLASSES ==================== | |
| - name: Test config classes | |
| run: | | |
| python -c " | |
| from praisonaiagents.config import OutputConfig, ExecutionConfig, PlanningConfig | |
| out_cfg = OutputConfig(verbose=True, stream=True) | |
| print('OutputConfig verbose:', out_cfg.verbose) | |
| exec_cfg = ExecutionConfig(max_iter=50, max_retry_limit=5) | |
| print('ExecutionConfig max_iter:', exec_cfg.max_iter) | |
| plan_cfg = PlanningConfig(reasoning=True, auto_approve=False) | |
| print('PlanningConfig reasoning:', plan_cfg.reasoning) | |
| " | |
| # ==================== HANDOFF ==================== | |
| - name: Test Handoff | |
| run: | | |
| python -c " | |
| from praisonaiagents import Handoff, handoff, Agent | |
| a1 = Agent(name='Agent1', instructions='First') | |
| a2 = Agent(name='Agent2', instructions='Second') | |
| # Using Handoff class directly | |
| h = Handoff(agent=a2) | |
| print('Handoff tool name:', h.tool_name) | |
| # Using handoff function | |
| h2 = handoff(a1, tool_name_override='custom_handoff') | |
| print('Custom handoff name:', h2.tool_name) | |
| " | |
| # ==================== ASYNC FEATURES ==================== | |
| - name: Test async imports | |
| run: | | |
| python -c " | |
| import asyncio | |
| from praisonaiagents import Agent | |
| async def test_async(): | |
| agent = Agent(name='AsyncAgent', instructions='Test') | |
| assert hasattr(agent, 'arun'), 'Missing arun' | |
| assert hasattr(agent, 'astart'), 'Missing astart' | |
| print('Async methods available') | |
| asyncio.run(test_async()) | |
| " | |
| # ==================== CLI COMMANDS ==================== | |
| - name: Test CLI help | |
| run: praisonai --help | |
| - name: Test CLI session list | |
| run: praisonai session list | |
| continue-on-error: true | |
| - name: Test CLI queue list | |
| run: praisonai queue list | |
| continue-on-error: true | |
| # ==================== REAL API TESTS ==================== | |
| - name: Real API test - Agent run | |
| if: env.OPENAI_API_KEY != '' | |
| run: | | |
| python -c " | |
| from praisonaiagents import Agent | |
| agent = Agent(name='TestAgent', instructions='Reply with exactly: WINDOWS_OK', llm='gpt-4o-mini') | |
| result = agent.run('Say WINDOWS_OK') | |
| print('Result:', result) | |
| print('Real API test passed') | |
| " | |
| - name: Real API test - Multi-agent | |
| if: env.OPENAI_API_KEY != '' | |
| run: | | |
| python -c " | |
| from praisonaiagents import Agent, Agents, Task | |
| researcher = Agent(name='Researcher', instructions='You research topics', llm='gpt-4o-mini') | |
| writer = Agent(name='Writer', instructions='You write content', llm='gpt-4o-mini') | |
| task = Task(description='Say hello world', agent=researcher) | |
| agents = Agents(agents=[researcher, writer], tasks=[task]) | |
| result = agents.start() | |
| print('Multi-agent result type:', type(result)) | |
| print('Multi-agent test passed') | |
| " |