-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add integration tests #9
Conversation
…tors in http_cache module
tests/run_integration_tests.py
Outdated
def single_llama_index_test(): | ||
"""Test example single_llama_index""" | ||
|
||
function_name = inspect.stack()[0][3] | ||
search_tool = DuckDuckGoSearchRun() | ||
researcher = ReActLlamaIndexMotleyAgent( | ||
goal="Uncover cutting-edge developments in AI and data science", | ||
tools=[search_tool], | ||
verbose=True, | ||
) | ||
crew = MotleyCrew() | ||
# Create tasks for your agents | ||
task1 = Task( | ||
crew=crew, | ||
name="produce comprehensive analysis report on AI advancements", | ||
description="""Conduct a comprehensive analysis of the latest advancements in AI in 2024. | ||
Identify key trends, breakthrough technologies, and potential industry impacts. | ||
Your final answer MUST be a full analysis report""", | ||
agent=researcher, | ||
documents=["paper1.pdf", "paper2.pdf"], | ||
) | ||
|
||
# Instantiate your crew with a sequential process | ||
result = crew.run( | ||
agents=[researcher], | ||
verbose=2, # You can set it to 1 or 2 to different logging levels | ||
) | ||
|
||
content = list(result._done)[0].outputs[0].response | ||
excepted_content = read_content(function_name) | ||
comparison_results(content, excepted_content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's import the code from examples (isolating it to a function returning agent output) and call it from here, instead of duplicating
tests/run_integration_tests.py
Outdated
comparison_results(content, excepted_content) | ||
|
||
|
||
def comparison_results(result: str, excepted_result: str) -> list: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's call it compare_results
tests/run_integration_tests.py
Outdated
return f_o.read() | ||
|
||
|
||
def find_tests_functions(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def find_tests_functions(): | |
def find_test_functions(): |
tests/run_integration_tests.py
Outdated
return diff | ||
|
||
|
||
def build_excepted_content_file_path(function_name: str, extension: str = "txt") -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename function_name to test_name
No description provided.