From 2425ed71fbfeddce9d71dd56560500a69717822f Mon Sep 17 00:00:00 2001 From: zxmfke Date: Thu, 20 Mar 2025 23:13:02 +0800 Subject: [PATCH] fix: modify test --- examples/cot_agent_example.py | 2 +- examples/multi_step_cot_example.py | 55 ------------------------------ 2 files changed, 1 insertion(+), 56 deletions(-) delete mode 100644 examples/multi_step_cot_example.py diff --git a/examples/cot_agent_example.py b/examples/cot_agent_example.py index ef02912..0902149 100644 --- a/examples/cot_agent_example.py +++ b/examples/cot_agent_example.py @@ -19,7 +19,7 @@ async def main(): agent = CoTAgent() # Provide a problem that requires thinking - question = "Zhang, Li, and Wang have a total of 85 apples. Zhang has twice as many apples as Li, and Wang has 5 more apples than Li. How many apples does each person have?" + question = "How do you put an elephant into a refrigerator?" logger.info(f"Question: {question}") diff --git a/examples/multi_step_cot_example.py b/examples/multi_step_cot_example.py deleted file mode 100644 index 9858278..0000000 --- a/examples/multi_step_cot_example.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python3 -""" -Multi-step CoT Agent Example - Demonstrates how to use Chain of Thought mode in multi-turn conversations -""" - -import asyncio -import sys -from pathlib import Path - -# Add project root directory to path -sys.path.append(str(Path(__file__).resolve().parent.parent)) - -from app.agent import CoTAgent -from app.logger import logger -from app.schema import Message - - -async def main(): - # Create CoT agent - agent = CoTAgent(max_steps=3) # Set maximum steps to 3 - - # Initial question - initial_question = "As artificial intelligence technology develops, what ethical challenges might we face?" - - logger.info(f"Initial question: {initial_question}") - - # Add initial question to agent's memory - agent.memory.add_message(Message.user_message(initial_question)) - - # Step 1: Get initial thoughts - logger.info("Step 1: Initial thoughts") - response1 = await agent.step() - print(f"\nResponse:\n{response1}\n") - - # Step 2: Ask follow-up question - follow_up_question = "Among the ethical challenges you mentioned, which one do you think is most urgent to address? Why?" - logger.info(f"Follow-up question: {follow_up_question}") - - agent.memory.add_message(Message.user_message(follow_up_question)) - response2 = await agent.step() - print(f"\nResponse:\n{response2}\n") - - # Step 3: Ask final follow-up - final_question = "Can you suggest some specific solutions for addressing this most urgent ethical challenge?" - logger.info(f"Final question: {final_question}") - - agent.memory.add_message(Message.user_message(final_question)) - response3 = await agent.step() - print(f"\nResponse:\n{response3}\n") - - logger.info("Multi-step CoT conversation complete!") - - -if __name__ == "__main__": - asyncio.run(main())