-
Notifications
You must be signed in to change notification settings - Fork 1
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
PR for Haohan Wang #mJFFXbiuNwBCWMunRjVW #656
base: main
Are you sure you want to change the base?
Conversation
Logging: initLogging: initLogging: on_chain_startSerialized:{ inputs:{ Logging: on_chat_model_startSerialized:{ message:[[SystemMessage(content='You are a helpful AI assistant.', additional_kwargs={}), HumanMessage(content='You can use the ability with id Logging: on_llm_endgenerations=[[ChatGeneration(text='', generation_info={'finish_reason': 'function_call'}, message=AIMessage(content='', additional_kwargs={'function_call': {'name': 'run_ability', 'arguments': '{\n "ability_id": "gpt_engineer",\n "ability_args": "Write me a fun snake game in Python."\n}'}}, example=False))]] llm_output={'token_usage': <OpenAIObject at 0x7f579c611490> JSON: { Logging: on_agent_actionTool used:run_ability Tool input:{ Additional log:Invoking: Logging: on_chat_model_startSerialized:{ message:[[SystemMessage(content='You are a helpful AI assistant.', additional_kwargs={}), HumanMessage(content='You can use the ability with id Logging: on_llm_endgenerations=[[ChatGeneration(text='', generation_info={'finish_reason': 'function_call'}, message=AIMessage(content='', additional_kwargs={'function_call': {'name': 'run_ability', 'arguments': '{\n "ability_id": "8x5joFx3uMt4CcLnoc8s",\n "ability_args": "Design the software of a fun snake game in Python."\n}'}}, example=False))]] llm_output={'token_usage': <OpenAIObject at 0x7f579c610230> JSON: { Logging: on_agent_actionTool used:run_ability Tool input:{ Additional log:Invoking: Logging: on_chat_model_startSerialized:{ message:[[SystemMessage(content='You are a helpful AI assistant.', additional_kwargs={}), HumanMessage(content='You can use the ability with id Logging: on_llm_endgenerations=[[ChatGeneration(text="Here is the Python code for a simple text-based snake game:\n\n Logging: on_agent_finishReturn values:{ Additional logs:Here is the Python code for a simple text-based snake game: import random
import curses
s = curses.initscr()
curses.curs_set(0)
sh, sw = s.getmaxyx()
w = curses.newwin(sh, sw, 0, 0)
w.keypad(1)
w.timeout(100)
snk_x = sw//4
snk_y = sh//2
snake = [
[snk_y, snk_x],
[snk_y, snk_x-1],
[snk_y, snk_x-2]
]
food = [sh//2, sw//2]
w.addch(int(food[0]), int(food[1]), curses.ACS_PI)
score = 0
key = curses.KEY_RIGHT
while True:
next_key = w.getch()
key = key if next_key == -1 else next_key
if snake[0][0] in [0, sh] or \
snake[0][1] in [0, sw] or \
snake[0] in snake[1:]:
curses.endwin()
quit()
new_head = [snake[0][0], snake[0][1]]
if key == curses.KEY_DOWN:
new_head[0] += 1
if key == curses.KEY_UP:
new_head[0] -= 1
if key == curses.KEY_LEFT:
new_head[1] -= 1
if key == curses.KEY_RIGHT:
new_head[1] += 1
snake.insert(0, new_head)
if snake[0] == food:
score += 1
food = None
while food is None:
nf = [
random.randint(1, sh-1),
random.randint(1, sw-1)
]
food = nf if nf not in snake else None
w.addch(food[0], food[1], curses.ACS_PI)
else:
tail = snake.pop()
w.addch(int(tail[0]), int(tail[1]), ' ')
w.addch(int(snake[0][0]), int(snake[0][1]), curses.ACS_CKBOARD) This game is designed to be simple and fun. The snake is controlled using the arrow keys. The game ends when the snake hits the edge of the screen or itself. The score increases by one point each time the snake eats a fruit, which is represented by the π symbol. The game does not get progressively harder, and there are no additional features such as power-ups, different levels, or multiplayer mode. To run the game, you would need to install the curses library using pip, and then run the Python script.## Logging: on_chain_end |
You can use the ability with id
gpt_engineer
as an AI software engineer, theability_args
for this ability must be non-empty. Just pass in your request for a software feature as a string toability_args
(but you have to escape certain special characters such as'
and"
becauseability_args
are passed in a Linux command line terminal). Keep in mind that thisgpt_engineer
ability does not have access to the information that you have, so you must provide it with all the necessary information inability_args
.You can use the ability with id
8x5joFx3uMt4CcLnoc8s
as an AI software company that has numerous roles and can accomplish any SaaS-related tasks, theability_args
for this ability must be non-empty. Just pass in your request for a software feature as a string toability_args
(but you have to escape certain special characters such as'
and"
becauseability_args
are passed in a Linux command line terminal). Keep in mind that this8x5joFx3uMt4CcLnoc8s
ability does not have access to the information that you have, so you must provide it with all the necessary information inability_args
.When you try to accomplish a given task, you should always do the following two steps in order:
gpt_engineer
to write out the source code.8x5joFx3uMt4CcLnoc8s
to first design the software of the product.md
files andmmd
(nmermaid) files.Now do the following task:
Write me a fun snake game in Python.
Gothub's Answer: Here is the Python code for a simple text-based snake game:
This game is designed to be simple and fun. The snake is controlled using the arrow keys. The game ends when the snake hits the edge of the screen or itself. The score increases by one point each time the snake eats a fruit, which is represented by the π symbol. The game does not get progressively harder, and there are no additional features such as power-ups, different levels, or multiplayer mode.
To run the game, you would need to install the curses library using pip, and then run the Python script.