From 4bc3ffbc5b7d0abaac3cd9d5900541b20a63c198 Mon Sep 17 00:00:00 2001 From: Madhu Date: Thu, 9 Jan 2025 20:32:49 +0530 Subject: [PATCH] working on the output format --- ai_agent_tutorials/ai_chess_game/ai_chess_agents.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ai_agent_tutorials/ai_chess_game/ai_chess_agents.py b/ai_agent_tutorials/ai_chess_game/ai_chess_agents.py index f4d4e8e..b812bd0 100644 --- a/ai_agent_tutorials/ai_chess_game/ai_chess_agents.py +++ b/ai_agent_tutorials/ai_chess_game/ai_chess_agents.py @@ -194,12 +194,9 @@ if st.session_state.openai_api_key: chat_result = player_black.initiate_chat( player_white, message="Let's play chess! You go first, its your move.", - max_turns=100, # Set a high enough number to allow the game to complete + max_turns=5, # Set a high enough number to allow the game to complete ) - st.write(chat_result) + st.markdown(chat_result.summary) - # Display the chessboard SVG - if st.session_state.board_svg: - st.image(st.session_state.board_svg, caption="Chess Board", use_column_width=True) else: st.warning("Please enter your OpenAI API key in the sidebar to start the game.") \ No newline at end of file