-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove unused agent files and clean up test directory by deleting obs… #524
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 2 commits
aeeaa9e
483992f
12e59a5
86d7d76
7d89874
6e3c9b7
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 | ||
|---|---|---|---|---|
|
|
@@ -6,18 +6,36 @@ | |||
|
|
||||
| import sys | ||||
| import os | ||||
| import pytest | ||||
| sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src')) | ||||
|
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. Fix incorrect path manipulation. The current path insertion attempts to add a 'src' subdirectory relative to the test file location, but this would point to a non-existent directory ( -sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))The import on line 12 should work correctly without this path manipulation since the test is being run from the proper directory context according to the updated GitHub Actions workflows. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||
|
|
||||
| from praisonaiagents import Agent, Agents | ||||
| from unittest.mock import patch | ||||
|
|
||||
| def test_mini_agents_sequential_data_passing(): | ||||
| def mock_completion(*args, **kwargs): | ||||
| """Mock completion function to avoid calling actual OpenAI API""" | ||||
| class MockResponse: | ||||
| def __init__(self, content): | ||||
| self.content = content | ||||
| self.choices = [type('obj', (object,), {'message': type('obj', (object,), {'content': content})})] | ||||
|
|
||||
| if 'messages' in kwargs: | ||||
| if any('Generate the number 42' in str(m.get('content', '')) for m in kwargs.get('messages', [])): | ||||
| return MockResponse("42") | ||||
| elif any('multiply it by 2' in str(m.get('content', '')) for m in kwargs.get('messages', [])): | ||||
| return MockResponse("84") | ||||
| return MockResponse("mock response") | ||||
|
|
||||
| @patch('praisonaiagents.llms.PraisonAIModel.chat', side_effect=mock_completion) | ||||
| @patch('praisonaiagents.llms.PraisonAIModel.stream_chat', side_effect=mock_completion) | ||||
| def test_mini_agents_sequential_data_passing(mock_stream, mock_chat): | ||||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||||
| """Test that output from previous task is passed to next task in Mini Agents""" | ||||
|
|
||||
| print("Testing Mini Agents Sequential Data Passing...") | ||||
|
|
||||
| # Create two agents for sequential processing | ||||
| agent1 = Agent(instructions="Generate the number 42 as your output. Only return the number 42, nothing else.") | ||||
| agent2 = Agent(instructions="Take the input number and multiply it by 2. Only return the result number, nothing else.") | ||||
| agent1 = Agent(instructions="Generate the number 42 as your output. Only return the number 42, nothing else.", model_name="gpt-3.5-turbo") | ||||
| agent2 = Agent(instructions="Take the input number and multiply it by 2. Only return the result number, nothing else.", model_name="gpt-3.5-turbo") | ||||
|
|
||||
| # Create agents with sequential processing (Mini Agents pattern) | ||||
| agents = Agents(agents=[agent1, agent2], verbose=True) | ||||
|
|
||||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.