mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-25 08:46:48 +02:00
feat: merge geekan/dev
This commit is contained in:
commit
aa0909525e
62 changed files with 1733 additions and 154 deletions
BIN
tests/data/audio/hello.mp3
Normal file
BIN
tests/data/audio/hello.mp3
Normal file
Binary file not shown.
BIN
tests/data/incremental_dev_project/Gomoku.zip
Normal file
BIN
tests/data/incremental_dev_project/Gomoku.zip
Normal file
Binary file not shown.
BIN
tests/data/incremental_dev_project/dice_simulator_new.zip
Normal file
BIN
tests/data/incremental_dev_project/dice_simulator_new.zip
Normal file
Binary file not shown.
466
tests/data/incremental_dev_project/mock.py
Normal file
466
tests/data/incremental_dev_project/mock.py
Normal file
|
|
@ -0,0 +1,466 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@Time : 2024/01/17
|
||||
@Author : mannaandpoem
|
||||
@File : mock.py
|
||||
"""
|
||||
NEW_REQUIREMENT_SAMPLE = """
|
||||
Adding graphical interface functionality to enhance the user experience in the number-guessing game. The existing number-guessing game currently relies on command-line input for numbers. The goal is to introduce a graphical interface to improve the game's usability and visual appeal
|
||||
"""
|
||||
|
||||
PRD_SAMPLE = """
|
||||
## Language
|
||||
|
||||
en_us
|
||||
|
||||
## Programming Language
|
||||
|
||||
Python
|
||||
|
||||
## Original Requirements
|
||||
|
||||
Make a simple number guessing game
|
||||
|
||||
## Product Goals
|
||||
|
||||
- Ensure a user-friendly interface for the game
|
||||
- Provide a challenging yet enjoyable game experience
|
||||
- Design the game to be easily extendable for future features
|
||||
|
||||
## User Stories
|
||||
|
||||
- As a player, I want to guess numbers and receive feedback on whether my guess is too high or too low
|
||||
- As a player, I want to be able to set the difficulty level by choosing the range of possible numbers
|
||||
- As a player, I want to see my previous guesses to strategize my next guess
|
||||
- As a player, I want to know how many attempts it took me to guess the number once I get it right
|
||||
|
||||
## Competitive Analysis
|
||||
|
||||
- Guess The Number Game A: Basic text interface, no difficulty levels
|
||||
- Number Master B: Has difficulty levels, but cluttered interface
|
||||
- Quick Guess C: Sleek design, but lacks performance tracking
|
||||
- NumGuess D: Good performance tracking, but not mobile-friendly
|
||||
- GuessIt E: Mobile-friendly, but too many ads
|
||||
- Perfect Guess F: Offers hints, but the hints are not very helpful
|
||||
- SmartGuesser G: Has a learning mode, but lacks a competitive edge
|
||||
|
||||
## Competitive Quadrant Chart
|
||||
|
||||
quadrantChart
|
||||
title "User Engagement and Game Complexity"
|
||||
x-axis "Low Complexity" --> "High Complexity"
|
||||
y-axis "Low Engagement" --> "High Engagement"
|
||||
quadrant-1 "Too Simple"
|
||||
quadrant-2 "Niche Appeal"
|
||||
quadrant-3 "Complex & Unengaging"
|
||||
quadrant-4 "Sweet Spot"
|
||||
"Guess The Number Game A": [0.2, 0.4]
|
||||
"Number Master B": [0.5, 0.3]
|
||||
"Quick Guess C": [0.6, 0.7]
|
||||
"NumGuess D": [0.4, 0.6]
|
||||
"GuessIt E": [0.7, 0.5]
|
||||
"Perfect Guess F": [0.6, 0.4]
|
||||
"SmartGuesser G": [0.8, 0.6]
|
||||
"Our Target Product": [0.5, 0.8]
|
||||
|
||||
## Requirement Analysis
|
||||
|
||||
The game should be simple yet engaging, allowing players of different skill levels to enjoy it. It should provide immediate feedback and track the player's performance. The game should also be designed with a clean and intuitive interface, and it should be easy to add new features in the future.
|
||||
|
||||
## Requirement Pool
|
||||
|
||||
- ['P0', 'Implement the core game logic to randomly select a number and allow the user to guess it']
|
||||
- ['P0', 'Design a user interface that displays the game status and results clearly']
|
||||
- ['P1', 'Add difficulty levels by varying the range of possible numbers']
|
||||
- ['P1', 'Keep track of and display the number of attempts for each game session']
|
||||
- ['P2', "Store and show the history of the player's guesses during a game session"]
|
||||
|
||||
## UI Design draft
|
||||
|
||||
The UI will feature a clean and minimalist design with a number input field, submit button, and messages area to provide feedback. There will be options to select the difficulty level and a display showing the number of attempts and history of past guesses.
|
||||
|
||||
## Anything UNCLEAR"""
|
||||
|
||||
DESIGN_SAMPLE = """
|
||||
## Implementation approach
|
||||
|
||||
We will create a Python-based number guessing game with a simple command-line interface. For the user interface, we will use the built-in 'input' and 'print' functions for interaction. The random library will be used for generating random numbers. We will structure the code to be modular and easily extendable, separating the game logic from the user interface.
|
||||
|
||||
## File list
|
||||
|
||||
- main.py
|
||||
- game.py
|
||||
- ui.py
|
||||
|
||||
## Data structures and interfaces
|
||||
|
||||
|
||||
classDiagram
|
||||
class Game {
|
||||
-int secret_number
|
||||
-int min_range
|
||||
-int max_range
|
||||
-list attempts
|
||||
+__init__(difficulty: str)
|
||||
+start_game()
|
||||
+check_guess(guess: int) str
|
||||
+get_attempts() int
|
||||
+get_history() list
|
||||
}
|
||||
class UI {
|
||||
+start()
|
||||
+display_message(message: str)
|
||||
+get_user_input(prompt: str) str
|
||||
+show_attempts(attempts: int)
|
||||
+show_history(history: list)
|
||||
+select_difficulty() str
|
||||
}
|
||||
class Main {
|
||||
+main()
|
||||
}
|
||||
Main --> UI
|
||||
UI --> Game
|
||||
|
||||
|
||||
## Program call flow
|
||||
|
||||
|
||||
sequenceDiagram
|
||||
participant M as Main
|
||||
participant UI as UI
|
||||
participant G as Game
|
||||
M->>UI: start()
|
||||
UI->>UI: select_difficulty()
|
||||
UI-->>G: __init__(difficulty)
|
||||
G->>G: start_game()
|
||||
loop Game Loop
|
||||
UI->>UI: get_user_input("Enter your guess:")
|
||||
UI-->>G: check_guess(guess)
|
||||
G->>UI: display_message(feedback)
|
||||
G->>UI: show_attempts(attempts)
|
||||
G->>UI: show_history(history)
|
||||
end
|
||||
G->>UI: display_message("Correct! Game over.")
|
||||
UI->>M: main() # Game session ends
|
||||
|
||||
|
||||
## Anything UNCLEAR
|
||||
|
||||
The requirement analysis suggests the need for a clean and intuitive interface. Since we are using a command-line interface, we need to ensure that the text-based UI is as user-friendly as possible. Further clarification on whether a graphical user interface (GUI) is expected in the future would be helpful for planning the extendability of the game."""
|
||||
|
||||
TASKS_SAMPLE = """
|
||||
## Required Python packages
|
||||
|
||||
- random==2.2.1
|
||||
|
||||
## Required Other language third-party packages
|
||||
|
||||
- No third-party dependencies required
|
||||
|
||||
## Logic Analysis
|
||||
|
||||
- ['game.py', 'Contains Game class with methods __init__, start_game, check_guess, get_attempts, get_history and uses random library for generating secret_number']
|
||||
- ['ui.py', 'Contains UI class with methods start, display_message, get_user_input, show_attempts, show_history, select_difficulty and interacts with Game class']
|
||||
- ['main.py', 'Contains Main class with method main that initializes UI class and starts the game loop']
|
||||
|
||||
## Task list
|
||||
|
||||
- game.py
|
||||
- ui.py
|
||||
- main.py
|
||||
|
||||
## Full API spec
|
||||
|
||||
|
||||
|
||||
## Shared Knowledge
|
||||
|
||||
`game.py` contains the core game logic and is used by `ui.py` to interact with the user. `main.py` serves as the entry point to start the game.
|
||||
|
||||
## Anything UNCLEAR
|
||||
|
||||
The requirement analysis suggests the need for a clean and intuitive interface. Since we are using a command-line interface, we need to ensure that the text-based UI is as user-friendly as possible. Further clarification on whether a graphical user interface (GUI) is expected in the future would be helpful for planning the extendability of the game."""
|
||||
|
||||
OLD_CODE_SAMPLE = """
|
||||
--- game.py
|
||||
```## game.py
|
||||
|
||||
import random
|
||||
|
||||
class Game:
|
||||
def __init__(self, difficulty: str = 'medium'):
|
||||
self.min_range, self.max_range = self._set_difficulty(difficulty)
|
||||
self.secret_number = random.randint(self.min_range, self.max_range)
|
||||
self.attempts = []
|
||||
|
||||
def _set_difficulty(self, difficulty: str):
|
||||
difficulties = {
|
||||
'easy': (1, 10),
|
||||
'medium': (1, 100),
|
||||
'hard': (1, 1000)
|
||||
}
|
||||
return difficulties.get(difficulty, (1, 100))
|
||||
|
||||
def start_game(self):
|
||||
self.secret_number = random.randint(self.min_range, self.max_range)
|
||||
self.attempts = []
|
||||
|
||||
def check_guess(self, guess: int) -> str:
|
||||
self.attempts.append(guess)
|
||||
if guess < self.secret_number:
|
||||
return "It's higher."
|
||||
elif guess > self.secret_number:
|
||||
return "It's lower."
|
||||
else:
|
||||
return "Correct! Game over."
|
||||
|
||||
def get_attempts(self) -> int:
|
||||
return len(self.attempts)
|
||||
|
||||
def get_history(self) -> list:
|
||||
return self.attempts```
|
||||
|
||||
--- ui.py
|
||||
```## ui.py
|
||||
|
||||
from game import Game
|
||||
|
||||
class UI:
|
||||
def start(self):
|
||||
difficulty = self.select_difficulty()
|
||||
game = Game(difficulty)
|
||||
game.start_game()
|
||||
self.display_welcome_message(game)
|
||||
|
||||
feedback = ""
|
||||
while feedback != "Correct! Game over.":
|
||||
guess = self.get_user_input("Enter your guess: ")
|
||||
if self.is_valid_guess(guess):
|
||||
feedback = game.check_guess(int(guess))
|
||||
self.display_message(feedback)
|
||||
self.show_attempts(game.get_attempts())
|
||||
self.show_history(game.get_history())
|
||||
else:
|
||||
self.display_message("Please enter a valid number.")
|
||||
|
||||
def display_welcome_message(self, game):
|
||||
print("Welcome to the Number Guessing Game!")
|
||||
print(f"Guess the number between {game.min_range} and {game.max_range}.")
|
||||
|
||||
def is_valid_guess(self, guess):
|
||||
return guess.isdigit()
|
||||
|
||||
def display_message(self, message: str):
|
||||
print(message)
|
||||
|
||||
def get_user_input(self, prompt: str) -> str:
|
||||
return input(prompt)
|
||||
|
||||
def show_attempts(self, attempts: int):
|
||||
print(f"Number of attempts: {attempts}")
|
||||
|
||||
def show_history(self, history: list):
|
||||
print("Guess history:")
|
||||
for guess in history:
|
||||
print(guess)
|
||||
|
||||
def select_difficulty(self) -> str:
|
||||
while True:
|
||||
difficulty = input("Select difficulty (easy, medium, hard): ").lower()
|
||||
if difficulty in ['easy', 'medium', 'hard']:
|
||||
return difficulty
|
||||
else:
|
||||
self.display_message("Invalid difficulty. Please choose 'easy', 'medium', or 'hard'.")```
|
||||
|
||||
--- main.py
|
||||
```## main.py
|
||||
|
||||
from ui import UI
|
||||
|
||||
class Main:
|
||||
def main(self):
|
||||
user_interface = UI()
|
||||
user_interface.start()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main_instance = Main()
|
||||
main_instance.main()```
|
||||
"""
|
||||
|
||||
REFINED_PRD_JSON = {
|
||||
"Language": "en_us",
|
||||
"Programming Language": "Python",
|
||||
"Refined Requirements": "Adding graphical interface functionality to enhance the user experience in the number-guessing game.",
|
||||
"Project Name": "number_guessing_game",
|
||||
"Refined Product Goals": [
|
||||
"Ensure a user-friendly interface for the game with the new graphical interface",
|
||||
"Provide a challenging yet enjoyable game experience with visual enhancements",
|
||||
"Design the game to be easily extendable for future features, including graphical elements",
|
||||
],
|
||||
"Refined User Stories": [
|
||||
"As a player, I want to interact with a graphical interface to guess numbers and receive visual feedback on my guesses",
|
||||
"As a player, I want to easily select the difficulty level through the graphical interface",
|
||||
"As a player, I want to visually track my previous guesses and the number of attempts in the graphical interface",
|
||||
"As a player, I want to be congratulated with a visually appealing message when I guess the number correctly",
|
||||
],
|
||||
"Competitive Analysis": [
|
||||
"Guess The Number Game A: Basic text interface, no difficulty levels",
|
||||
"Number Master B: Has difficulty levels, but cluttered interface",
|
||||
"Quick Guess C: Sleek design, but lacks performance tracking",
|
||||
"NumGuess D: Good performance tracking, but not mobile-friendly",
|
||||
"GuessIt E: Mobile-friendly, but too many ads",
|
||||
"Perfect Guess F: Offers hints, but the hints are not very helpful",
|
||||
"SmartGuesser G: Has a learning mode, but lacks a competitive edge",
|
||||
"Graphical Guess H: Graphical interface, but poor user experience due to complex design",
|
||||
],
|
||||
"Competitive Quadrant Chart": 'quadrantChart\n title "User Engagement and Game Complexity with Graphical Interface"\n x-axis "Low Complexity" --> "High Complexity"\n y-axis "Low Engagement" --> "High Engagement"\n quadrant-1 "Too Simple"\n quadrant-2 "Niche Appeal"\n quadrant-3 "Complex & Unengaging"\n quadrant-4 "Sweet Spot"\n "Guess The Number Game A": [0.2, 0.4]\n "Number Master B": [0.5, 0.3]\n "Quick Guess C": [0.6, 0.7]\n "NumGuess D": [0.4, 0.6]\n "GuessIt E": [0.7, 0.5]\n "Perfect Guess F": [0.6, 0.4]\n "SmartGuesser G": [0.8, 0.6]\n "Graphical Guess H": [0.7, 0.3]\n "Our Target Product": [0.5, 0.9]',
|
||||
"Refined Requirement Analysis": [
|
||||
"The game should maintain its simplicity while integrating a graphical interface for enhanced engagement.",
|
||||
"Immediate visual feedback is crucial for user satisfaction in the graphical interface.",
|
||||
"The interface must be intuitive, allowing for easy navigation and selection of game options.",
|
||||
"The graphical design should be clean and not detract from the game's core guessing mechanic.",
|
||||
],
|
||||
"Refined Requirement Pool": [
|
||||
["P0", "Implement a graphical user interface (GUI) to replace the command-line interaction"],
|
||||
[
|
||||
"P0",
|
||||
"Design a user interface that displays the game status, results, and feedback clearly with graphical elements",
|
||||
],
|
||||
["P1", "Incorporate interactive elements for selecting difficulty levels"],
|
||||
["P1", "Visualize the history of the player's guesses and the number of attempts within the game session"],
|
||||
["P2", "Create animations for correct or incorrect guesses to enhance user feedback"],
|
||||
["P2", "Ensure the GUI is responsive and compatible with various screen sizes"],
|
||||
["P2", "Store and show the history of the player's guesses during a game session"],
|
||||
],
|
||||
"UI Design draft": "The UI will feature a modern and minimalist design with a graphical number input field, a submit button with animations, and a dedicated area for visual feedback. It will include interactive elements to select the difficulty level and a visual display for the number of attempts and history of past guesses.",
|
||||
"Anything UNCLEAR": "",
|
||||
}
|
||||
|
||||
REFINED_DESIGN_JSON = {
|
||||
"Refined Implementation Approach": "To accommodate the new graphical user interface (GUI) requirements, we will leverage the Tkinter library, which is included with Python and supports the creation of a user-friendly GUI. The game logic will remain in Python, with Tkinter handling the rendering of the interface. We will ensure that the GUI is responsive and provides immediate visual feedback. The main game loop will be event-driven, responding to user inputs such as button clicks and difficulty selection.",
|
||||
"Refined File list": ["main.py", "game.py", "ui.py", "gui.py"],
|
||||
"Refined Data structures and interfaces": "\nclassDiagram\n class Game {\n -int secret_number\n -int min_range\n -int max_range\n -list attempts\n +__init__(difficulty: str)\n +start_game()\n +check_guess(guess: int) str\n +get_attempts() int\n +get_history() list\n }\n class UI {\n +start()\n +display_message(message: str)\n +get_user_input(prompt: str) str\n +show_attempts(attempts: int)\n +show_history(history: list)\n +select_difficulty() str\n }\n class GUI {\n +__init__()\n +setup_window()\n +bind_events()\n +update_feedback(message: str)\n +update_attempts(attempts: int)\n +update_history(history: list)\n +show_difficulty_selector()\n +animate_guess_result(correct: bool)\n }\n class Main {\n +main()\n }\n Main --> UI\n UI --> Game\n UI --> GUI\n GUI --> Game\n",
|
||||
"Refined Program call flow": '\nsequenceDiagram\n participant M as Main\n participant UI as UI\n participant G as Game\n participant GU as GUI\n M->>UI: start()\n UI->>GU: setup_window()\n GU->>GU: bind_events()\n GU->>UI: select_difficulty()\n UI-->>G: __init__(difficulty)\n G->>G: start_game()\n loop Game Loop\n GU->>GU: show_difficulty_selector()\n GU->>UI: get_user_input("Enter your guess:")\n UI-->>G: check_guess(guess)\n G->>GU: update_feedback(feedback)\n G->>GU: update_attempts(attempts)\n G->>GU: update_history(history)\n GU->>GU: animate_guess_result(correct)\n end\n G->>GU: update_feedback("Correct! Game over.")\n GU->>M: main() # Game session ends\n',
|
||||
"Anything UNCLEAR": "",
|
||||
}
|
||||
|
||||
REFINED_TASKS_JSON = {
|
||||
"Required Python packages": ["random==2.2.1", "Tkinter==8.6"],
|
||||
"Required Other language third-party packages": ["No third-party dependencies required"],
|
||||
"Refined Logic Analysis": [
|
||||
[
|
||||
"game.py",
|
||||
"Contains Game class with methods __init__, start_game, check_guess, get_attempts, get_history and uses random library for generating secret_number",
|
||||
],
|
||||
[
|
||||
"ui.py",
|
||||
"Contains UI class with methods start, display_message, get_user_input, show_attempts, show_history, select_difficulty and interacts with Game class",
|
||||
],
|
||||
[
|
||||
"gui.py",
|
||||
"Contains GUI class with methods __init__, setup_window, bind_events, update_feedback, update_attempts, update_history, show_difficulty_selector, animate_guess_result and interacts with Game class for GUI rendering",
|
||||
],
|
||||
[
|
||||
"main.py",
|
||||
"Contains Main class with method main that initializes UI class and starts the event-driven game loop",
|
||||
],
|
||||
],
|
||||
"Refined Task list": ["game.py", "ui.py", "gui.py", "main.py"],
|
||||
"Full API spec": "",
|
||||
"Refined Shared Knowledge": "`game.py` contains the core game logic and is used by `ui.py` to interact with the user. `main.py` serves as the entry point to start the game. `gui.py` is introduced to handle the graphical user interface using Tkinter, which will interact with both `game.py` and `ui.py` for a responsive and user-friendly experience.",
|
||||
"Anything UNCLEAR": "",
|
||||
}
|
||||
|
||||
CODE_PLAN_AND_CHANGE_SAMPLE = {
|
||||
"Code Plan And Change": '\n1. Plan for gui.py: Develop the GUI using Tkinter to replace the command-line interface. Start by setting up the main window and event handling. Then, add widgets for displaying the game status, results, and feedback. Implement interactive elements for difficulty selection and visualize the guess history. Finally, create animations for guess feedback and ensure responsiveness across different screen sizes.\n```python\nclass GUI:\n- pass\n+ def __init__(self):\n+ self.setup_window()\n+\n+ def setup_window(self):\n+ # Initialize the main window using Tkinter\n+ pass\n+\n+ def bind_events(self):\n+ # Bind button clicks and other events\n+ pass\n+\n+ def update_feedback(self, message: str):\n+ # Update the feedback label with the given message\n+ pass\n+\n+ def update_attempts(self, attempts: int):\n+ # Update the attempts label with the number of attempts\n+ pass\n+\n+ def update_history(self, history: list):\n+ # Update the history view with the list of past guesses\n+ pass\n+\n+ def show_difficulty_selector(self):\n+ # Show buttons or a dropdown for difficulty selection\n+ pass\n+\n+ def animate_guess_result(self, correct: bool):\n+ # Trigger an animation for correct or incorrect guesses\n+ pass\n```\n\n2. Plan for main.py: Modify the main.py to initialize the GUI and start the event-driven game loop. Ensure that the GUI is the primary interface for user interaction.\n```python\nclass Main:\n def main(self):\n- user_interface = UI()\n- user_interface.start()\n+ graphical_user_interface = GUI()\n+ graphical_user_interface.setup_window()\n+ graphical_user_interface.bind_events()\n+ # Start the Tkinter main loop\n+ pass\n\n if __name__ == "__main__":\n main_instance = Main()\n main_instance.main()\n```\n\n3. Plan for ui.py: Refactor ui.py to work with the new GUI class. Remove command-line interactions and delegate display and input tasks to the GUI.\n```python\nclass UI:\n- def display_message(self, message: str):\n- print(message)\n+\n+ def display_message(self, message: str):\n+ # This method will now pass the message to the GUI to display\n+ pass\n\n- def get_user_input(self, prompt: str) -> str:\n- return input(prompt)\n+\n+ def get_user_input(self, prompt: str) -> str:\n+ # This method will now trigger the GUI to get user input\n+ pass\n\n- def show_attempts(self, attempts: int):\n- print(f"Number of attempts: {attempts}")\n+\n+ def show_attempts(self, attempts: int):\n+ # This method will now update the GUI with the number of attempts\n+ pass\n\n- def show_history(self, history: list):\n- print("Guess history:")\n- for guess in history:\n- print(guess)\n+\n+ def show_history(self, history: list):\n+ # This method will now update the GUI with the guess history\n+ pass\n```\n\n4. Plan for game.py: Ensure game.py remains mostly unchanged as it contains the core game logic. However, make minor adjustments if necessary to integrate with the new GUI.\n```python\nclass Game:\n # No changes required for now\n```\n'
|
||||
}
|
||||
|
||||
REFINED_CODE_INPUT_SAMPLE = """
|
||||
-----Now, game.py to be rewritten
|
||||
```## game.py
|
||||
|
||||
import random
|
||||
|
||||
class Game:
|
||||
def __init__(self, difficulty: str = 'medium'):
|
||||
self.min_range, self.max_range = self._set_difficulty(difficulty)
|
||||
self.secret_number = random.randint(self.min_range, self.max_range)
|
||||
self.attempts = []
|
||||
|
||||
def _set_difficulty(self, difficulty: str):
|
||||
difficulties = {
|
||||
'easy': (1, 10),
|
||||
'medium': (1, 100),
|
||||
'hard': (1, 1000)
|
||||
}
|
||||
return difficulties.get(difficulty, (1, 100))
|
||||
|
||||
def start_game(self):
|
||||
self.secret_number = random.randint(self.min_range, self.max_range)
|
||||
self.attempts = []
|
||||
|
||||
def check_guess(self, guess: int) -> str:
|
||||
self.attempts.append(guess)
|
||||
if guess < self.secret_number:
|
||||
return "It's higher."
|
||||
elif guess > self.secret_number:
|
||||
return "It's lower."
|
||||
else:
|
||||
return "Correct! Game over."
|
||||
|
||||
def get_attempts(self) -> int:
|
||||
return len(self.attempts)
|
||||
|
||||
def get_history(self) -> list:
|
||||
return self.attempts```
|
||||
"""
|
||||
|
||||
REFINED_CODE_SAMPLE = """
|
||||
## game.py
|
||||
|
||||
import random
|
||||
|
||||
class Game:
|
||||
def __init__(self, difficulty: str = 'medium'):
|
||||
# Set the difficulty level with default value 'medium'
|
||||
self.min_range, self.max_range = self._set_difficulty(difficulty)
|
||||
# Initialize the secret number based on the difficulty
|
||||
self.secret_number = random.randint(self.min_range, self.max_range)
|
||||
# Initialize the list to keep track of attempts
|
||||
self.attempts = []
|
||||
|
||||
def _set_difficulty(self, difficulty: str):
|
||||
# Define the range of numbers for each difficulty level
|
||||
difficulties = {
|
||||
'easy': (1, 10),
|
||||
'medium': (1, 100),
|
||||
'hard': (1, 1000)
|
||||
}
|
||||
# Return the corresponding range for the selected difficulty, default to 'medium' if not found
|
||||
return difficulties.get(difficulty, (1, 100))
|
||||
|
||||
def start_game(self):
|
||||
# Reset the secret number and attempts list for a new game
|
||||
self.secret_number = random.randint(self.min_range, self.max_range)
|
||||
self.attempts.clear()
|
||||
|
||||
def check_guess(self, guess: int) -> str:
|
||||
# Add the guess to the attempts list
|
||||
self.attempts.append(guess)
|
||||
# Provide feedback based on the guess
|
||||
if guess < self.secret_number:
|
||||
return "It's higher."
|
||||
elif guess > self.secret_number:
|
||||
return "It's lower."
|
||||
else:
|
||||
return "Correct! Game over."
|
||||
|
||||
def get_attempts(self) -> int:
|
||||
# Return the number of attempts made
|
||||
return len(self.attempts)
|
||||
|
||||
def get_history(self) -> list:
|
||||
# Return the list of attempts made
|
||||
return self.attempts
|
||||
"""
|
||||
BIN
tests/data/incremental_dev_project/number_guessing_game.zip
Normal file
BIN
tests/data/incremental_dev_project/number_guessing_game.zip
Normal file
Binary file not shown.
BIN
tests/data/incremental_dev_project/pygame_2048.zip
Normal file
BIN
tests/data/incremental_dev_project/pygame_2048.zip
Normal file
Binary file not shown.
3
tests/data/incremental_dev_project/readme.md
Normal file
3
tests/data/incremental_dev_project/readme.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Code archive
|
||||
|
||||
This folder contains a compressed package for the test_incremental_dev.py file, which is used to demonstrate the process of incremental development.
|
||||
BIN
tests/data/incremental_dev_project/simple_add_calculator.zip
Normal file
BIN
tests/data/incremental_dev_project/simple_add_calculator.zip
Normal file
Binary file not shown.
BIN
tests/data/incremental_dev_project/snake_game.zip
Normal file
BIN
tests/data/incremental_dev_project/snake_game.zip
Normal file
Binary file not shown.
BIN
tests/data/incremental_dev_project/word_cloud.zip
Normal file
BIN
tests/data/incremental_dev_project/word_cloud.zip
Normal file
Binary file not shown.
|
|
@ -261,5 +261,21 @@
|
|||
"Evaluate if given numbers can reach 24 (sure/likely/impossible)\n10 14\n10 + 14 = 24\nsure\n11 12\n11 + 12 = 23\n12 - 11 = 1\n11 * 12 = 132\n11 / 12 = 0.91\nimpossible\n4 4 10\n4 + 4 + 10 = 8 + 10 = 18\n4 * 10 - 4 = 40 - 4 = 36\n(10 - 4) * 4 = 6 * 4 = 24\nsure\n4 9 11\n9 + 11 + 4 = 20 + 4 = 24\nsure\n5 7 8\n5 + 7 + 8 = 12 + 8 = 20\n(8 - 5) * 7 = 3 * 7 = 21\nI cannot obtain 24 now, but numbers are within a reasonable range\nlikely\n5 6 6\n5 + 6 + 6 = 17\n(6 - 5) * 6 = 1 * 6 = 6\nI cannot obtain 24 now, but numbers are within a reasonable range\nlikely\n10 10 11\n10 + 10 + 11 = 31\n(11 - 10) * 10 = 10\n10 10 10 are all too big\nimpossible\n1 3 3\n1 * 3 * 3 = 9\n(1 + 3) * 3 = 12\n1 3 3 are all too small\nimpossible\n10 12\n": "It seems like you have evaluated the combinations correctly. Based on the evaluations you provided, the combinations that can reach 24 are:\n\n- 10 14 (sure)\n- 4 4 10 (sure)\n- 4 9 11 (sure)\n- 5 7 8 (likely)\n- 5 6 6 (likely)\n\nThe combinations that cannot reach 24 are:\n\n- 11 12 (impossible)\n- 10 10 11 (impossible)\n- 1 3 3 (impossible)\n\nAs for the combination \"10 12,\" it seems like it was cut off. If you provide the complete expression, I can help evaluate it for you.",
|
||||
"Evaluate if given numbers can reach 24 (sure/likely/impossible)\n10 14\n10 + 14 = 24\nsure\n11 12\n11 + 12 = 23\n12 - 11 = 1\n11 * 12 = 132\n11 / 12 = 0.91\nimpossible\n4 4 10\n4 + 4 + 10 = 8 + 10 = 18\n4 * 10 - 4 = 40 - 4 = 36\n(10 - 4) * 4 = 6 * 4 = 24\nsure\n4 9 11\n9 + 11 + 4 = 20 + 4 = 24\nsure\n5 7 8\n5 + 7 + 8 = 12 + 8 = 20\n(8 - 5) * 7 = 3 * 7 = 21\nI cannot obtain 24 now, but numbers are within a reasonable range\nlikely\n5 6 6\n5 + 6 + 6 = 17\n(6 - 5) * 6 = 1 * 6 = 6\nI cannot obtain 24 now, but numbers are within a reasonable range\nlikely\n10 10 11\n10 + 10 + 11 = 31\n(11 - 10) * 10 = 10\n10 10 10 are all too big\nimpossible\n1 3 3\n1 * 3 * 3 = 9\n(1 + 3) * 3 = 12\n1 3 3 are all too small\nimpossible\n150\n": "It seems like you have evaluated the given numbers correctly. Here are the results:\n\n10 14: Sure\n11 12: Impossible\n4 4 10: Sure\n4 9 11: Sure\n5 7 8: Likely\n5 6 6: Likely\n10 10 11: Impossible\n1 3 3: Impossible\n\nAs for the number 150, it is not clear what operation or combination of numbers it is associated with. If you have a specific question or context for the number 150, please provide more details so that I can assist you further.",
|
||||
"Evaluate if given numbers can reach 24 (sure/likely/impossible)\n10 14\n10 + 14 = 24\nsure\n11 12\n11 + 12 = 23\n12 - 11 = 1\n11 * 12 = 132\n11 / 12 = 0.91\nimpossible\n4 4 10\n4 + 4 + 10 = 8 + 10 = 18\n4 * 10 - 4 = 40 - 4 = 36\n(10 - 4) * 4 = 6 * 4 = 24\nsure\n4 9 11\n9 + 11 + 4 = 20 + 4 = 24\nsure\n5 7 8\n5 + 7 + 8 = 12 + 8 = 20\n(8 - 5) * 7 = 3 * 7 = 21\nI cannot obtain 24 now, but numbers are within a reasonable range\nlikely\n5 6 6\n5 + 6 + 6 = 17\n(6 - 5) * 6 = 1 * 6 = 6\nI cannot obtain 24 now, but numbers are within a reasonable range\nlikely\n10 10 11\n10 + 10 + 11 = 31\n(11 - 10) * 10 = 10\n10 10 10 are all too big\nimpossible\n1 3 3\n1 * 3 * 3 = 9\n(1 + 3) * 3 = 12\n1 3 3 are all too small\nimpossible\n5\n": "The numbers 10 and 14 can reach 24, so that is sure. The numbers 11 and 12 cannot reach 24, so that is impossible. The numbers 4, 4, and 10 can reach 24, so that is sure. The numbers 4, 9, and 11 can reach 24, so that is sure. The numbers 5, 7, and 8 cannot reach 24, but they are within a reasonable range, so that is likely. The numbers 5, 6, and 6 cannot reach 24, but they are within a reasonable range, so that is likely. The numbers 10, 10, and 11 cannot reach 24, so that is impossible. The numbers 1, 3, and 3 cannot reach 24, so that is impossible. The number 5 by itself cannot reach 24.",
|
||||
"Evaluate if given numbers can reach 24 (sure/likely/impossible)\n10 14\n10 + 14 = 24\nsure\n11 12\n11 + 12 = 23\n12 - 11 = 1\n11 * 12 = 132\n11 / 12 = 0.91\nimpossible\n4 4 10\n4 + 4 + 10 = 8 + 10 = 18\n4 * 10 - 4 = 40 - 4 = 36\n(10 - 4) * 4 = 6 * 4 = 24\nsure\n4 9 11\n9 + 11 + 4 = 20 + 4 = 24\nsure\n5 7 8\n5 + 7 + 8 = 12 + 8 = 20\n(8 - 5) * 7 = 3 * 7 = 21\nI cannot obtain 24 now, but numbers are within a reasonable range\nlikely\n5 6 6\n5 + 6 + 6 = 17\n(6 - 5) * 6 = 1 * 6 = 6\nI cannot obtain 24 now, but numbers are within a reasonable range\nlikely\n10 10 11\n10 + 10 + 11 = 31\n(11 - 10) * 10 = 10\n10 10 10 are all too big\nimpossible\n1 3 3\n1 * 3 * 3 = 9\n(1 + 3) * 3 = 12\n1 3 3 are all too small\nimpossible\n7 9 10\n": "7 * 9 - 10 = 63 - 10 = 53\n(9 - 7) * 10 = 2 * 10 = 20\nI cannot obtain 24 now, but numbers are within a reasonable range\nlikely"
|
||||
"Evaluate if given numbers can reach 24 (sure/likely/impossible)\n10 14\n10 + 14 = 24\nsure\n11 12\n11 + 12 = 23\n12 - 11 = 1\n11 * 12 = 132\n11 / 12 = 0.91\nimpossible\n4 4 10\n4 + 4 + 10 = 8 + 10 = 18\n4 * 10 - 4 = 40 - 4 = 36\n(10 - 4) * 4 = 6 * 4 = 24\nsure\n4 9 11\n9 + 11 + 4 = 20 + 4 = 24\nsure\n5 7 8\n5 + 7 + 8 = 12 + 8 = 20\n(8 - 5) * 7 = 3 * 7 = 21\nI cannot obtain 24 now, but numbers are within a reasonable range\nlikely\n5 6 6\n5 + 6 + 6 = 17\n(6 - 5) * 6 = 1 * 6 = 6\nI cannot obtain 24 now, but numbers are within a reasonable range\nlikely\n10 10 11\n10 + 10 + 11 = 31\n(11 - 10) * 10 = 10\n10 10 10 are all too big\nimpossible\n1 3 3\n1 * 3 * 3 = 9\n(1 + 3) * 3 = 12\n1 3 3 are all too small\nimpossible\n7 9 10\n": "7 * 9 - 10 = 63 - 10 = 53\n(9 - 7) * 10 = 2 * 10 = 20\nI cannot obtain 24 now, but numbers are within a reasonable range\nlikely",
|
||||
"### Requirements\n1. Add docstrings to the given code following the google style.\n2. Replace the function body with an Ellipsis object(...) to reduce output.\n3. If the types are already annotated, there is no need to include them in the docstring.\n4. Extract only class, function or the docstrings for the module parts from the given Python code, avoiding any other text.\n\n### Input Example\n```python\ndef function_with_pep484_type_annotations(param1: int) -> bool:\n return isinstance(param1, int)\n\nclass ExampleError(Exception):\n def __init__(self, msg: str):\n self.msg = msg\n```\n\n### Output Example\n```python\ndef function_with_pep484_type_annotations(param1: int) -> bool:\n \"\"\"Example function with PEP 484 type annotations.\n\n Extended description of function.\n\n Args:\n param1: The first parameter.\n\n Returns:\n The return value. True for success, False otherwise.\n \"\"\"\n ...\n\nclass ExampleError(Exception):\n \"\"\"Exceptions are documented in the same way as classes.\n\n The __init__ method was documented in the class level docstring.\n\n Args:\n msg: Human readable string describing the exception.\n\n Attributes:\n msg: Human readable string describing the exception.\n \"\"\"\n ...\n```\n#SYSTEM_MSG_END#```python\nimport pytest\nfrom metagpt.actions.write_docstring import WriteDocstring\ncode = '\\ndef add_numbers(a: int, b: int):\\n return a + b\\n\\n\\nclass Person:\\n def __init__(self, name: str, age: int):\\n self.name = name\\n self.age = age\\n\\n def greet(self):\\n return f\"Hello, my name is {self.name} and I am {self.age} years old.\"\\n'\n\n@pytest.mark.asyncio\n@pytest.mark.parametrize(('style', 'part'), [('google', 'Args:'), ('numpy', 'Parameters'), ('sphinx', ':param name:')], ids=['google', 'numpy', 'sphinx'])\nasync def test_write_docstring(style: str, part: str, context):\n ret = await WriteDocstring(context=context).run(code, style=style)\n assert part in ret\n\n@pytest.mark.asyncio\nasync def test_write():\n code = await WriteDocstring.write_docstring(__file__)\n assert code\n```": "```python\ndef add_numbers(a: int, b: int):\n \"\"\"Adds two numbers together.\n\n Args:\n a: The first number.\n b: The second number.\n\n Returns:\n The sum of a and b.\n \"\"\"\n ...\n\nclass Person:\n \"\"\"Represents a person.\n\n Args:\n name: The name of the person.\n age: The age of the person.\n\n Attributes:\n name: The name of the person.\n age: The age of the person.\n \"\"\"\n\n def __init__(self, name: str, age: int):\n ...\n \n def greet(self):\n \"\"\"Generates a greeting message.\n\n Returns:\n A greeting string.\n \"\"\"\n ...\n```",
|
||||
"\nWrite a coherent passage of 4 short paragraphs. The end sentence of each paragraph must be: It isn't difficult to do a handstand if you just stand on your hands. It caught him off guard that space smelled of seared steak. When she didn’t like a guy who was trying to pick her up, she started using sign language. Each person who knows you has a different perception of who you are.\n\nMake a plan then write. Your output should be like:\n\nPlan:\n<Your plan here with json format>\n\nPassage:\n<Your passage here with json format>\n\n\nEach output should be strictly a list of nodes, in json format, like this:\n```json\n [\n {\n \"node_id\": str = \"unique identifier for a solution, can be an ordinal\",\n \"node_state_instruction\": \"specified sample of solution\",\n },\n ...\n ]\n```\n": "Plan:\n```json\n[\n {\n \"node_id\": \"1\",\n \"node_state_instruction\": \"Introduce the concept of doing a handstand.\"\n },\n {\n \"node_id\": \"2\",\n \"node_state_instruction\": \"Describe the surprising smell of space.\"\n },\n {\n \"node_id\": \"3\",\n \"node_state_instruction\": \"Introduce a woman using sign language to deter unwanted attention.\"\n },\n {\n \"node_id\": \"4\",\n \"node_state_instruction\": \"Discuss the varied perceptions people have of an individual.\"\n }\n]\n```\n\nPassage:\n```json\n[\n {\n \"node_id\": \"1\",\n \"node_state_instruction\": \"It isn't difficult to do a handstand if you just stand on your hands.\"\n },\n {\n \"node_id\": \"2\",\n \"node_state_instruction\": \"It caught him off guard that space smelled of seared steak.\"\n },\n {\n \"node_id\": \"3\",\n \"node_state_instruction\": \"When she didn’t like a guy who was trying to pick her up, she started using sign language.\"\n },\n {\n \"node_id\": \"4\",\n \"node_state_instruction\": \"Each person who knows you has a different perception of who you are.\"\n }\n]\n```",
|
||||
"Given an instruction and several choices, decide which choice is most promising. Analyze each choice in detail, then conclude in the last line \"The best choice is {s}\", where s the integer id of the choice.\nChoice 4:\nDiscuss the varied perceptions people have of an individual.\n": "Choice 4: Discuss the varied perceptions people have of an individual.\n\nAnalyzing this choice, discussing the varied perceptions people have of an individual can be promising as it allows for a deeper understanding of how different people perceive and interpret the actions, behaviors, and characteristics of an individual. This can lead to insights into the complexities of human interactions and relationships, and can provide valuable information for personal growth and self-awareness.\n\nBy exploring the reasons behind differing perceptions, it can also lead to increased empathy and understanding of others, which is beneficial for building stronger relationships and effective communication.\n\nFurthermore, discussing varied perceptions can also shed light on societal influences, biases, and stereotypes that may impact how individuals are perceived, which can be valuable for promoting inclusivity and diversity.\n\nThe best choice is 4.",
|
||||
"Given an instruction and several choices, decide which choice is most promising. Analyze each choice in detail, then conclude in the last line \"The best choice is {s}\", where s the integer id of the choice.\nChoice 3:\nIntroduce a woman using sign language to deter unwanted attention.\n": "Choice 3: Introduce a woman using sign language to deter unwanted attention.\n\nAnalysis:\nIntroducing a woman using sign language can be a promising choice to deter unwanted attention. Sign language is a visual and expressive form of communication, and it can be an effective way to convey a message without drawing unnecessary attention. By using sign language, the woman can communicate with others discreetly and avoid attracting unwanted attention from individuals who may be seeking to engage her in conversation or interaction.\n\nAdditionally, using sign language can create a sense of privacy and exclusivity, as it may not be easily understood by everyone in the vicinity. This can help the woman maintain a level of personal space and discourage unwelcome advances or interactions.\n\nFurthermore, introducing sign language into the interaction can also serve as a way to promote inclusivity and awareness of different forms of communication, which can contribute to a more understanding and respectful environment.\n\nConclusion:\nThe best choice is 3.",
|
||||
"Given an instruction and several choices, decide which choice is most promising. Analyze each choice in detail, then conclude in the last line \"The best choice is {s}\", where s the integer id of the choice.\nChoice 1:\nIntroduce the concept of doing a handstand.\n": "Choice 1: Introduce the concept of doing a handstand.\n\nAnalyzing the choice:\nIntroducing the concept of doing a handstand can be a fun and engaging way to promote physical activity and coordination. It can also help build strength and balance. However, it's important to ensure that proper safety measures and instructions are provided to prevent any potential injuries.\n\nConclusion:\nThe best choice is 1.",
|
||||
"Given an instruction and several choices, decide which choice is most promising. Analyze each choice in detail, then conclude in the last line \"The best choice is {s}\", where s the integer id of the choice.\nChoice 2:\nDescribe the surprising smell of space.\n": "Choice 2: \n\nThe surprising smell of space has been described by astronauts as a mix of gunpowder, seared steak, hot metal, and raspberries. This unexpected combination of scents is due to the volatile organic compounds that are released from the materials in the spacecraft when they are exposed to the vacuum of space. These compounds react with the radiation from the sun, creating the unique smell that astronauts have reported. The smell of space is intriguing and unexpected, providing a sensory experience that is truly out of this world.\n\nThe best choice is 2.",
|
||||
"\nWrite a coherent passage of 4 short paragraphs. The end sentence of each paragraph must be: Introduce the concept of doing a handstand.\n\nMake a plan then write. Your output should be like:\n\nPlan:\n<Your plan here with json format>\n\nPassage:\n<Your passage here with json format>\n\n\nEach output should be strictly a list of nodes, in json format, like this:\n```json\n [\n {\n \"node_id\": str = \"unique identifier for a solution, can be an ordinal\",\n \"node_state_instruction\": \"specified sample of solution\",\n },\n ...\n ]\n```\n": "Plan:\n```json\n[\n {\n \"node_id\": \"1\",\n \"node_state_instruction\": \"Decide on a suitable location to practice handstands.\"\n },\n {\n \"node_id\": \"2\",\n \"node_state_instruction\": \"Warm up your body with some stretching exercises.\"\n },\n {\n \"node_id\": \"3\",\n \"node_state_instruction\": \"Practice against a wall to build strength and balance.\"\n },\n {\n \"node_id\": \"4\",\n \"node_state_instruction\": \"Gradually work on holding the handstand position without support.\"\n }\n]\n```\n\nPassage:\n```json\n[\n {\n \"node_id\": \"1\",\n \"node_state_instruction\": \"Decide on a suitable location to practice handstands.\"\n },\n {\n \"node_id\": \"2\",\n \"node_state_instruction\": \"Before attempting a handstand, it's important to decide on a suitable location to practice. A clear, open space with a soft surface, such as a yoga mat or grass, is ideal for safety and comfort.\"\n },\n {\n \"node_id\": \"3\",\n \"node_state_instruction\": \"Warm up your body with some stretching exercises.\"\n },\n {\n \"node_id\": \"4\",\n \"node_state_instruction\": \"To prepare your body for the physical demands of a handstand, start with a series of stretching exercises. Focus on the wrists, shoulders, and core muscles to ensure they are adequately warmed up and flexible.\"\n },\n {\n \"node_id\": \"5\",\n \"node_state_instruction\": \"Practice against a wall to build strength and balance.\"\n },\n {\n \"node_id\": \"6\",\n \"node_state_instruction\": \"When learning to do a handstand, it can be helpful to practice against a wall. This provides support and allows you to focus on building strength and balance in the proper alignment. Gradually work on kicking up into the handstand position and holding it for short periods of time.\"\n },\n {\n \"node_id\": \"7\",\n \"node_state_instruction\": \"Gradually work on holding the handstand position without support.\"\n },\n {\n \"node_id\": \"8\",\n \"node_state_instruction\": \"As you gain confidence and strength, begin to practice holding the handstand position without the support of a wall. Focus on engaging your core and maintaining a straight line from your wrists to your hips. With consistent practice, you'll be able to hold a handstand with control and stability.\"\n }\n]\n```",
|
||||
"Given an instruction and several choices, decide which choice is most promising. Analyze each choice in detail, then conclude in the last line \"The best choice is {s}\", where s the integer id of the choice.\nChoice 1:\nDecide on a suitable location to practice handstands.\n": "Choice 1: Find a spacious and flat area with soft ground, such as a grassy field or a padded gym floor. This will minimize the risk of injury and provide a stable surface for practicing handstands.\n\nThe best choice is 1",
|
||||
"Given an instruction and several choices, decide which choice is most promising. Analyze each choice in detail, then conclude in the last line \"The best choice is {s}\", where s the integer id of the choice.\nChoice 2:\nWarm up your body with some stretching exercises.\n": "Stretching exercises are a great way to warm up the body before engaging in physical activity. They help to increase blood flow to the muscles, improve flexibility, and reduce the risk of injury. By performing stretching exercises, you can prepare your body for more strenuous activities and improve your overall performance.\n\nThe best choice is 2.",
|
||||
"Given an instruction and several choices, decide which choice is most promising. Analyze each choice in detail, then conclude in the last line \"The best choice is {s}\", where s the integer id of the choice.\nChoice 3:\nPractice against a wall to build strength and balance.\n": "Choice 3: Practice against a wall to build strength and balance.\n\nAnalyzing choice 3, practicing against a wall can be a promising option for building strength and balance. The wall provides a stable surface to push against, which can help in developing strength in the muscles. It also offers support, allowing for balance practice without the risk of falling. Additionally, using a wall as a tool for practice can help in improving posture and body alignment.\n\nThe best choice is 3.",
|
||||
"Given an instruction and several choices, decide which choice is most promising. Analyze each choice in detail, then conclude in the last line \"The best choice is {s}\", where s the integer id of the choice.\nChoice 4:\nGradually work on holding the handstand position without support.\n": "Choice 4: Gradually work on holding the handstand position without support.\n\nAnalyzing this choice, working on holding the handstand position without support is a promising option for improving strength, balance, and body control. This choice allows for gradual progression, which is important for building the necessary strength and stability to maintain the handstand position. It also encourages the development of proprioception and spatial awareness, which are essential for mastering this challenging skill.\n\nThe best choice is 4.",
|
||||
"\nWrite a coherent passage of 4 short paragraphs. The end sentence of each paragraph must be: Decide on a suitable location to practice handstands.\n\nMake a plan then write. Your output should be like:\n\nPlan:\n<Your plan here with json format>\n\nPassage:\n<Your passage here with json format>\n\n\nEach output should be strictly a list of nodes, in json format, like this:\n```json\n [\n {\n \"node_id\": str = \"unique identifier for a solution, can be an ordinal\",\n \"node_state_instruction\": \"specified sample of solution\",\n },\n ...\n ]\n```\n": "Plan:\n```json\n[\n {\n \"node_id\": \"1\",\n \"node_state_instruction\": \"Decide on a suitable location to practice handstands.\"\n },\n {\n \"node_id\": \"2\",\n \"node_state_instruction\": \"Consider a flat and stable surface, such as a grassy field or a gym mat.\"\n },\n {\n \"node_id\": \"3\",\n \"node_state_instruction\": \"Ensure there is enough space around you to avoid any obstacles.\"\n },\n {\n \"node_id\": \"4\",\n \"node_state_instruction\": \"Practice near a wall or with a spotter for safety.\"\n }\n]\n```\n\nPassage:\n```json\n[\n {\n \"node_id\": \"1\",\n \"node_state_instruction\": \"Decide on a suitable location to practice handstands.\"\n },\n {\n \"node_id\": \"2\",\n \"node_state_instruction\": \"Consider a flat and stable surface, such as a grassy field or a gym mat.\"\n },\n {\n \"node_id\": \"3\",\n \"node_state_instruction\": \"Ensure there is enough space around you to avoid any obstacles.\"\n },\n {\n \"node_id\": \"4\",\n \"node_state_instruction\": \"Practice near a wall or with a spotter for safety.\"\n }\n]\n```",
|
||||
"Given an instruction and several choices, decide which choice is most promising. Analyze each choice in detail, then conclude in the last line \"The best choice is {s}\", where s the integer id of the choice.\nChoice 3:\nEnsure there is enough space around you to avoid any obstacles.\n": "Choice 3: \n\nAnalyzing this choice, ensuring there is enough space around you to avoid any obstacles is a crucial step in maintaining safety and preventing accidents. By creating a buffer zone, you can react to unexpected obstacles or changes in the environment without risking collisions or other hazards.\n\nThe best choice is 3.",
|
||||
"Given an instruction and several choices, decide which choice is most promising. Analyze each choice in detail, then conclude in the last line \"The best choice is {s}\", where s the integer id of the choice.\nChoice 2:\nConsider a flat and stable surface, such as a grassy field or a gym mat.\n": "Choice 2: Considering a flat and stable surface, such as a grassy field or a gym mat, is the most promising option. This choice provides a safe and secure environment for the activity, reducing the risk of injury. A grassy field offers a natural and soft surface, while a gym mat provides cushioning and stability. Both options allow for comfortable movement and can accommodate various physical activities.\n\nThe best choice is 2.",
|
||||
"Given an instruction and several choices, decide which choice is most promising. Analyze each choice in detail, then conclude in the last line \"The best choice is {s}\", where s the integer id of the choice.\nChoice 4:\nPractice near a wall or with a spotter for safety.\n": "Choice 4: \n\nPractice near a wall or with a spotter for safety.\n\nAnalyzing this choice, practicing near a wall or with a spotter provides a safety measure to prevent accidents or injuries. When practicing a new skill or exercise, having a wall nearby can provide support and stability, reducing the risk of falling or losing balance. Similarly, having a spotter can offer assistance and guidance, ensuring that the practice is done safely and effectively.\n\nThe best choice is 4.",
|
||||
"### Requirements\n1. Please summarize the latest dialogue based on the reference information (secondary) and dialogue history (primary). Do not include text that is irrelevant to the conversation.\n- The context is for reference only. If it is irrelevant to the user's search request history, please reduce its reference and usage.\n2. If there are citable links in the context, annotate them in the main text in the format [main text](citation link). If there are none in the context, do not write links.\n3. The reply should be graceful, clear, non-repetitive, smoothly written, and of moderate length, in {LANG}.\n\n### Dialogue History (For example)\nA: MLOps competitors\n\n### Current Question (For example)\nA: MLOps competitors\n\n### Current Reply (For example)\n1. Alteryx Designer: <desc> etc. if any\n2. Matlab: ditto\n3. IBM SPSS Statistics\n4. RapidMiner Studio\n5. DataRobot AI Platform\n6. Databricks Lakehouse Platform\n7. Amazon SageMaker\n8. Dataiku\n#SYSTEM_MSG_END#\n### Reference Information\nABC cleanser is preferred by many with oily skin.\nL'Oreal is a popular brand with many positive reviews.\n\n### Dialogue History\n\nuser: Which facial cleanser is good for oily skin?\n\n### Current Question\nuser: Which facial cleanser is good for oily skin?\n\n### Current Reply: Based on the information, please write the reply to the Question\n\n\n": "Based on the information provided, ABC cleanser is preferred by many with oily skin. It is a popular choice for individuals with oily skin due to its effectiveness. Additionally, L'Oreal is a well-known brand with many positive reviews, and they offer a range of products suitable for oily skin. Both of these options could be good choices for individuals with oily skin."
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue