Skip to content

Commit

Permalink
feat: running basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewBatutin committed Sep 22, 2024
1 parent ab7b92b commit f6164db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@
llm = OpenAI(model="gpt-4-turbo")

task_context = """
Every day, Wendi feeds each of her chickens three cups of mixed chicken feed, containing seeds, mealworms and vegetables
to help keep them healthy. She gives the chickens their feed in three separate meals. In the morning, she gives her flock of
chickens 15 cups of feed. In the afternoon, she gives her chickens another 25 cups of feed.
Tim gets a promotion that offers him a 5% raise on his $20000 a month salary. It also gives him a bonus worth half a month’s salary.
"""

query_engine = ErsatzO1QueryEngine(
context=task_context,
llm=llm,
reasoning_paths=5,
reasoning_paths=20,
verbose=True,
)

if __name__ == "__main__":
res = query_engine.query("How many cups of feed does she need to give her chickens in the final meal of the day if the size of Wendi’s flock is 20 chickens?")
res = query_engine.query("How much money will he make in a year?")
print(res)

Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def async_textual_reasoning(
llm: LLM,
num_paths: int = 5,
verbose: bool = False,
temperature: float = 0.01,
temperature: float = 1.99,
) -> List[Tuple[str, int]]:
"""
Perform asynchronous textual reasoning using the ErsatzO1 approach.
Expand All @@ -96,8 +96,11 @@ async def async_textual_reasoning(
question=query_str,
context=context,
)
answer, confidence = parse_response(str(response))
results.append((answer, confidence))
try:
answer, confidence = parse_response(str(response))
results.append((answer, confidence))
except:
print(f"Error parsing response: {response}")

return results

Expand Down

0 comments on commit f6164db

Please sign in to comment.