diff --git a/examples/ai_testing/my_games/current_session.txt b/examples/ai_testing/my_games/current_session.txt index fd9d452c95c6e5e7b875313a547a6b859296b0d5..757a1b165c15835bfee6b0442d2ff83431a31e91 100644 --- a/examples/ai_testing/my_games/current_session.txt +++ b/examples/ai_testing/my_games/current_session.txt @@ -1 +1 @@ -session_20260109_012437 \ No newline at end of file +session_20260109_020107 \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_012855/session_metadata.json b/examples/ai_testing/my_games/session_20260109_012855/session_metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..4b5031af3877beee35ee9efd98a352882cebc0f4 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_012855/session_metadata.json @@ -0,0 +1,5 @@ +{ + "session_id": "session_20260109_012855", + "start_time": "2026-01-09T01:28:55.056428", + "version": "2.0" +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_012855/shon/prompts/prompt_1.json b/examples/ai_testing/my_games/session_20260109_012855/shon/prompts/prompt_1.json new file mode 100644 index 0000000000000000000000000000000000000000..b34f94b5d37032f77cf0a73cb247c967bea849ef --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_012855/shon/prompts/prompt_1.json @@ -0,0 +1,95 @@ +{ + "request_number": 1, + "timestamp": "2026-01-09T01:28:57.110751", + "player_name": "shon", + "is_active_turn": true, + "prompt": { + "meta_data": { + "agent_name": "shon", + "role": null + }, + "task_context": { + "what_just_happened": "• Game cb410a08-2275-41fa-b710-0d0934949b49 has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"shon\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[],\"rds\":[]},\"players\":{\"shon\":{\"vp\":0,\"res\":{}},\"levin\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } + }, + "response_schema": { + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] + }, + "what_happened": "• Game cb410a08-2275-41fa-b710-0d0934949b49 has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_012855/shon/prompts/prompt_1.txt b/examples/ai_testing/my_games/session_20260109_012855/shon/prompts/prompt_1.txt new file mode 100644 index 0000000000000000000000000000000000000000..e15c61ab86dfb873d90fc9e0074ee79f65533ed3 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_012855/shon/prompts/prompt_1.txt @@ -0,0 +1,87 @@ +=== Prompt #1 for shon === +Timestamp: 2026-01-09T01:28:57.112291 +Active Turn: True + +--- What Happened --- +• Game cb410a08-2275-41fa-b710-0d0934949b49 has started with 2 players! +• Turn 0: Player 0's turn begins. + +--- Response Schema --- +{ + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] +} + +--- Prompt Content --- +{ + "meta_data": { + "agent_name": "shon", + "role": null + }, + "task_context": { + "what_just_happened": "• Game cb410a08-2275-41fa-b710-0d0934949b49 has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"shon\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[],\"rds\":[]},\"players\":{\"shon\":{\"vp\":0,\"res\":{}},\"levin\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } +} diff --git a/examples/ai_testing/my_games/session_20260109_012855/shon/prompts/prompt_2.json b/examples/ai_testing/my_games/session_20260109_012855/shon/prompts/prompt_2.json new file mode 100644 index 0000000000000000000000000000000000000000..1f54bd2e7e6fa88e33ecbaf767d7dff6a8b1088f --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_012855/shon/prompts/prompt_2.json @@ -0,0 +1,95 @@ +{ + "request_number": 2, + "timestamp": "2026-01-09T01:29:59.377539", + "player_name": "shon", + "is_active_turn": true, + "prompt": { + "meta_data": { + "agent_name": "shon", + "role": null + }, + "task_context": { + "what_just_happened": "• Game cb410a08-2275-41fa-b710-0d0934949b49 has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"shon\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[],\"rds\":[]},\"players\":{\"shon\":{\"vp\":0,\"res\":{}},\"levin\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } + }, + "response_schema": { + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] + }, + "what_happened": "• Game cb410a08-2275-41fa-b710-0d0934949b49 has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_012855/shon/prompts/prompt_2.txt b/examples/ai_testing/my_games/session_20260109_012855/shon/prompts/prompt_2.txt new file mode 100644 index 0000000000000000000000000000000000000000..e7f831b08ff6ed5f514f61759db236d77e60bd40 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_012855/shon/prompts/prompt_2.txt @@ -0,0 +1,87 @@ +=== Prompt #2 for shon === +Timestamp: 2026-01-09T01:29:59.378581 +Active Turn: True + +--- What Happened --- +• Game cb410a08-2275-41fa-b710-0d0934949b49 has started with 2 players! +• Turn 0: Player 0's turn begins. + +--- Response Schema --- +{ + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] +} + +--- Prompt Content --- +{ + "meta_data": { + "agent_name": "shon", + "role": null + }, + "task_context": { + "what_just_happened": "• Game cb410a08-2275-41fa-b710-0d0934949b49 has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"shon\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[],\"rds\":[]},\"players\":{\"shon\":{\"vp\":0,\"res\":{}},\"levin\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } +} diff --git a/examples/ai_testing/my_games/session_20260109_012855/shon/responses/response_1.json b/examples/ai_testing/my_games/session_20260109_012855/shon/responses/response_1.json new file mode 100644 index 0000000000000000000000000000000000000000..8528ef399eda79f0aaacf2dafae9c7bad014fc67 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_012855/shon/responses/response_1.json @@ -0,0 +1,24 @@ +{ + "request_number": 1, + "timestamp": "2026-01-09T01:29:20.221926", + "player_name": "shon", + "success": true, + "raw_content": "{\"internal_thinking\": \"The game is in the first setup round, so I need to place my first settlement. My strategy is to choose a node that provides a good mix of essential resources (Wood, Brick, Sheep, Wheat, Ore) with high-probability numbers (6s and 8s are best, followed by 5s and 9s). I analyzed the hexes and nodes to find the best spot. Node 20 connects to Hex 9 (W11), Hex 5 (B6), and Hex 4 (S8). This provides Wood, Brick, and Sheep. The numbers are 11 (low), 6 (high), and 8 (high). This gives me two high-probability resources (Brick and Sheep) and a source of Wood, which is crucial for early expansion (roads and settlements). Other strong nodes were considered, such as Node 42 (Wh9, O5, Wh9), which offers great Wheat and Ore, but lacks Wood, Brick, and Sheep, making early expansion difficult. Node 20 offers a balanced start for building and expanding.\", \"action\": {\"type\": \"place_starting_settlement\", \"parameters\": \"{\\\"node\\\": 20}\"}}", + "parsed": { + "internal_thinking": "The game is in the first setup round, so I need to place my first settlement. My strategy is to choose a node that provides a good mix of essential resources (Wood, Brick, Sheep, Wheat, Ore) with high-probability numbers (6s and 8s are best, followed by 5s and 9s). I analyzed the hexes and nodes to find the best spot. Node 20 connects to Hex 9 (W11), Hex 5 (B6), and Hex 4 (S8). This provides Wood, Brick, and Sheep. The numbers are 11 (low), 6 (high), and 8 (high). This gives me two high-probability resources (Brick and Sheep) and a source of Wood, which is crucial for early expansion (roads and settlements). Other strong nodes were considered, such as Node 42 (Wh9, O5, Wh9), which offers great Wheat and Ore, but lacks Wood, Brick, and Sheep, making early expansion difficult. Node 20 offers a balanced start for building and expanding. [Response was too brief]", + "note_to_self": null, + "say_outloud": null, + "action_type": "place_starting_settlement", + "parameters": { + "node": 20 + } + }, + "model": "gemini-2.5-flash", + "tokens": { + "prompt": 1631, + "completion": 258, + "total": 7126 + }, + "latency_seconds": 21.840165376663208, + "error": null +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_012855/shon/responses/response_2.json b/examples/ai_testing/my_games/session_20260109_012855/shon/responses/response_2.json new file mode 100644 index 0000000000000000000000000000000000000000..dc71495e67a16d6c82e07244d96976dae7027d98 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_012855/shon/responses/response_2.json @@ -0,0 +1,24 @@ +{ + "request_number": 2, + "timestamp": "2026-01-09T01:30:17.319638", + "player_name": "shon", + "success": true, + "raw_content": "{\n \"internal_thinking\": \"I am in the first round of setup and need to place my initial settlement. My priority is to maximize resource production for early game expansion. I analyzed the hexes and nodes to find a location with high-probability numbers (6, 8) and a good variety of resources. Node 20, which connects to Hexes 9 (W11), 5 (B6), and 4 (S8), offers Wood, Brick, and Sheep with production numbers 11, 6, and 8 respectively. The total 'pips' (probability points) for these numbers (2+5+5=12) is among the highest available, and the resource combination (Wood, Brick, Sheep) is excellent for building roads and additional settlements early on. This balanced start will allow for flexible development.\",\n \"action\": {\n \"type\": \"place_starting_settlement\",\n \"parameters\": \"{\\\"node\\\": 20}\"\n }\n}", + "parsed": { + "internal_thinking": "I am in the first round of setup and need to place my initial settlement. My priority is to maximize resource production for early game expansion. I analyzed the hexes and nodes to find a location with high-probability numbers (6, 8) and a good variety of resources. Node 20, which connects to Hexes 9 (W11), 5 (B6), and 4 (S8), offers Wood, Brick, and Sheep with production numbers 11, 6, and 8 respectively. The total 'pips' (probability points) for these numbers (2+5+5=12) is among the highest available, and the resource combination (Wood, Brick, Sheep) is excellent for building roads and additional settlements early on. This balanced start will allow for flexible development. [Response was too brief]", + "note_to_self": null, + "say_outloud": null, + "action_type": "place_starting_settlement", + "parameters": { + "node": 20 + } + }, + "model": "gemini-2.5-flash", + "tokens": { + "prompt": 1631, + "completion": 215, + "total": 5866 + }, + "latency_seconds": 17.936803579330444, + "error": null +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_012855/shon/shon.md b/examples/ai_testing/my_games/session_20260109_012855/shon/shon.md new file mode 100644 index 0000000000000000000000000000000000000000..20a3b5607869f0217551b43bcd17e4105be47247 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_012855/shon/shon.md @@ -0,0 +1,46 @@ +# AI Agent Log: shon + +**Session:** session_20260109_012855 +**Started:** 2026-01-09 01:28:55 +**Model:** gemini-2.0-flash + +--- + + +## Request #1 - 🎯 ACTIVE TURN + +**Time:** 01:28:57 + +### What Happened +• Game cb410a08-2275-41fa-b710-0d0934949b49 has started with 2 players! +• Turn 0: Player 0's turn begins. + +### Prompt Sent +See: [prompt_1.json](prompts/prompt_1.json) + +### Response Received ✅ + +**Latency:** 21.84s | **Tokens:** 7126 + +**Thinking:** The game is in the first setup round, so I need to place my first settlement. My strategy is to choose a node that provides a good mix of essential resources (Wood, Brick, Sheep, Wheat, Ore) with high... + +--- + +## Request #2 - 🎯 ACTIVE TURN + +**Time:** 01:29:59 + +### What Happened +• Game cb410a08-2275-41fa-b710-0d0934949b49 has started with 2 players! +• Turn 0: Player 0's turn begins. + +### Prompt Sent +See: [prompt_2.json](prompts/prompt_2.json) + +### Response Received ✅ + +**Latency:** 17.94s | **Tokens:** 5866 + +**Thinking:** I am in the first round of setup and need to place my initial settlement. My priority is to maximize resource production for early game expansion. I analyzed the hexes and nodes to find a location wit... + +--- diff --git a/examples/ai_testing/my_games/session_20260109_013405/A/A.md b/examples/ai_testing/my_games/session_20260109_013405/A/A.md new file mode 100644 index 0000000000000000000000000000000000000000..8fd568cf19db87ac8eba7ba8cb9a0d85d48c70be --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/A/A.md @@ -0,0 +1,105 @@ +# AI Agent Log: A + +**Session:** session_20260109_013405 +**Started:** 2026-01-09 01:34:05 +**Model:** gemini-2.0-flash + +--- + + +## Request #1 - 🎯 ACTIVE TURN + +**Time:** 01:34:07 + +### What Happened +• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players! +• Turn 0: Player 0's turn begins. + +### Prompt Sent +See: [prompt_1.json](prompts/prompt_1.json) + +### Response Received ✅ + +**Latency:** 17.18s | **Tokens:** 5528 + +**Thinking:** I am player 'A' in the first round of setup. My goal is to place my first settlement on a node that provides good resource diversity and high probability numbers. I evaluated several nodes connected t... + +--- + +## Request #2 - 🎯 ACTIVE TURN + +**Time:** 01:34:56 + +### What Happened +• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT + +### Prompt Sent +See: [prompt_2.json](prompts/prompt_2.json) + +### Response Received ✅ + +**Latency:** 12.29s | **Tokens:** 4383 + +**Thinking:** My first settlement is at Node 20, which provides Wood (11), Brick (6), and Sheep (8). For my starting road, I need to choose a path that maximizes my access to resources and potential future expansio... + +--- + +## Request #3 - 🎯 ACTIVE TURN + +**Time:** 01:38:07 + +### What Happened +• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 0 performed action: ActionType.PLACE_STARTING_ROAD +• Turn 1: Player 1's turn begins. +• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 1 performed action: ActionType.PLACE_STARTING_ROAD +• First round of setup complete! Starting second round (reverse order). +• Turn 2: Player 1's turn begins. +• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 1 performed action: ActionType.PLACE_STARTING_ROAD +• Turn 3: Player 0's turn begins. + +### Prompt Sent +See: [prompt_3.json](prompts/prompt_3.json) + +### Response Received ✅ + +**Latency:** 43.19s | **Tokens:** 12184 + +**Thinking:** The game is in the second round of setup, and it's my turn to place the second settlement. My first settlement at Node 20 provides Wood (11), Brick (6), and Sheep (8). For balanced development, I need... + +--- + +## Request #4 - 🎯 ACTIVE TURN + +**Time:** 01:39:47 + +### What Happened +• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 0 performed action: ActionType.PLACE_STARTING_ROAD +• Turn 1: Player 1's turn begins. +• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 1 performed action: ActionType.PLACE_STARTING_ROAD +• First round of setup complete! Starting second round (reverse order). +• Turn 2: Player 1's turn begins. +• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 1 performed action: ActionType.PLACE_STARTING_ROAD +• Turn 3: Player 0's turn begins. + +### Prompt Sent +See: [prompt_4.json](prompts/prompt_4.json) + +### Response Received ✅ + +**Latency:** 35.10s | **Tokens:** 10706 + +**Thinking:** I am Player 'A' and it's my turn in the second round of setup. I need to place my second settlement and an accompanying road. My first settlement is at Node 20, yielding Wood (11), Brick (6), and Shee... + +--- diff --git a/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_1.json b/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_1.json new file mode 100644 index 0000000000000000000000000000000000000000..521484ae158928a6b953bcdabad379b6f771c794 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_1.json @@ -0,0 +1,95 @@ +{ + "request_number": 1, + "timestamp": "2026-01-09T01:34:07.313276", + "player_name": "A", + "is_active_turn": true, + "prompt": { + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[],\"rds\":[]},\"players\":{\"A\":{\"vp\":0,\"res\":{}},\"B\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } + }, + "response_schema": { + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] + }, + "what_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_1.txt b/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_1.txt new file mode 100644 index 0000000000000000000000000000000000000000..c008374d2a3a2c7903a4be149e49cf81ca39bdce --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_1.txt @@ -0,0 +1,87 @@ +=== Prompt #1 for A === +Timestamp: 2026-01-09T01:34:07.314345 +Active Turn: True + +--- What Happened --- +• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players! +• Turn 0: Player 0's turn begins. + +--- Response Schema --- +{ + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] +} + +--- Prompt Content --- +{ + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[],\"rds\":[]},\"players\":{\"A\":{\"vp\":0,\"res\":{}},\"B\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } +} diff --git a/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_2.json b/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_2.json new file mode 100644 index 0000000000000000000000000000000000000000..3c37aa4840c97491831c78c6c93056c78a6546ae --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_2.json @@ -0,0 +1,95 @@ +{ + "request_number": 2, + "timestamp": "2026-01-09T01:34:56.828560", + "player_name": "A", + "is_active_turn": true, + "prompt": { + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[20,\"A\",\"S\"]],\"rds\":[]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_road", + "description": "Place your starting road", + "example_parameters": "{\"from\": X, \"to\": Y}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } + }, + "response_schema": { + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] + }, + "what_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT", + "allowed_actions": [ + { + "type": "place_starting_road", + "description": "Place your starting road", + "example_parameters": "{\"from\": X, \"to\": Y}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_2.txt b/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_2.txt new file mode 100644 index 0000000000000000000000000000000000000000..74fdf0a5642a52441b7a92c89fb9e809d229d49a --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_2.txt @@ -0,0 +1,88 @@ +=== Prompt #2 for A === +Timestamp: 2026-01-09T01:34:56.829556 +Active Turn: True + +--- What Happened --- +• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT + +--- Response Schema --- +{ + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] +} + +--- Prompt Content --- +{ + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[20,\"A\",\"S\"]],\"rds\":[]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_road", + "description": "Place your starting road", + "example_parameters": "{\"from\": X, \"to\": Y}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } +} diff --git a/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_3.json b/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_3.json new file mode 100644 index 0000000000000000000000000000000000000000..380eadcfafb14110d5b1f789dd4595e6b375bac5 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_3.json @@ -0,0 +1,95 @@ +{ + "request_number": 3, + "timestamp": "2026-01-09T01:38:07.937524", + "player_name": "A", + "is_active_turn": true, + "prompt": { + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• First round of setup complete! Starting second round (reverse order).\n• Turn 2: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 3: Player 0's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_SECOND_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[20,\"A\",\"S\"],[25,\"B\",\"S\"],[31,\"B\",\"S\"]],\"rds\":[[[20,10],\"A\"],[[31,41],\"B\"],[[30,31],\"B\"]]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":2,\"res\":{\"O\":1,\"Wh\":1,\"S\":1}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } + }, + "response_schema": { + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] + }, + "what_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• First round of setup complete! Starting second round (reverse order).\n• Turn 2: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 3: Player 0's turn begins.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_3.txt b/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_3.txt new file mode 100644 index 0000000000000000000000000000000000000000..e790df7c992635a101df1a32d2a598d8502c40d1 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_3.txt @@ -0,0 +1,97 @@ +=== Prompt #3 for A === +Timestamp: 2026-01-09T01:38:07.939973 +Active Turn: True + +--- What Happened --- +• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 0 performed action: ActionType.PLACE_STARTING_ROAD +• Turn 1: Player 1's turn begins. +• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 1 performed action: ActionType.PLACE_STARTING_ROAD +• First round of setup complete! Starting second round (reverse order). +• Turn 2: Player 1's turn begins. +• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 1 performed action: ActionType.PLACE_STARTING_ROAD +• Turn 3: Player 0's turn begins. + +--- Response Schema --- +{ + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] +} + +--- Prompt Content --- +{ + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• First round of setup complete! Starting second round (reverse order).\n• Turn 2: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 3: Player 0's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_SECOND_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[20,\"A\",\"S\"],[25,\"B\",\"S\"],[31,\"B\",\"S\"]],\"rds\":[[[20,10],\"A\"],[[31,41],\"B\"],[[30,31],\"B\"]]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":2,\"res\":{\"O\":1,\"Wh\":1,\"S\":1}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } +} diff --git a/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_4.json b/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_4.json new file mode 100644 index 0000000000000000000000000000000000000000..484ba0a166ec44107758633c711f5af9fd6c5b6a --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_4.json @@ -0,0 +1,95 @@ +{ + "request_number": 4, + "timestamp": "2026-01-09T01:39:47.190202", + "player_name": "A", + "is_active_turn": true, + "prompt": { + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• First round of setup complete! Starting second round (reverse order).\n• Turn 2: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 3: Player 0's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_SECOND_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[20,\"A\",\"S\"],[25,\"B\",\"S\"],[31,\"B\",\"S\"]],\"rds\":[[[20,10],\"A\"],[[31,41],\"B\"],[[30,31],\"B\"]]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":2,\"res\":{\"O\":1,\"Wh\":1,\"S\":1}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } + }, + "response_schema": { + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] + }, + "what_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• First round of setup complete! Starting second round (reverse order).\n• Turn 2: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 3: Player 0's turn begins.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_4.txt b/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_4.txt new file mode 100644 index 0000000000000000000000000000000000000000..7b71b4880cd67085ea3f432f707609725af5917b --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/A/prompts/prompt_4.txt @@ -0,0 +1,97 @@ +=== Prompt #4 for A === +Timestamp: 2026-01-09T01:39:47.191437 +Active Turn: True + +--- What Happened --- +• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 0 performed action: ActionType.PLACE_STARTING_ROAD +• Turn 1: Player 1's turn begins. +• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 1 performed action: ActionType.PLACE_STARTING_ROAD +• First round of setup complete! Starting second round (reverse order). +• Turn 2: Player 1's turn begins. +• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 1 performed action: ActionType.PLACE_STARTING_ROAD +• Turn 3: Player 0's turn begins. + +--- Response Schema --- +{ + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] +} + +--- Prompt Content --- +{ + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• First round of setup complete! Starting second round (reverse order).\n• Turn 2: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 3: Player 0's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_SECOND_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[20,\"A\",\"S\"],[25,\"B\",\"S\"],[31,\"B\",\"S\"]],\"rds\":[[[20,10],\"A\"],[[31,41],\"B\"],[[30,31],\"B\"]]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":2,\"res\":{\"O\":1,\"Wh\":1,\"S\":1}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } +} diff --git a/examples/ai_testing/my_games/session_20260109_013405/A/responses/response_1.json b/examples/ai_testing/my_games/session_20260109_013405/A/responses/response_1.json new file mode 100644 index 0000000000000000000000000000000000000000..9f39e9c34aa04a6a154bd27e78103371282e3049 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/A/responses/response_1.json @@ -0,0 +1,24 @@ +{ + "request_number": 1, + "timestamp": "2026-01-09T01:34:25.763428", + "player_name": "A", + "success": true, + "raw_content": "{\n \"internal_thinking\": \"I am player 'A' in the first round of setup. My goal is to place my first settlement on a node that provides good resource diversity and high probability numbers. I evaluated several nodes connected to three hexes, prioritizing those with no desert. Node 20 (W11, B6, S8) offers Wood, Brick, and Sheep with numbers 11, 6, and 8, giving it a high total pip count and a strong foundation for building roads and settlements early in the game. This resource combination is excellent for initial expansion. I will aim to secure Wheat and Ore with my second settlement.\",\n \"action\": {\n \"type\": \"place_starting_settlement\",\n \"parameters\": \"{\\\"node\\\": 20}\"\n }\n}", + "parsed": { + "internal_thinking": "I am player 'A' in the first round of setup. My goal is to place my first settlement on a node that provides good resource diversity and high probability numbers. I evaluated several nodes connected to three hexes, prioritizing those with no desert. Node 20 (W11, B6, S8) offers Wood, Brick, and Sheep with numbers 11, 6, and 8, giving it a high total pip count and a strong foundation for building roads and settlements early in the game. This resource combination is excellent for initial expansion. I will aim to secure Wheat and Ore with my second settlement. [Response was too brief]", + "note_to_self": null, + "say_outloud": null, + "action_type": "place_starting_settlement", + "parameters": { + "node": 20 + } + }, + "model": "gemini-2.5-flash", + "tokens": { + "prompt": 1626, + "completion": 174, + "total": 5528 + }, + "latency_seconds": 17.184014558792114, + "error": null +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_013405/A/responses/response_2.json b/examples/ai_testing/my_games/session_20260109_013405/A/responses/response_2.json new file mode 100644 index 0000000000000000000000000000000000000000..72702ed5f2599945f36f5464b9e59a5b19e601ef --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/A/responses/response_2.json @@ -0,0 +1,25 @@ +{ + "request_number": 2, + "timestamp": "2026-01-09T01:35:09.124518", + "player_name": "A", + "success": true, + "raw_content": "{\"internal_thinking\":\"My first settlement is at Node 20, which provides Wood (11), Brick (6), and Sheep (8). For my starting road, I need to choose a path that maximizes my access to resources and potential future expansion. I have three options: connect to Node 19, Node 21, or Node 10.Connecting to Node 21 leads to a desert hex, which is not optimal.Between Node 19 and Node 10:Node 19: Provides Wood (11), Brick (10), Sheep (8). This path could lead to Node 30 (heavy brick) or Node 8 (a ?3 port with only Sheep 8).Node 10: Provides Brick (6), Sheep (8), Wood (12). This path could lead to Node 11 (Brick 6, Sheep 5, Wood 12) or Node 9 (a ?3 port with Sheep 8, Wood 12).Node 10 path is superior because it gives access to Wood 12, which is a strong resource. Furthermore, the ?3 port at Node 9 is connected to two resources (S8, W12), making it a more valuable port to expand towards compared to Node 8 which only connects to S8. This option provides a better mix of resources and a more promising expansion route for future settlements and port access.\",\"action\":{\"type\":\"place_starting_road\",\"parameters\":\"{\\\"from\\\": 20, \\\"to\\\": 10}\"}}", + "parsed": { + "internal_thinking": "My first settlement is at Node 20, which provides Wood (11), Brick (6), and Sheep (8). For my starting road, I need to choose a path that maximizes my access to resources and potential future expansion. I have three options: connect to Node 19, Node 21, or Node 10.Connecting to Node 21 leads to a desert hex, which is not optimal.Between Node 19 and Node 10:Node 19: Provides Wood (11), Brick (10), Sheep (8). This path could lead to Node 30 (heavy brick) or Node 8 (a ?3 port with only Sheep 8).Node 10: Provides Brick (6), Sheep (8), Wood (12). This path could lead to Node 11 (Brick 6, Sheep 5, Wood 12) or Node 9 (a ?3 port with Sheep 8, Wood 12).Node 10 path is superior because it gives access to Wood 12, which is a strong resource. Furthermore, the ?3 port at Node 9 is connected to two resources (S8, W12), making it a more valuable port to expand towards compared to Node 8 which only connects to S8. This option provides a better mix of resources and a more promising expansion route for future settlements and port access.", + "note_to_self": null, + "say_outloud": null, + "action_type": "place_starting_road", + "parameters": { + "from": 20, + "to": 10 + } + }, + "model": "gemini-2.5-flash", + "tokens": { + "prompt": 1658, + "completion": 329, + "total": 4383 + }, + "latency_seconds": 12.291218996047974, + "error": null +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_013405/A/responses/response_3.json b/examples/ai_testing/my_games/session_20260109_013405/A/responses/response_3.json new file mode 100644 index 0000000000000000000000000000000000000000..34c6a699aee48e30e1cedfb76ce3792b5ea3db43 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/A/responses/response_3.json @@ -0,0 +1,24 @@ +{ + "request_number": 3, + "timestamp": "2026-01-09T01:38:51.136761", + "player_name": "A", + "success": true, + "raw_content": "{\"internal_thinking\": \"The game is in the second round of setup, and it's my turn to place the second settlement. My first settlement at Node 20 provides Wood (11), Brick (6), and Sheep (8). For balanced development, I need to prioritize acquiring Wheat and Ore, as these are crucial for building cities and development cards. I first identified all nodes that are unplaceable due to existing settlements (my own at 20, and Player B's at 25 and 31) and the 'at least two nodes away' rule. The unplaceable nodes are 10, 16, 19, 20, 21, 24, 25, 27, 30, 31, 32. I then evaluated available nodes for their resource yields, focusing on Wheat and Ore with good numbers (5, 6, 8, 9, 10). Node 41 stands out as the optimal choice, providing Ore (5) and Wheat (9), along with additional Brick (10). This gives me a well-rounded resource income: Wood (11), Brick (6, 10), Sheep (8), Wheat (9), and Ore (5). This setup is ideal for future expansion and purchasing development cards. The next action will be to place a road connected to this settlement, and I will aim for Node 40 to connect to the Wood 2:1 port.\", \"action\": {\"type\": \"place_starting_settlement\", \"parameters\": \"{\\\"node\\\": 41}\"}}", + "parsed": { + "internal_thinking": "The game is in the second round of setup, and it's my turn to place the second settlement. My first settlement at Node 20 provides Wood (11), Brick (6), and Sheep (8). For balanced development, I need to prioritize acquiring Wheat and Ore, as these are crucial for building cities and development cards. I first identified all nodes that are unplaceable due to existing settlements (my own at 20, and Player B's at 25 and 31) and the 'at least two nodes away' rule. The unplaceable nodes are 10, 16, 19, 20, 21, 24, 25, 27, 30, 31, 32. I then evaluated available nodes for their resource yields, focusing on Wheat and Ore with good numbers (5, 6, 8, 9, 10). Node 41 stands out as the optimal choice, providing Ore (5) and Wheat (9), along with additional Brick (10). This gives me a well-rounded resource income: Wood (11), Brick (6, 10), Sheep (8), Wheat (9), and Ore (5). This setup is ideal for future expansion and purchasing development cards. The next action will be to place a road connected to this settlement, and I will aim for Node 40 to connect to the Wood 2:1 port.", + "note_to_self": null, + "say_outloud": null, + "action_type": "place_starting_settlement", + "parameters": { + "node": 41 + } + }, + "model": "gemini-2.5-flash", + "tokens": { + "prompt": 1864, + "completion": 343, + "total": 12184 + }, + "latency_seconds": 43.19273257255554, + "error": null +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_013405/A/responses/response_4.json b/examples/ai_testing/my_games/session_20260109_013405/A/responses/response_4.json new file mode 100644 index 0000000000000000000000000000000000000000..b15cf9948cf0099e69058def7d8b0e53436bd63a --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/A/responses/response_4.json @@ -0,0 +1,24 @@ +{ + "request_number": 4, + "timestamp": "2026-01-09T01:40:22.291707", + "player_name": "A", + "success": true, + "raw_content": "{\"internal_thinking\": \"I am Player 'A' and it's my turn in the second round of setup. I need to place my second settlement and an accompanying road. My first settlement is at Node 20, yielding Wood (11), Brick (6), and Sheep (8). For my second settlement, I prioritize resource diversity, specifically Wheat and Ore, to enable building cities and development cards early. I must place the settlement on an unblocked node (not occupied by another settlement and not adjacent to any existing settlement). I identified all blocked nodes: {10, 14, 19, 20, 21, 24, 25, 27, 30, 31, 32}. I evaluated several unblocked nodes. Node 35 (connected to Hexes H[15]=\\\"Wh6\\\", H[11]=\\\"O3\\\", H[10]=\\\"D\\\") yields Wheat (6) and Ore (3). This choice provides me with all five resources (Wood, Brick, Sheep, Wheat, Ore) with good numbers (11, 6, 8, 6, 3), which is crucial for a balanced early game economy and flexibility. I confirmed that Node 35 is not in the blocked list and none of its neighbors ([34, 36, 23]) are in the blocked list, making it a valid placement.\", \"action\": {\"type\": \"place_starting_settlement\", \"parameters\": \"{\\\"node\\\": 35}\"}}", + "parsed": { + "internal_thinking": "I am Player 'A' and it's my turn in the second round of setup. I need to place my second settlement and an accompanying road. My first settlement is at Node 20, yielding Wood (11), Brick (6), and Sheep (8). For my second settlement, I prioritize resource diversity, specifically Wheat and Ore, to enable building cities and development cards early. I must place the settlement on an unblocked node (not occupied by another settlement and not adjacent to any existing settlement). I identified all blocked nodes: {10, 14, 19, 20, 21, 24, 25, 27, 30, 31, 32}. I evaluated several unblocked nodes. Node 35 (connected to Hexes H[15]=\"Wh6\", H[11]=\"O3\", H[10]=\"D\") yields Wheat (6) and Ore (3). This choice provides me with all five resources (Wood, Brick, Sheep, Wheat, Ore) with good numbers (11, 6, 8, 6, 3), which is crucial for a balanced early game economy and flexibility. I confirmed that Node 35 is not in the blocked list and none of its neighbors ([34, 36, 23]) are in the blocked list, making it a valid placement.", + "note_to_self": null, + "say_outloud": null, + "action_type": "place_starting_settlement", + "parameters": { + "node": 35 + } + }, + "model": "gemini-2.5-flash", + "tokens": { + "prompt": 1864, + "completion": 330, + "total": 10706 + }, + "latency_seconds": 35.097355365753174, + "error": null +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_013405/B/B.md b/examples/ai_testing/my_games/session_20260109_013405/B/B.md new file mode 100644 index 0000000000000000000000000000000000000000..c767ed96f42b24d5d82753d5d5b874cf7200a8ef --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/B/B.md @@ -0,0 +1,106 @@ +# AI Agent Log: B + +**Session:** session_20260109_013405 +**Started:** 2026-01-09 01:34:05 +**Model:** gemini-2.0-flash + +--- + + +## Request #1 - 🎯 ACTIVE TURN + +**Time:** 01:35:24 + +### What Happened +• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 0 performed action: ActionType.PLACE_STARTING_ROAD +• Turn 1: Player 1's turn begins. + +### Prompt Sent +See: [prompt_1.json](prompts/prompt_1.json) + +### Response Received ✅ + +**Latency:** 25.83s | **Tokens:** 7566 + +**Thinking:** I am Player B and it's my turn to place the first settlement. I need to choose a node that offers a good combination of high-probability resource production and resource diversity. Player A has settle... + +--- + +## Request #2 - 🎯 ACTIVE TURN + +**Time:** 01:36:01 + +### What Happened +• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 0 performed action: ActionType.PLACE_STARTING_ROAD +• Turn 1: Player 1's turn begins. +• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT + +### Prompt Sent +See: [prompt_2.json](prompts/prompt_2.json) + +### Response Received ✅ + +**Latency:** 6.49s | **Tokens:** 3051 + +**Thinking:** I am player B and have placed my first settlement at Node 31, which provides Wheat (9), Brick (10), and Wood (11). I need to place my first road. I will evaluate the adjacent nodes to maximize resourc... + +--- + +## Request #3 - 🎯 ACTIVE TURN + +**Time:** 01:36:38 + +### What Happened +• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 0 performed action: ActionType.PLACE_STARTING_ROAD +• Turn 1: Player 1's turn begins. +• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 1 performed action: ActionType.PLACE_STARTING_ROAD +• First round of setup complete! Starting second round (reverse order). +• Turn 2: Player 1's turn begins. + +### Prompt Sent +See: [prompt_3.json](prompts/prompt_3.json) + +### Response Received ✅ + +**Latency:** 25.34s | **Tokens:** 7726 + +**Thinking:** As player B, it's my turn to place my second settlement during the setup phase. My first settlement is at node 31, providing Wood (11), Brick (10), and Wheat (9). I need to select a second location th... + +--- + +## Request #4 - 🎯 ACTIVE TURN + +**Time:** 01:37:10 + +### What Happened +• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 0 performed action: ActionType.PLACE_STARTING_ROAD +• Turn 1: Player 1's turn begins. +• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 1 performed action: ActionType.PLACE_STARTING_ROAD +• First round of setup complete! Starting second round (reverse order). +• Turn 2: Player 1's turn begins. +• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT + +### Prompt Sent +See: [prompt_4.json](prompts/prompt_4.json) + +### Response Received ✅ + +**Latency:** 20.69s | **Tokens:** 6417 + +**Thinking:** I am Player B, in the second round of setup. I just placed my second settlement at Node 31. Now I need to place my second road. The game state's 'state.rds' already shows that I have a road from 31 to... + +--- diff --git a/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_1.json b/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_1.json new file mode 100644 index 0000000000000000000000000000000000000000..ad4518754cb7de144b7fc641fcd983c6b41acb86 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_1.json @@ -0,0 +1,95 @@ +{ + "request_number": 1, + "timestamp": "2026-01-09T01:35:24.754636", + "player_name": "B", + "is_active_turn": true, + "prompt": { + "meta_data": { + "agent_name": "B", + "role": null + }, + "task_context": { + "what_just_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"B\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[20,\"A\",\"S\"]],\"rds\":[[[20,10],\"A\"]]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } + }, + "response_schema": { + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] + }, + "what_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_1.txt b/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_1.txt new file mode 100644 index 0000000000000000000000000000000000000000..c9ecc205a205172f4ef18e18ee22f4a6781c51c1 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_1.txt @@ -0,0 +1,90 @@ +=== Prompt #1 for B === +Timestamp: 2026-01-09T01:35:24.757644 +Active Turn: True + +--- What Happened --- +• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 0 performed action: ActionType.PLACE_STARTING_ROAD +• Turn 1: Player 1's turn begins. + +--- Response Schema --- +{ + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] +} + +--- Prompt Content --- +{ + "meta_data": { + "agent_name": "B", + "role": null + }, + "task_context": { + "what_just_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"B\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[20,\"A\",\"S\"]],\"rds\":[[[20,10],\"A\"]]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } +} diff --git a/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_2.json b/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_2.json new file mode 100644 index 0000000000000000000000000000000000000000..2c480237889e65fff7d5de89a711779353fd1dfe --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_2.json @@ -0,0 +1,95 @@ +{ + "request_number": 2, + "timestamp": "2026-01-09T01:36:01.562087", + "player_name": "B", + "is_active_turn": true, + "prompt": { + "meta_data": { + "agent_name": "B", + "role": null + }, + "task_context": { + "what_just_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"B\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[20,\"A\",\"S\"],[31,\"B\",\"S\"]],\"rds\":[[[20,10],\"A\"]]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":1,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_road", + "description": "Place your starting road", + "example_parameters": "{\"from\": X, \"to\": Y}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } + }, + "response_schema": { + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] + }, + "what_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT", + "allowed_actions": [ + { + "type": "place_starting_road", + "description": "Place your starting road", + "example_parameters": "{\"from\": X, \"to\": Y}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_2.txt b/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_2.txt new file mode 100644 index 0000000000000000000000000000000000000000..26af985a824c714f9d798ba56b312c307af5ed27 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_2.txt @@ -0,0 +1,91 @@ +=== Prompt #2 for B === +Timestamp: 2026-01-09T01:36:01.563197 +Active Turn: True + +--- What Happened --- +• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 0 performed action: ActionType.PLACE_STARTING_ROAD +• Turn 1: Player 1's turn begins. +• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT + +--- Response Schema --- +{ + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] +} + +--- Prompt Content --- +{ + "meta_data": { + "agent_name": "B", + "role": null + }, + "task_context": { + "what_just_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"B\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[20,\"A\",\"S\"],[31,\"B\",\"S\"]],\"rds\":[[[20,10],\"A\"]]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":1,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_road", + "description": "Place your starting road", + "example_parameters": "{\"from\": X, \"to\": Y}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } +} diff --git a/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_3.json b/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_3.json new file mode 100644 index 0000000000000000000000000000000000000000..2e4c108505d5f9adbd8d1e1f2f5805efd3d881c4 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_3.json @@ -0,0 +1,95 @@ +{ + "request_number": 3, + "timestamp": "2026-01-09T01:36:38.510572", + "player_name": "B", + "is_active_turn": true, + "prompt": { + "meta_data": { + "agent_name": "B", + "role": null + }, + "task_context": { + "what_just_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• First round of setup complete! Starting second round (reverse order).\n• Turn 2: Player 1's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"B\",\"phase\":\"SETUP_SECOND_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[20,\"A\",\"S\"],[31,\"B\",\"S\"]],\"rds\":[[[20,10],\"A\"],[[31,41],\"B\"]]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":1,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } + }, + "response_schema": { + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] + }, + "what_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• First round of setup complete! Starting second round (reverse order).\n• Turn 2: Player 1's turn begins.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_3.txt b/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_3.txt new file mode 100644 index 0000000000000000000000000000000000000000..97ad66e921d72be081a759c49d7941b0da207901 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_3.txt @@ -0,0 +1,94 @@ +=== Prompt #3 for B === +Timestamp: 2026-01-09T01:36:38.513462 +Active Turn: True + +--- What Happened --- +• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 0 performed action: ActionType.PLACE_STARTING_ROAD +• Turn 1: Player 1's turn begins. +• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 1 performed action: ActionType.PLACE_STARTING_ROAD +• First round of setup complete! Starting second round (reverse order). +• Turn 2: Player 1's turn begins. + +--- Response Schema --- +{ + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] +} + +--- Prompt Content --- +{ + "meta_data": { + "agent_name": "B", + "role": null + }, + "task_context": { + "what_just_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• First round of setup complete! Starting second round (reverse order).\n• Turn 2: Player 1's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"B\",\"phase\":\"SETUP_SECOND_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[20,\"A\",\"S\"],[31,\"B\",\"S\"]],\"rds\":[[[20,10],\"A\"],[[31,41],\"B\"]]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":1,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } +} diff --git a/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_4.json b/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_4.json new file mode 100644 index 0000000000000000000000000000000000000000..55593272fd0a1f83a870aa0ce9a297635c3ef154 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_4.json @@ -0,0 +1,95 @@ +{ + "request_number": 4, + "timestamp": "2026-01-09T01:37:10.568358", + "player_name": "B", + "is_active_turn": true, + "prompt": { + "meta_data": { + "agent_name": "B", + "role": null + }, + "task_context": { + "what_just_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• First round of setup complete! Starting second round (reverse order).\n• Turn 2: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"B\",\"phase\":\"SETUP_SECOND_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[20,\"A\",\"S\"],[25,\"B\",\"S\"],[31,\"B\",\"S\"]],\"rds\":[[[20,10],\"A\"],[[31,41],\"B\"]]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":2,\"res\":{\"O\":1,\"Wh\":1,\"S\":1}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_road", + "description": "Place your starting road", + "example_parameters": "{\"from\": X, \"to\": Y}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } + }, + "response_schema": { + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] + }, + "what_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• First round of setup complete! Starting second round (reverse order).\n• Turn 2: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT", + "allowed_actions": [ + { + "type": "place_starting_road", + "description": "Place your starting road", + "example_parameters": "{\"from\": X, \"to\": Y}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_4.txt b/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_4.txt new file mode 100644 index 0000000000000000000000000000000000000000..bb368417df59aa41d781b6051ab54eb4b99eb7da --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/B/prompts/prompt_4.txt @@ -0,0 +1,95 @@ +=== Prompt #4 for B === +Timestamp: 2026-01-09T01:37:10.570391 +Active Turn: True + +--- What Happened --- +• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 0 performed action: ActionType.PLACE_STARTING_ROAD +• Turn 1: Player 1's turn begins. +• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT +• Player 1 performed action: ActionType.PLACE_STARTING_ROAD +• First round of setup complete! Starting second round (reverse order). +• Turn 2: Player 1's turn begins. +• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT + +--- Response Schema --- +{ + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] +} + +--- Prompt Content --- +{ + "meta_data": { + "agent_name": "B", + "role": null + }, + "task_context": { + "what_just_happened": "• Game e54b5fbe-ef65-48df-b524-4f61948e9070 has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 0 performed action: ActionType.PLACE_STARTING_ROAD\n• Turn 1: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT\n• Player 1 performed action: ActionType.PLACE_STARTING_ROAD\n• First round of setup complete! Starting second round (reverse order).\n• Turn 2: Player 1's turn begins.\n• Player 1 performed action: ActionType.PLACE_STARTING_SETTLEMENT", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"B\",\"phase\":\"SETUP_SECOND_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[20,\"A\",\"S\"],[25,\"B\",\"S\"],[31,\"B\",\"S\"]],\"rds\":[[[20,10],\"A\"],[[31,41],\"B\"]]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":2,\"res\":{\"O\":1,\"Wh\":1,\"S\":1}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_road", + "description": "Place your starting road", + "example_parameters": "{\"from\": X, \"to\": Y}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } +} diff --git a/examples/ai_testing/my_games/session_20260109_013405/B/responses/response_1.json b/examples/ai_testing/my_games/session_20260109_013405/B/responses/response_1.json new file mode 100644 index 0000000000000000000000000000000000000000..cfda37c4d05ac9fd440c8503cee0ee9b2ec42c83 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/B/responses/response_1.json @@ -0,0 +1,24 @@ +{ + "request_number": 1, + "timestamp": "2026-01-09T01:35:50.590258", + "player_name": "B", + "success": true, + "raw_content": "{\"internal_thinking\": \"I am Player B and it's my turn to place the first settlement. I need to choose a node that offers a good combination of high-probability resource production and resource diversity. Player A has settled on Wood, Brick, and Sheep with rolls 11, 6, 8. I will look for a spot that complements these resources, ideally providing Wheat, and has strong dice rolls.Node 31 (Wh9, B10, W11) provides Wheat, Brick, and Wood with dice rolls of 9, 10, and 11. These are all high-probability rolls and offer a critical mix of resources for early game development, including Wheat which Player A currently lacks from their first settlement. This spot provides excellent resource diversity and strong production. Node 19 (W11, B10, S8) is also very strong with rolls 11, 10, 8, but provides Sheep which Player A already has. Taking Wheat from Node 31 provides better diversification for my starting resources.\", \"action\": {\"type\": \"place_starting_settlement\", \"parameters\": \"{\\\"node\\\": 31}\"}}", + "parsed": { + "internal_thinking": "I am Player B and it's my turn to place the first settlement. I need to choose a node that offers a good combination of high-probability resource production and resource diversity. Player A has settled on Wood, Brick, and Sheep with rolls 11, 6, 8. I will look for a spot that complements these resources, ideally providing Wheat, and has strong dice rolls.Node 31 (Wh9, B10, W11) provides Wheat, Brick, and Wood with dice rolls of 9, 10, and 11. These are all high-probability rolls and offer a critical mix of resources for early game development, including Wheat which Player A currently lacks from their first settlement. This spot provides excellent resource diversity and strong production. Node 19 (W11, B10, S8) is also very strong with rolls 11, 10, 8, but provides Sheep which Player A already has. Taking Wheat from Node 31 provides better diversification for my starting resources. [Response was too brief]", + "note_to_self": null, + "say_outloud": null, + "action_type": "place_starting_settlement", + "parameters": { + "node": 31 + } + }, + "model": "gemini-2.5-flash", + "tokens": { + "prompt": 1696, + "completion": 250, + "total": 7566 + }, + "latency_seconds": 25.82748532295227, + "error": null +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_013405/B/responses/response_2.json b/examples/ai_testing/my_games/session_20260109_013405/B/responses/response_2.json new file mode 100644 index 0000000000000000000000000000000000000000..2958219a68a322e5e7b0ba8cace146612b82bfcd --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/B/responses/response_2.json @@ -0,0 +1,25 @@ +{ + "request_number": 2, + "timestamp": "2026-01-09T01:36:08.056695", + "player_name": "B", + "success": true, + "raw_content": "{\n \"internal_thinking\": \"I am player B and have placed my first settlement at Node 31, which provides Wheat (9), Brick (10), and Wood (11). I need to place my first road. I will evaluate the adjacent nodes to maximize resource access. Connecting to Node 30 would provide another Wheat source, while connecting to Node 32 would lead to the Desert. Connecting to Node 41 would give me access to Ore (5), adding a crucial resource for future city building and development cards. Given my current resources (Wood, Brick, Wheat), adding Ore creates a balanced and strong resource base. Therefore, placing the road from 31 to 41 is the optimal choice.\",\n \"action\": {\n \"type\": \"place_starting_road\",\n \"parameters\": \"{\\\"from\\\": 31, \\\"to\\\": 41}\"\n }\n}", + "parsed": { + "internal_thinking": "I am player B and have placed my first settlement at Node 31, which provides Wheat (9), Brick (10), and Wood (11). I need to place my first road. I will evaluate the adjacent nodes to maximize resource access. Connecting to Node 30 would provide another Wheat source, while connecting to Node 32 would lead to the Desert. Connecting to Node 41 would give me access to Ore (5), adding a crucial resource for future city building and development cards. Given my current resources (Wood, Brick, Wheat), adding Ore creates a balanced and strong resource base. Therefore, placing the road from 31 to 41 is the optimal choice. [Response was too brief]", + "note_to_self": null, + "say_outloud": null, + "action_type": "place_starting_road", + "parameters": { + "from": 31, + "to": 41 + } + }, + "model": "gemini-2.5-flash", + "tokens": { + "prompt": 1728, + "completion": 195, + "total": 3051 + }, + "latency_seconds": 6.4903528690338135, + "error": null +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_013405/B/responses/response_3.json b/examples/ai_testing/my_games/session_20260109_013405/B/responses/response_3.json new file mode 100644 index 0000000000000000000000000000000000000000..cfb9f6092faff29d9fc18391f6d22459bf5fe41d --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/B/responses/response_3.json @@ -0,0 +1,24 @@ +{ + "request_number": 3, + "timestamp": "2026-01-09T01:37:03.858834", + "player_name": "B", + "success": true, + "raw_content": "{\"internal_thinking\": \"As player B, it's my turn to place my second settlement during the setup phase. My first settlement is at node 31, providing Wood (11), Brick (10), and Wheat (9). I need to select a second location that provides Sheep and Ore, and ideally good production numbers, while also avoiding already occupied or blocked nodes. I evaluated several nodes and found Node 25 (Sheep 4, Ore 3, Wheat 8) and Node 35 (Sheep 11, Ore 3, Wheat 6) to be the best options for completing my resource set (Wood, Brick, Wheat, Sheep, Ore). Comparing the two:\\n- Node 25 (S4, O3, Wh8): Total pips 19 (from both settlements). Provides all 5 resources.\\n- Node 35 (S11, O3, Wh6): Total pips 18 (from both settlements). Provides all 5 resources.\\nNode 25 offers a slightly higher overall pip count and a good second source of Wheat (8), which is valuable. While the S4 and O3 are not high probability, they ensure I have access to all necessary resources for future development. This makes Node 25 the optimal choice for a balanced and diverse starting position.\", \"action\": {\"type\": \"place_starting_settlement\", \"parameters\": \"{\\\"node\\\": 25}\"}}", + "parsed": { + "internal_thinking": "As player B, it's my turn to place my second settlement during the setup phase. My first settlement is at node 31, providing Wood (11), Brick (10), and Wheat (9). I need to select a second location that provides Sheep and Ore, and ideally good production numbers, while also avoiding already occupied or blocked nodes. I evaluated several nodes and found Node 25 (Sheep 4, Ore 3, Wheat 8) and Node 35 (Sheep 11, Ore 3, Wheat 6) to be the best options for completing my resource set (Wood, Brick, Wheat, Sheep, Ore). Comparing the two:\n- Node 25 (S4, O3, Wh8): Total pips 19 (from both settlements). Provides all 5 resources.\n- Node 35 (S11, O3, Wh6): Total pips 18 (from both settlements). Provides all 5 resources.\nNode 25 offers a slightly higher overall pip count and a good second source of Wheat (8), which is valuable. While the S4 and O3 are not high probability, they ensure I have access to all necessary resources for future development. This makes Node 25 the optimal choice for a balanced and diverse starting position.", + "note_to_self": null, + "say_outloud": null, + "action_type": "place_starting_settlement", + "parameters": { + "node": 25 + } + }, + "model": "gemini-2.5-flash", + "tokens": { + "prompt": 1782, + "completion": 307, + "total": 7726 + }, + "latency_seconds": 25.3421688079834, + "error": null +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_013405/B/responses/response_4.json b/examples/ai_testing/my_games/session_20260109_013405/B/responses/response_4.json new file mode 100644 index 0000000000000000000000000000000000000000..a9096bd12dbac6700d3679d87401c22e49cbccef --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/B/responses/response_4.json @@ -0,0 +1,25 @@ +{ + "request_number": 4, + "timestamp": "2026-01-09T01:37:31.261813", + "player_name": "B", + "success": true, + "raw_content": "{\"internal_thinking\": \"I am Player B, in the second round of setup. I just placed my second settlement at Node 31. Now I need to place my second road. The game state's 'state.rds' already shows that I have a road from 31 to 41. Assuming this reflects the current board state and I cannot place an existing road, I must choose another adjacent road from Node 31. The neighbors of Node 31 are 30, 32, and 41. Since 31-41 is already present, I consider 31-30 and 31-32. Node 30 connects to Hexes 13 (B10), 9 (W11), 8 (S4), offering Brick, Wood, and Sheep. Node 32 connects to Hexes 14 (Wh9), 9 (W11), 10 (D), offering Wheat, Wood, and Desert. Placing the road 31-30 is strategically better as it opens up access to Sheep and other useful resources, while 31-32 leads to a desert hex, making it less valuable for future expansion. Therefore, I will place the road from 31 to 30.\", \"action\": {\"type\": \"place_starting_road\", \"parameters\": \"{\\\"from\\\": 31, \\\"to\\\": 30}\"}}", + "parsed": { + "internal_thinking": "I am Player B, in the second round of setup. I just placed my second settlement at Node 31. Now I need to place my second road. The game state's 'state.rds' already shows that I have a road from 31 to 41. Assuming this reflects the current board state and I cannot place an existing road, I must choose another adjacent road from Node 31. The neighbors of Node 31 are 30, 32, and 41. Since 31-41 is already present, I consider 31-30 and 31-32. Node 30 connects to Hexes 13 (B10), 9 (W11), 8 (S4), offering Brick, Wood, and Sheep. Node 32 connects to Hexes 14 (Wh9), 9 (W11), 10 (D), offering Wheat, Wood, and Desert. Placing the road 31-30 is strategically better as it opens up access to Sheep and other useful resources, while 31-32 leads to a desert hex, making it less valuable for future expansion. Therefore, I will place the road from 31 to 30. [Response was too brief]", + "note_to_self": null, + "say_outloud": null, + "action_type": "place_starting_road", + "parameters": { + "from": 31, + "to": 30 + } + }, + "model": "gemini-2.5-flash", + "tokens": { + "prompt": 1825, + "completion": 306, + "total": 6417 + }, + "latency_seconds": 20.68689227104187, + "error": null +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_013405/session_metadata.json b/examples/ai_testing/my_games/session_20260109_013405/session_metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..700741faed997bc30906bfc6bfe02efc6976c342 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_013405/session_metadata.json @@ -0,0 +1,5 @@ +{ + "session_id": "session_20260109_013405", + "start_time": "2026-01-09T01:34:05.265395", + "version": "2.0" +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_014638/A/A.md b/examples/ai_testing/my_games/session_20260109_014638/A/A.md new file mode 100644 index 0000000000000000000000000000000000000000..2990b03f51bdc2bc5257ab2c252745688278996d --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_014638/A/A.md @@ -0,0 +1,73 @@ +# AI Agent Log: A + +**Session:** session_20260109_014638 +**Started:** 2026-01-09 01:46:38 +**Model:** gemini-2.0-flash + +--- + + +## Request #1 - 🎯 ACTIVE TURN + +**Time:** 01:46:40 + +### What Happened +• Game d15f4a8c-f772-418a-869f-cc6b4c44ce9c has started with 2 players! +• Turn 0: Player 0's turn begins. + +### Prompt Sent +See: [prompt_1.json](prompts/prompt_1.json) + +### Response Received ✅ + +**Latency:** 45.61s | **Tokens:** 11832 + +**Thinking:** The game has just started, and I am Player A, the first to place a settlement. This is a critical decision that will heavily influence my entire game strategy. My primary goal for the first settlement... + +**Says:** "I'll start here to get a good mix of resources. Good luck, player B!" + +--- + +## Request #2 - 🎯 ACTIVE TURN + +**Time:** 01:48:41 + +### What Happened +• Game d15f4a8c-f772-418a-869f-cc6b4c44ce9c has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT + +### Prompt Sent +See: [prompt_2.json](prompts/prompt_2.json) + +### Response Received ✅ + +**Latency:** 33.44s | **Tokens:** 8072 + +**Thinking:** My current position as Player A is in the SETUP_FIRST_ROUND, having just placed my initial settlement at Node 35. This settlement provides access to Sheep (H[16]=S11) and Ore (H[12]=O3). This is a sol... + +**Note to Self:** Player B's placements will be crucial. If node 14 is taken, prioritize a strong Wood/Brick spot for my second settlement to round out my resource production. + +--- + +## Request #3 - 🎯 ACTIVE TURN + +**Time:** 01:49:51 + +### What Happened +• Game d15f4a8c-f772-418a-869f-cc6b4c44ce9c has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT + +### Prompt Sent +See: [prompt_3.json](prompts/prompt_3.json) + +### Response Received ✅ + +**Latency:** 40.23s | **Tokens:** 9988 + +**Thinking:** My current settlement is at Node 35, adjacent to Hexes 16 (Sheep 11), 12 (Ore 3), and 11 (Desert). This provides decent initial production of Sheep and Ore, both vital for development cards and cities... + +**Note to Self:** Aim for Node 26 (Wh8, S11, O3 + O2 port) for second settlement if available. If not, Node 24 (W3, Wh8, D) is a strong fallback to get Wood and Wheat. + +--- diff --git a/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_1.json b/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_1.json new file mode 100644 index 0000000000000000000000000000000000000000..112c3058dda505d24f1051daa6420da362cbd915 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_1.json @@ -0,0 +1,95 @@ +{ + "request_number": 1, + "timestamp": "2026-01-09T01:46:40.093697", + "player_name": "A", + "is_active_turn": true, + "prompt": { + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game d15f4a8c-f772-418a-869f-cc6b4c44ce9c has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[],\"rds\":[]},\"players\":{\"A\":{\"vp\":0,\"res\":{}},\"B\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } + }, + "response_schema": { + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why? IMPORTANT: Must be at least 1000 characters. Include detailed analysis of: current board state, your resources, opponent positions, available moves and their pros/cons, short-term tactics, long-term strategy, risks, and why you chose this specific action over alternatives. Be thorough and analytical.", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts to remember for your next turn (e.g., 'Need ore for city', 'Watch player B's expansion', 'Aim for longest road'). Optional but recommended for strategic continuity.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] + }, + "what_happened": "• Game d15f4a8c-f772-418a-869f-cc6b4c44ce9c has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_1.txt b/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_1.txt new file mode 100644 index 0000000000000000000000000000000000000000..bd6ae06b8c9abc7a4f93920c5e4629a32fc2d472 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_1.txt @@ -0,0 +1,87 @@ +=== Prompt #1 for A === +Timestamp: 2026-01-09T01:46:40.094818 +Active Turn: True + +--- What Happened --- +• Game d15f4a8c-f772-418a-869f-cc6b4c44ce9c has started with 2 players! +• Turn 0: Player 0's turn begins. + +--- Response Schema --- +{ + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why? IMPORTANT: Must be at least 1000 characters. Include detailed analysis of: current board state, your resources, opponent positions, available moves and their pros/cons, short-term tactics, long-term strategy, risks, and why you chose this specific action over alternatives. Be thorough and analytical.", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts to remember for your next turn (e.g., 'Need ore for city', 'Watch player B's expansion', 'Aim for longest road'). Optional but recommended for strategic continuity.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] +} + +--- Prompt Content --- +{ + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game d15f4a8c-f772-418a-869f-cc6b4c44ce9c has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[],\"rds\":[]},\"players\":{\"A\":{\"vp\":0,\"res\":{}},\"B\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } +} diff --git a/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_2.json b/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_2.json new file mode 100644 index 0000000000000000000000000000000000000000..cbda0104143e84702c245549b681b06a5c08272e --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_2.json @@ -0,0 +1,95 @@ +{ + "request_number": 2, + "timestamp": "2026-01-09T01:48:41.035593", + "player_name": "A", + "is_active_turn": true, + "prompt": { + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game d15f4a8c-f772-418a-869f-cc6b4c44ce9c has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[35,\"A\",\"S\"]],\"rds\":[]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_road", + "description": "Place your starting road", + "example_parameters": "{\"from\": X, \"to\": Y}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } + }, + "response_schema": { + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why? IMPORTANT: Must be at least 1000 characters. Include detailed analysis of: current board state, your resources, opponent positions, available moves and their pros/cons, short-term tactics, long-term strategy, risks, and why you chose this specific action over alternatives. Be thorough and analytical.", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts to remember for your next turn (e.g., 'Need ore for city', 'Watch player B's expansion', 'Aim for longest road'). Optional but recommended for strategic continuity.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] + }, + "what_happened": "• Game d15f4a8c-f772-418a-869f-cc6b4c44ce9c has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT", + "allowed_actions": [ + { + "type": "place_starting_road", + "description": "Place your starting road", + "example_parameters": "{\"from\": X, \"to\": Y}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_2.txt b/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_2.txt new file mode 100644 index 0000000000000000000000000000000000000000..d8fadfa4e5d936f7efb5552c725886c8942f10eb --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_2.txt @@ -0,0 +1,88 @@ +=== Prompt #2 for A === +Timestamp: 2026-01-09T01:48:41.036375 +Active Turn: True + +--- What Happened --- +• Game d15f4a8c-f772-418a-869f-cc6b4c44ce9c has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT + +--- Response Schema --- +{ + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why? IMPORTANT: Must be at least 1000 characters. Include detailed analysis of: current board state, your resources, opponent positions, available moves and their pros/cons, short-term tactics, long-term strategy, risks, and why you chose this specific action over alternatives. Be thorough and analytical.", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts to remember for your next turn (e.g., 'Need ore for city', 'Watch player B's expansion', 'Aim for longest road'). Optional but recommended for strategic continuity.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] +} + +--- Prompt Content --- +{ + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game d15f4a8c-f772-418a-869f-cc6b4c44ce9c has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[35,\"A\",\"S\"]],\"rds\":[]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_road", + "description": "Place your starting road", + "example_parameters": "{\"from\": X, \"to\": Y}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } +} diff --git a/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_3.json b/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_3.json new file mode 100644 index 0000000000000000000000000000000000000000..dcfca09c1c16fe7c0ac86b50c3281184da0e8fe7 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_3.json @@ -0,0 +1,95 @@ +{ + "request_number": 3, + "timestamp": "2026-01-09T01:49:51.360600", + "player_name": "A", + "is_active_turn": true, + "prompt": { + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game d15f4a8c-f772-418a-869f-cc6b4c44ce9c has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[35,\"A\",\"S\"]],\"rds\":[]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_road", + "description": "Place your starting road", + "example_parameters": "{\"from\": X, \"to\": Y}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } + }, + "response_schema": { + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why? IMPORTANT: Must be at least 1000 characters. Include detailed analysis of: current board state, your resources, opponent positions, available moves and their pros/cons, short-term tactics, long-term strategy, risks, and why you chose this specific action over alternatives. Be thorough and analytical.", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts to remember for your next turn (e.g., 'Need ore for city', 'Watch player B's expansion', 'Aim for longest road'). Optional but recommended for strategic continuity.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] + }, + "what_happened": "• Game d15f4a8c-f772-418a-869f-cc6b4c44ce9c has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT", + "allowed_actions": [ + { + "type": "place_starting_road", + "description": "Place your starting road", + "example_parameters": "{\"from\": X, \"to\": Y}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_3.txt b/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_3.txt new file mode 100644 index 0000000000000000000000000000000000000000..fecc14be2019c31966c516b3b1d84798a8797110 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_014638/A/prompts/prompt_3.txt @@ -0,0 +1,88 @@ +=== Prompt #3 for A === +Timestamp: 2026-01-09T01:49:51.363082 +Active Turn: True + +--- What Happened --- +• Game d15f4a8c-f772-418a-869f-cc6b4c44ce9c has started with 2 players! +• Turn 0: Player 0's turn begins. +• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT + +--- Response Schema --- +{ + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why? IMPORTANT: Must be at least 1000 characters. Include detailed analysis of: current board state, your resources, opponent positions, available moves and their pros/cons, short-term tactics, long-term strategy, risks, and why you chose this specific action over alternatives. Be thorough and analytical.", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts to remember for your next turn (e.g., 'Need ore for city', 'Watch player B's expansion', 'Aim for longest road'). Optional but recommended for strategic continuity.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] +} + +--- Prompt Content --- +{ + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game d15f4a8c-f772-418a-869f-cc6b4c44ce9c has started with 2 players!\n• Turn 0: Player 0's turn begins.\n• Player 0 performed action: ActionType.PLACE_STARTING_SETTLEMENT", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[[35,\"A\",\"S\"]],\"rds\":[]},\"players\":{\"A\":{\"vp\":1,\"res\":{}},\"B\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_road", + "description": "Place your starting road", + "example_parameters": "{\"from\": X, \"to\": Y}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } +} diff --git a/examples/ai_testing/my_games/session_20260109_014638/A/responses/response_1.json b/examples/ai_testing/my_games/session_20260109_014638/A/responses/response_1.json new file mode 100644 index 0000000000000000000000000000000000000000..680e7115d776adf11f104a312e378a7964a576ac --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_014638/A/responses/response_1.json @@ -0,0 +1,24 @@ +{ + "request_number": 1, + "timestamp": "2026-01-09T01:47:27.191553", + "player_name": "A", + "success": true, + "raw_content": "{\n \"internal_thinking\": \"The game has just started, and I am Player A, the first to place a settlement. This is a critical decision that will heavily influence my entire game strategy. My primary goal for the first settlement is to secure a strong, balanced resource income, with a strong emphasis on resources required for cities and development cards, as these are the primary ways to gain victory points. I need to analyze the board to identify nodes with high-probability numbers (6s, 8s, 5s, 9s) and a good mix of resources (Wheat, Ore, Sheep for cities/dev cards; Wood, Brick for roads/settlements).\\n\\nI systematically evaluated several promising nodes:\\n\\n1. **Node 18 (B10, S8, O5)**: This node offers Brick, Sheep, and Ore. The pips are 3 (for B10) + 5 (for S8) + 4 (for O5), totaling 12 pips. This is a very high production node with excellent numbers (8 and 5 are very reliable). It's great for development cards (Ore+Sheep) and contributes to cities (Ore). However, it completely lacks Wheat, which is crucial for both cities and dev cards, and Wood, which is essential for early expansion.\\n\\n2. **Node 11 (B6, S5, W12)**: This node provides Brick, Sheep, and Wood. The pips are 5 (for B6) + 4 (for S5) + 1 (for W12), totaling 10 pips. While B6 and S5 are good, W12 is a very unreliable number, making this spot less consistent than it initially appears. It also lacks Wheat and Ore, which are vital for city upgrades.\\n\\n3. **Node 14 (Wh8, W3, W4)**: This node offers Wheat, Wood, and Wood. The pips are 5 (for Wh8) + 2 (for W3) + 3 (for W4), totaling 10 pips. While Wh8 is excellent, having two Wood hexes and no Brick, Sheep, or Ore makes this an unbalanced spot for a first settlement. It's good for early road building but not for diverse resource generation.\\n\\n4. **Node 31 (Wh9, B10, W11)**: This node provides Wheat, Brick, and Wood. The pips are 4 (for Wh9) + 3 (for B10) + 2 (for W11), totaling 9 pips. This is a balanced mix for early game building (roads, settlements) and provides Wheat for cities. However, it lacks both Sheep and Ore, which are essential for cities and development cards, making it slower to reach those goals.\\n\\n5. **Node 35 (S11, Wh6, O3)**: This node offers Sheep, Wheat, and Ore. The pips are 2 (for S11) + 5 (for Wh6) + 2 (for O3), totaling 9 pips. Although the total pips are lower than Node 18, the *combination* of resources is exceptionally strong. It provides the \" , \"say_outloud\": \"I'll start here to get a good mix of resources. Good luck, player B!\",\n \"action\": {\n \"type\": \"place_starting_settlement\",\n \"parameters\": \"{\\\"node\\\": 35}\"\n }\n}", + "parsed": { + "internal_thinking": "The game has just started, and I am Player A, the first to place a settlement. This is a critical decision that will heavily influence my entire game strategy. My primary goal for the first settlement is to secure a strong, balanced resource income, with a strong emphasis on resources required for cities and development cards, as these are the primary ways to gain victory points. I need to analyze the board to identify nodes with high-probability numbers (6s, 8s, 5s, 9s) and a good mix of resources (Wheat, Ore, Sheep for cities/dev cards; Wood, Brick for roads/settlements).\n\nI systematically evaluated several promising nodes:\n\n1. **Node 18 (B10, S8, O5)**: This node offers Brick, Sheep, and Ore. The pips are 3 (for B10) + 5 (for S8) + 4 (for O5), totaling 12 pips. This is a very high production node with excellent numbers (8 and 5 are very reliable). It's great for development cards (Ore+Sheep) and contributes to cities (Ore). However, it completely lacks Wheat, which is crucial for both cities and dev cards, and Wood, which is essential for early expansion.\n\n2. **Node 11 (B6, S5, W12)**: This node provides Brick, Sheep, and Wood. The pips are 5 (for B6) + 4 (for S5) + 1 (for W12), totaling 10 pips. While B6 and S5 are good, W12 is a very unreliable number, making this spot less consistent than it initially appears. It also lacks Wheat and Ore, which are vital for city upgrades.\n\n3. **Node 14 (Wh8, W3, W4)**: This node offers Wheat, Wood, and Wood. The pips are 5 (for Wh8) + 2 (for W3) + 3 (for W4), totaling 10 pips. While Wh8 is excellent, having two Wood hexes and no Brick, Sheep, or Ore makes this an unbalanced spot for a first settlement. It's good for early road building but not for diverse resource generation.\n\n4. **Node 31 (Wh9, B10, W11)**: This node provides Wheat, Brick, and Wood. The pips are 4 (for Wh9) + 3 (for B10) + 2 (for W11), totaling 9 pips. This is a balanced mix for early game building (roads, settlements) and provides Wheat for cities. However, it lacks both Sheep and Ore, which are essential for cities and development cards, making it slower to reach those goals.\n\n5. **Node 35 (S11, Wh6, O3)**: This node offers Sheep, Wheat, and Ore. The pips are 2 (for S11) + 5 (for Wh6) + 2 (for O3), totaling 9 pips. Although the total pips are lower than Node 18, the *combination* of resources is exceptionally strong. It provides the ", + "note_to_self": null, + "say_outloud": "I'll start here to get a good mix of resources. Good luck, player B!", + "action_type": "place_starting_settlement", + "parameters": { + "node": 35 + } + }, + "model": "gemini-2.5-flash", + "tokens": { + "prompt": 1627, + "completion": 778, + "total": 11832 + }, + "latency_seconds": 45.61032676696777, + "error": null +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_014638/A/responses/response_2.json b/examples/ai_testing/my_games/session_20260109_014638/A/responses/response_2.json new file mode 100644 index 0000000000000000000000000000000000000000..bd9505efda161d4a8293911d4ef45d9e10fc19b6 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_014638/A/responses/response_2.json @@ -0,0 +1,25 @@ +{ + "request_number": 2, + "timestamp": "2026-01-09T01:49:14.481040", + "player_name": "A", + "success": true, + "raw_content": "{\n \"internal_thinking\": \"My current position as Player A is in the SETUP_FIRST_ROUND, having just placed my initial settlement at Node 35. This settlement provides access to Sheep (H[16]=S11) and Ore (H[12]=O3). This is a solid start, giving me a foundation for development cards (Sheep, Ore, Wheat, Wood required) and cities (Ore and Wheat being key). My immediate goal is to place my first road in a way that maximizes my potential for the second settlement, which will be placed after Player B has made their first two placements. I need to select between the available road segments connected to my settlement at Node 35, which are to Nodes 34, 37, or 25. I will analyze each option for its strategic implications.\\n\\nFirst, let's consider the direct connections from Node 35:\\n1. **Road 35-34:** Node 34 is connected to Hexes 16 (S11), 15 (Wh6), and 11 (Desert). Building this road would point towards nodes like 45 (S11, O2) or further to 43 (Wh9, Wh6, Wh9). If I aimed for 45, my combined production would be S11, O3 (from 35) + S11, O2 (from 45), resulting in a heavily Sheep and Ore focused engine. While strong for development cards and cities, it would lack crucial Wheat, Wood, and Brick diversity. If I aimed for 43, it's an excellent triple-wheat spot, but it requires a longer road path (35-34-45-44-43), which is three road segments, making it less accessible for a second settlement in the first setup round.\\n\\n2. **Road 35-37:** Node 37 is connected to Hex 12 (O3) and features a ?3 port. This road would grant me access to a port, which is valuable for trading excess resources, especially since I have Ore. However, it doesn't immediately open up new, diverse resource hexes for a second settlement. While ports are good for flexibility, my priority for the first road is generally to secure access to a strong resource node for a second settlement.\\n\\n3. **Road 35-25:** Node 25 is connected to Hexes 11 (Desert), 7 (Wh8), and 6 (W3). Building this road would point towards nodes like 26 (S4, Wh8) or 14. Node 14 is adjacent to Hexes 14 (Wh9), 15 (Wh6), and 7 (Wh8). This makes Node 14 an exceptionally strong triple-wheat spot with numbers 9, 6, and 8. If I can secure a second settlement at Node 14, my combined resource production would be S11, O3 (from 35) + Wh9, Wh6, Wh8 (from 14). This creates a highly balanced and powerful resource engine, providing strong production of Sheep, Ore, and critically, Wheat. Wheat is essential for building cities and is a versatile trading commodity.\\n\\nComparing the options, the path via 35-25 towards Node 14 stands out as the most strategically advantageous. My current settlement at 35 already provides Sheep and Ore. Adding a robust Wheat income from Node 14 would create a very strong and diversified resource base (S, O, Wh). This combination is excellent for building cities quickly (which require Ore and Wheat) and for acquiring development cards. While I would still need to secure Wood and Brick, having a strong S, O, and Wh engine provides significant flexibility and reduces my reliance on trading for core resources. Furthermore, Node 14 is reachable with only two road segments (35-25-14), making it a more accessible target for my second settlement compared to Node 43 via the 35-34 path.\\n\\nMy short-term tactic is to place this road to establish my claim towards Node 14. I will then closely observe Player B's placements to anticipate their strategy and adjust my second settlement choice accordingly. My long-term strategy involves leveraging this balanced resource production to build cities, expand my road network, and acquire development cards for victory points. The primary risk is that Player B might recognize the value of Node 14 and attempt to settle there or block my path. However, by placing this road now, I signal my intent and make it more difficult for them to do so without compromising their own optimal placements. This move sets me up for a strong early game and a flexible path to victory.\",\n \"note_to_self\": \"Player B's placements will be crucial. If node 14 is taken, prioritize a strong Wood/Brick spot for my second settlement to round out my resource production.\",\n \"action\": {\n \"type\": \"place_starting_road\",\n \"parameters\": \"{\\\"from\\\": 35, \\\"to\\\": 25}\"\n }\n}", + "parsed": { + "internal_thinking": "My current position as Player A is in the SETUP_FIRST_ROUND, having just placed my initial settlement at Node 35. This settlement provides access to Sheep (H[16]=S11) and Ore (H[12]=O3). This is a solid start, giving me a foundation for development cards (Sheep, Ore, Wheat, Wood required) and cities (Ore and Wheat being key). My immediate goal is to place my first road in a way that maximizes my potential for the second settlement, which will be placed after Player B has made their first two placements. I need to select between the available road segments connected to my settlement at Node 35, which are to Nodes 34, 37, or 25. I will analyze each option for its strategic implications.\n\nFirst, let's consider the direct connections from Node 35:\n1. **Road 35-34:** Node 34 is connected to Hexes 16 (S11), 15 (Wh6), and 11 (Desert). Building this road would point towards nodes like 45 (S11, O2) or further to 43 (Wh9, Wh6, Wh9). If I aimed for 45, my combined production would be S11, O3 (from 35) + S11, O2 (from 45), resulting in a heavily Sheep and Ore focused engine. While strong for development cards and cities, it would lack crucial Wheat, Wood, and Brick diversity. If I aimed for 43, it's an excellent triple-wheat spot, but it requires a longer road path (35-34-45-44-43), which is three road segments, making it less accessible for a second settlement in the first setup round.\n\n2. **Road 35-37:** Node 37 is connected to Hex 12 (O3) and features a ?3 port. This road would grant me access to a port, which is valuable for trading excess resources, especially since I have Ore. However, it doesn't immediately open up new, diverse resource hexes for a second settlement. While ports are good for flexibility, my priority for the first road is generally to secure access to a strong resource node for a second settlement.\n\n3. **Road 35-25:** Node 25 is connected to Hexes 11 (Desert), 7 (Wh8), and 6 (W3). Building this road would point towards nodes like 26 (S4, Wh8) or 14. Node 14 is adjacent to Hexes 14 (Wh9), 15 (Wh6), and 7 (Wh8). This makes Node 14 an exceptionally strong triple-wheat spot with numbers 9, 6, and 8. If I can secure a second settlement at Node 14, my combined resource production would be S11, O3 (from 35) + Wh9, Wh6, Wh8 (from 14). This creates a highly balanced and powerful resource engine, providing strong production of Sheep, Ore, and critically, Wheat. Wheat is essential for building cities and is a versatile trading commodity.\n\nComparing the options, the path via 35-25 towards Node 14 stands out as the most strategically advantageous. My current settlement at 35 already provides Sheep and Ore. Adding a robust Wheat income from Node 14 would create a very strong and diversified resource base (S, O, Wh). This combination is excellent for building cities quickly (which require Ore and Wheat) and for acquiring development cards. While I would still need to secure Wood and Brick, having a strong S, O, and Wh engine provides significant flexibility and reduces my reliance on trading for core resources. Furthermore, Node 14 is reachable with only two road segments (35-25-14), making it a more accessible target for my second settlement compared to Node 43 via the 35-34 path.\n\nMy short-term tactic is to place this road to establish my claim towards Node 14. I will then closely observe Player B's placements to anticipate their strategy and adjust my second settlement choice accordingly. My long-term strategy involves leveraging this balanced resource production to build cities, expand my road network, and acquire development cards for victory points. The primary risk is that Player B might recognize the value of Node 14 and attempt to settle there or block my path. However, by placing this road now, I signal my intent and make it more difficult for them to do so without compromising their own optimal placements. This move sets me up for a strong early game and a flexible path to victory.", + "note_to_self": "Player B's placements will be crucial. If node 14 is taken, prioritize a strong Wood/Brick spot for my second settlement to round out my resource production.", + "say_outloud": null, + "action_type": "place_starting_road", + "parameters": { + "from": 35, + "to": 25 + } + }, + "model": "gemini-2.5-flash", + "tokens": { + "prompt": 1659, + "completion": 1119, + "total": 8072 + }, + "latency_seconds": 33.44082307815552, + "error": null +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_014638/A/responses/response_3.json b/examples/ai_testing/my_games/session_20260109_014638/A/responses/response_3.json new file mode 100644 index 0000000000000000000000000000000000000000..61dc84e8efa467f2c26ba02c3f26ccb538433092 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_014638/A/responses/response_3.json @@ -0,0 +1,25 @@ +{ + "request_number": 3, + "timestamp": "2026-01-09T01:50:31.598328", + "player_name": "A", + "success": true, + "raw_content": "{\n \"internal_thinking\": \"My current settlement is at Node 35, adjacent to Hexes 16 (Sheep 11), 12 (Ore 3), and 11 (Desert). This provides decent initial production of Sheep and Ore, both vital for development cards and cities, but I am entirely lacking Wood, Brick, and Wheat. The numbers 11 and 3 are good probabilities. As this is the first round of setup, I (Player A) have placed my first settlement, and now I must place my first road. Player B will then place both of their settlements and roads before I place my second settlement and road. My primary goal for this road placement is to maximize my options for a strong and diverse second settlement, anticipating that Player B will claim some of the best spots. I need to consider both a primary target and a robust fallback option for my second placement. The available road placements from Node 35 are to Node 34, Node 37, or Node 25. I will analyze each option in detail.1. Road from Node 35 to Node 34: This path leads towards Node 45 and Node 33. Node 45 is adjacent to Hexes 19 (Ore 2), 16 (Sheep 11), and 15 (Wheat 6). This is a strong potential second settlement spot as it would provide much-needed Wheat (Wh6) and a second source of Ore (O2), complementing my existing S11 and O3. Duplicating S11 is also beneficial due to its high probability. However, the other node accessible via this path, Node 33, is adjacent to Hexes 15 (Wheat 6), 11 (Desert), and 10 (Desert). This is a very poor settlement location due to two desert hexes and only one resource (Wh6). If Node 45 is taken by Player B, my fallback option along this path is extremely weak.2. Road from Node 35 to Node 37: Node 37 itself is a 3:1 port, adjacent to Hexes 16 (Sheep 11) and 12 (Ore 3). Placing a road here would give me immediate access to resource conversion, allowing me to trade any three resources for one of my choice. This offers valuable flexibility, especially given my limited initial resource diversity. However, this option does not directly lead to a new resource-producing settlement spot that would provide Wood, Brick, or Wheat. While ports are useful, my priority in the setup phase is to establish a strong and diverse resource income. The nodes further along this path (e.g., Node 27) are also primarily focused on existing resources (S11, O3) and the port, rather than introducing new resource types.3. Road from Node 35 to Node 25: This path leads towards Node 26 and Node 24. * Node 26 is adjacent to Hexes 12 (Ore 3), 7 (Wheat 8), and 16 (Sheep 11), and crucially, it has an Ore 2:1 port. This is an exceptionally strong potential second settlement spot. It provides high-frequency Wheat (Wh8), which is a critical missing resource, and duplicates my S11 and O3 production (both good numbers). The O2 port further enhances my Ore economy and offers excellent trading flexibility. This spot would set me up for a powerful city and development card strategy. * Node 24 is adjacent to Hexes 11 (Desert), 7 (Wheat 8), and 6 (Wood 3). This node offers two critical missing resources: Wood (W3) and Wheat (Wh8). If Node 26 is taken by Player B (which is a high possibility given its strength), Node 24 provides an excellent fallback option. Taking Node 24 would round out my resource production to include Sheep, Ore, Wood, and Wheat, providing a balanced foundation for both expansion (roads, settlements) and development.Comparing the options: The road to Node 25 offers the best combination of a premium primary target (Node 26) and a highly valuable fallback option (Node 24). Node 26 is arguably superior to Node 45 (from the 35-34 path) due to the higher Wheat number (8 vs 6) and the O2 port, which provides more flexibility than a direct O2 production. More importantly, Node 24 is a significantly better fallback option than Node 33. Node 24 directly addresses my lack of Wood and Wheat, providing a balanced resource profile, whereas Node 33 is extremely poor. The 35-37 port access is good for flexibility but does not secure new resource production, which is a higher priority at this stage.Therefore, placing the road from 35 to 25 provides the greatest flexibility and strongest potential outcomes for my second settlement, whether I secure the resource-heavy Node 26 or the balanced-resource Node 24. This choice sets me up for a robust early game, adapting to Player B's placements. My short-term tactic is to open up access to these prime locations. My long-term strategy is to build a strong resource engine for cities and development cards, which these nodes facilitate by providing Wheat and strong production numbers. The risk is that Player B takes both 26 and 24, but this path gives me the best chance. I will place the road from 35 to 25.\",\n \"note_to_self\": \"Aim for Node 26 (Wh8, S11, O3 + O2 port) for second settlement if available. If not, Node 24 (W3, Wh8, D) is a strong fallback to get Wood and Wheat.\",\n \"action\": {\n \"type\": \"place_starting_road\",\n \"parameters\": \"{\\\"from\\\": 35, \\\"to\\\": 25}\"\n }\n}", + "parsed": { + "internal_thinking": "My current settlement is at Node 35, adjacent to Hexes 16 (Sheep 11), 12 (Ore 3), and 11 (Desert). This provides decent initial production of Sheep and Ore, both vital for development cards and cities, but I am entirely lacking Wood, Brick, and Wheat. The numbers 11 and 3 are good probabilities. As this is the first round of setup, I (Player A) have placed my first settlement, and now I must place my first road. Player B will then place both of their settlements and roads before I place my second settlement and road. My primary goal for this road placement is to maximize my options for a strong and diverse second settlement, anticipating that Player B will claim some of the best spots. I need to consider both a primary target and a robust fallback option for my second placement. The available road placements from Node 35 are to Node 34, Node 37, or Node 25. I will analyze each option in detail.1. Road from Node 35 to Node 34: This path leads towards Node 45 and Node 33. Node 45 is adjacent to Hexes 19 (Ore 2), 16 (Sheep 11), and 15 (Wheat 6). This is a strong potential second settlement spot as it would provide much-needed Wheat (Wh6) and a second source of Ore (O2), complementing my existing S11 and O3. Duplicating S11 is also beneficial due to its high probability. However, the other node accessible via this path, Node 33, is adjacent to Hexes 15 (Wheat 6), 11 (Desert), and 10 (Desert). This is a very poor settlement location due to two desert hexes and only one resource (Wh6). If Node 45 is taken by Player B, my fallback option along this path is extremely weak.2. Road from Node 35 to Node 37: Node 37 itself is a 3:1 port, adjacent to Hexes 16 (Sheep 11) and 12 (Ore 3). Placing a road here would give me immediate access to resource conversion, allowing me to trade any three resources for one of my choice. This offers valuable flexibility, especially given my limited initial resource diversity. However, this option does not directly lead to a new resource-producing settlement spot that would provide Wood, Brick, or Wheat. While ports are useful, my priority in the setup phase is to establish a strong and diverse resource income. The nodes further along this path (e.g., Node 27) are also primarily focused on existing resources (S11, O3) and the port, rather than introducing new resource types.3. Road from Node 35 to Node 25: This path leads towards Node 26 and Node 24. * Node 26 is adjacent to Hexes 12 (Ore 3), 7 (Wheat 8), and 16 (Sheep 11), and crucially, it has an Ore 2:1 port. This is an exceptionally strong potential second settlement spot. It provides high-frequency Wheat (Wh8), which is a critical missing resource, and duplicates my S11 and O3 production (both good numbers). The O2 port further enhances my Ore economy and offers excellent trading flexibility. This spot would set me up for a powerful city and development card strategy. * Node 24 is adjacent to Hexes 11 (Desert), 7 (Wheat 8), and 6 (Wood 3). This node offers two critical missing resources: Wood (W3) and Wheat (Wh8). If Node 26 is taken by Player B (which is a high possibility given its strength), Node 24 provides an excellent fallback option. Taking Node 24 would round out my resource production to include Sheep, Ore, Wood, and Wheat, providing a balanced foundation for both expansion (roads, settlements) and development.Comparing the options: The road to Node 25 offers the best combination of a premium primary target (Node 26) and a highly valuable fallback option (Node 24). Node 26 is arguably superior to Node 45 (from the 35-34 path) due to the higher Wheat number (8 vs 6) and the O2 port, which provides more flexibility than a direct O2 production. More importantly, Node 24 is a significantly better fallback option than Node 33. Node 24 directly addresses my lack of Wood and Wheat, providing a balanced resource profile, whereas Node 33 is extremely poor. The 35-37 port access is good for flexibility but does not secure new resource production, which is a higher priority at this stage.Therefore, placing the road from 35 to 25 provides the greatest flexibility and strongest potential outcomes for my second settlement, whether I secure the resource-heavy Node 26 or the balanced-resource Node 24. This choice sets me up for a robust early game, adapting to Player B's placements. My short-term tactic is to open up access to these prime locations. My long-term strategy is to build a strong resource engine for cities and development cards, which these nodes facilitate by providing Wheat and strong production numbers. The risk is that Player B takes both 26 and 24, but this path gives me the best chance. I will place the road from 35 to 25.", + "note_to_self": "Aim for Node 26 (Wh8, S11, O3 + O2 port) for second settlement if available. If not, Node 24 (W3, Wh8, D) is a strong fallback to get Wood and Wheat.", + "say_outloud": null, + "action_type": "place_starting_road", + "parameters": { + "from": 35, + "to": 25 + } + }, + "model": "gemini-2.5-flash", + "tokens": { + "prompt": 1659, + "completion": 1296, + "total": 9988 + }, + "latency_seconds": 40.23297905921936, + "error": null +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_014638/session_metadata.json b/examples/ai_testing/my_games/session_20260109_014638/session_metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..9192ab4c2ee79b25bda4ba1ba177a28706103fb7 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_014638/session_metadata.json @@ -0,0 +1,5 @@ +{ + "session_id": "session_20260109_014638", + "start_time": "2026-01-09T01:46:38.042037", + "version": "2.0" +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_015314/A/A.md b/examples/ai_testing/my_games/session_20260109_015314/A/A.md new file mode 100644 index 0000000000000000000000000000000000000000..25c97e2d673178728e286715b33c546d8eec767f --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_015314/A/A.md @@ -0,0 +1,27 @@ +# AI Agent Log: A + +**Session:** session_20260109_015314 +**Started:** 2026-01-09 01:53:15 +**Model:** gemini-2.0-flash + +--- + + +## Request #1 - 🎯 ACTIVE TURN + +**Time:** 01:53:17 + +### What Happened +• Game c20b5c09-fe80-43e4-aa6d-3b2c10902d8a has started with 2 players! +• Turn 0: Player 0's turn begins. + +### Prompt Sent +See: [prompt_1.json](prompts/prompt_1.json) + +### Response Received ✅ + +**Latency:** 42.28s | **Tokens:** 10707 + +**Thinking:** As the first player, my goal is to secure a strong, diverse resource income with high-probability numbers. I need resources for building roads and settlements early on (Wood, Brick, Sheep, Wheat) and ... + +--- diff --git a/examples/ai_testing/my_games/session_20260109_015314/A/prompts/prompt_1.json b/examples/ai_testing/my_games/session_20260109_015314/A/prompts/prompt_1.json new file mode 100644 index 0000000000000000000000000000000000000000..54bedbae388c8c2736655cd5128b54023d68001e --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_015314/A/prompts/prompt_1.json @@ -0,0 +1,95 @@ +{ + "request_number": 1, + "timestamp": "2026-01-09T01:53:17.051392", + "player_name": "A", + "is_active_turn": true, + "prompt": { + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game c20b5c09-fe80-43e4-aa6d-3b2c10902d8a has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[],\"rds\":[]},\"players\":{\"A\":{\"vp\":0,\"res\":{}},\"B\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } + }, + "response_schema": { + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] + }, + "what_happened": "• Game c20b5c09-fe80-43e4-aa6d-3b2c10902d8a has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_015314/A/prompts/prompt_1.txt b/examples/ai_testing/my_games/session_20260109_015314/A/prompts/prompt_1.txt new file mode 100644 index 0000000000000000000000000000000000000000..0bfba675d1b473f49b249a7bdefae664cec3b4be --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_015314/A/prompts/prompt_1.txt @@ -0,0 +1,87 @@ +=== Prompt #1 for A === +Timestamp: 2026-01-09T01:53:17.052232 +Active Turn: True + +--- What Happened --- +• Game c20b5c09-fe80-43e4-aa6d-3b2c10902d8a has started with 2 players! +• Turn 0: Player 0's turn begins. + +--- Response Schema --- +{ + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why?", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] +} + +--- Prompt Content --- +{ + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game c20b5c09-fe80-43e4-aa6d-3b2c10902d8a has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[],\"rds\":[]},\"players\":{\"A\":{\"vp\":0,\"res\":{}},\"B\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } +} diff --git a/examples/ai_testing/my_games/session_20260109_015314/A/responses/response_1.json b/examples/ai_testing/my_games/session_20260109_015314/A/responses/response_1.json new file mode 100644 index 0000000000000000000000000000000000000000..1cbebec0445a03cf2d5a55fa1053ab27f667e2b2 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_015314/A/responses/response_1.json @@ -0,0 +1,24 @@ +{ + "request_number": 1, + "timestamp": "2026-01-09T01:54:00.800565", + "player_name": "A", + "success": true, + "raw_content": "{\"internal_thinking\": \"As the first player, my goal is to secure a strong, diverse resource income with high-probability numbers. I need resources for building roads and settlements early on (Wood, Brick, Sheep, Wheat) and eventually Ore for cities. I evaluated various nodes based on the resources they provide, their associated dice roll probabilities, and the presence of ports. Nodes 10, 11, and 20 all offer excellent Brick and Sheep production on high-probability numbers (6, 8, 5) along with some Wood. Specifically, Node 10 (B6, S8, W12) provides Brick (6), Sheep (8), and Wood (12). This combination gives me two essential building resources (Brick, Sheep) on strong numbers, plus Wood. This is a solid foundation for early expansion and sets me up to acquire Wheat and Ore with my second settlement. While nodes with Ore (like Node 41 or 42) are attractive, securing a broad base of basic resources for initial development is often more critical as the first player.\", \"action\": {\"type\": \"place_starting_settlement\", \"parameters\": \"{\\\"node\\\": 10}\"}}", + "parsed": { + "internal_thinking": "As the first player, my goal is to secure a strong, diverse resource income with high-probability numbers. I need resources for building roads and settlements early on (Wood, Brick, Sheep, Wheat) and eventually Ore for cities. I evaluated various nodes based on the resources they provide, their associated dice roll probabilities, and the presence of ports. Nodes 10, 11, and 20 all offer excellent Brick and Sheep production on high-probability numbers (6, 8, 5) along with some Wood. Specifically, Node 10 (B6, S8, W12) provides Brick (6), Sheep (8), and Wood (12). This combination gives me two essential building resources (Brick, Sheep) on strong numbers, plus Wood. This is a solid foundation for early expansion and sets me up to acquire Wheat and Ore with my second settlement. While nodes with Ore (like Node 41 or 42) are attractive, securing a broad base of basic resources for initial development is often more critical as the first player. [Response was too brief]", + "note_to_self": null, + "say_outloud": null, + "action_type": "place_starting_settlement", + "parameters": { + "node": 10 + } + }, + "model": "gemini-2.5-flash", + "tokens": { + "prompt": 1627, + "completion": 252, + "total": 10707 + }, + "latency_seconds": 42.282586336135864, + "error": null +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_015314/session_metadata.json b/examples/ai_testing/my_games/session_20260109_015314/session_metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..91845508ed2fff1e6ef8e3b61beef4d34379dfb8 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_015314/session_metadata.json @@ -0,0 +1,5 @@ +{ + "session_id": "session_20260109_015314", + "start_time": "2026-01-09T01:53:15.001554", + "version": "2.0" +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_020107/A/A.md b/examples/ai_testing/my_games/session_20260109_020107/A/A.md new file mode 100644 index 0000000000000000000000000000000000000000..1d3e3cb9f260c8503e6b8ba43a89c5828c4785ee --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_020107/A/A.md @@ -0,0 +1,20 @@ +# AI Agent Log: A + +**Session:** session_20260109_020107 +**Started:** 2026-01-09 02:01:07 +**Model:** gemini-2.0-flash + +--- + + +## Request #1 - 🎯 ACTIVE TURN + +**Time:** 02:01:09 + +### What Happened +• Game 3a7a3455-7174-4727-b718-fef2f35d47f9 has started with 2 players! +• Turn 0: Player 0's turn begins. + +### Prompt Sent +See: [prompt_1.json](prompts/prompt_1.json) + diff --git a/examples/ai_testing/my_games/session_20260109_020107/A/prompts/prompt_1.json b/examples/ai_testing/my_games/session_20260109_020107/A/prompts/prompt_1.json new file mode 100644 index 0000000000000000000000000000000000000000..e789edf0fa7eacaececc391856537f250653e595 --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_020107/A/prompts/prompt_1.json @@ -0,0 +1,95 @@ +{ + "request_number": 1, + "timestamp": "2026-01-09T02:01:09.298662", + "player_name": "A", + "is_active_turn": true, + "prompt": { + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game 3a7a3455-7174-4727-b718-fef2f35d47f9 has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[],\"rds\":[]},\"players\":{\"A\":{\"vp\":0,\"res\":{}},\"B\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } + }, + "response_schema": { + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why? Do not invent resources. Verify indices in Array N carefully. Write a detailed analysis (600+ chars) only AFTER verifying the node data", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Save important observations and plans for future turns. Examples: opponent strategies, key nodes to claim, resource priorities, or threats to watch. This helps maintain continuity between turns.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "Communicate with other players! Use for: trade proposals, warnings, bluffs, alliance hints, or strategic banter. Makes the game more interesting and can influence opponents.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] + }, + "what_happened": "• Game 3a7a3455-7174-4727-b718-fef2f35d47f9 has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] +} \ No newline at end of file diff --git a/examples/ai_testing/my_games/session_20260109_020107/A/prompts/prompt_1.txt b/examples/ai_testing/my_games/session_20260109_020107/A/prompts/prompt_1.txt new file mode 100644 index 0000000000000000000000000000000000000000..b882efa65e207bd8ed4cdc2d1a5aff9ab2f545ac --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_020107/A/prompts/prompt_1.txt @@ -0,0 +1,87 @@ +=== Prompt #1 for A === +Timestamp: 2026-01-09T02:01:09.299679 +Active Turn: True + +--- What Happened --- +• Game 3a7a3455-7174-4727-b718-fef2f35d47f9 has started with 2 players! +• Turn 0: Player 0's turn begins. + +--- Response Schema --- +{ + "type": "object", + "required": [ + "internal_thinking", + "action" + ], + "properties": { + "internal_thinking": { + "type": "string", + "description": "Private strategy. What's your plan and why? Do not invent resources. Verify indices in Array N carefully. Write a detailed analysis (600+ chars) only AFTER verifying the node data", + "minLength": 1000 + }, + "note_to_self": { + "type": "string", + "description": "Save important observations and plans for future turns. Examples: opponent strategies, key nodes to claim, resource priorities, or threats to watch. This helps maintain continuity between turns.", + "maxLength": 100 + }, + "say_outloud": { + "type": "string", + "description": "Communicate with other players! Use for: trade proposals, warnings, bluffs, alliance hints, or strategic banter. Makes the game more interesting and can influence opponents.", + "maxLength": 100 + }, + "action": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The action type (must match one from allowed_actions in constraints)" + }, + "parameters": { + "type": "string", + "description": "Action parameters as JSON string. Example: {\"node\": 14} or {} if no parameters needed" + } + }, + "propertyOrdering": [ + "type", + "parameters" + ] + } + }, + "propertyOrdering": [ + "internal_thinking", + "note_to_self", + "say_outloud", + "action" + ] +} + +--- Prompt Content --- +{ + "meta_data": { + "agent_name": "A", + "role": null + }, + "task_context": { + "what_just_happened": "• Game 3a7a3455-7174-4727-b718-fef2f35d47f9 has started with 2 players!\n• Turn 0: Player 0's turn begins.", + "instructions": "Analyze the game state and select the optimal move from 'allowed_actions'. You have 2 possible actions. If you wish to negotiate or wait for other players, select the 'wait_for_response' action." + }, + "game_state": "\n 1. LOOKUP TABLES:\n • \"H\" (Hexes): Array where Index = HexID. Value = Resource+Num.\n Example: H[1]=\"W12\" -> Hex 1 is Wood 12.\n • \"N\" (Nodes): Array where Index = NodeID.\n Format: [ [Neighbors], [HexIDs], Port? ]\n Logic: To find yield of Node 10, check N[10]. Get HexIDs (e.g. [1,5]). Look up H[1] and H[5].\n\n2. CODES: W=Wood, B=Brick, S=Sheep, Wh=Wheat, O=Ore, D=Desert.\n ?3=Any 3:1 port, X2=Specific Resource 2:1 port.\n\n3. STATE: \"bld\"=[NodeID, Owner, Type], \"rds\"=[[From,To], Owner].\n\n4. PLAYERS: \"res\"={Resource:Count}, \"dev\"={\"h\":[Hidden Cards], \"r\":[Revealed] (K=Knight)}, \n \"stat\"=[\"LR\" (Longest Road), \"LA\" (Largest Army)].\n\n5. ROBBER: Located at HexID specified in \"meta.robber\". H[id] is blocked.\n\nJSON:\n{\"meta\":{\"curr\":\"A\",\"phase\":\"SETUP_FIRST_ROUND\",\"robber\":10,\"dice\":null},\"H\":[\"\",\"W12\",\"S5\",\"W4\",\"S8\",\"B6\",\"W3\",\"Wh8\",\"B10\",\"W11\",\"D\",\"O3\",\"S4\",\"B10\",\"Wh9\",\"Wh6\",\"S11\",\"O5\",\"Wh9\",\"O2\"],\"N\":[null,[[2,9],[1]],[[1,3],[1],\"Wh2\"],[[2,4,11],[2,1],\"Wh2\"],[[3,5],[2]],[[4,6,13],[3,2]],[[5,7],[3],\"B2\"],[[6,15],[3],\"B2\"],[[9,18],[4],\"?3\"],[[8,10,1],[4,1],\"?3\"],[[9,11,20],[5,4,1]],[[10,12,3],[5,2,1]],[[11,13,22],[6,5,2]],[[12,14,5],[6,3,2]],[[13,15,24],[7,6,3]],[[14,16,7],[7,3]],[[15,26],[7],\"O2\"],[[18,28],[8],\"S2\"],[[17,19,8],[8,4]],[[18,20,30],[9,8,4]],[[19,21,10],[9,5,4]],[[20,22,32],[10,9,5]],[[21,23,12],[10,6,5]],[[22,24,34],[11,10,6]],[[23,25,14],[11,7,6]],[[24,26,36],[12,11,7]],[[25,27,16],[12,7],\"O2\"],[[26,38],[12]],[[29,17],[8],\"S2\"],[[28,30,39],[13,8]],[[29,31,19],[13,9,8]],[[30,32,41],[14,13,9]],[[31,33,21],[14,10,9]],[[32,34,43],[15,14,10]],[[33,35,23],[15,11,10]],[[34,36,45],[16,15,11]],[[35,37,25],[16,12,11]],[[36,38,47],[16,12],\"?3\"],[[37,27],[12],\"?3\"],[[40,29],[13]],[[39,41,48],[17,13],\"W2\"],[[40,42,31],[17,14,13]],[[41,43,50],[18,17,14]],[[42,44,33],[18,15,14]],[[43,45,52],[19,18,15]],[[44,46,35],[19,16,15]],[[45,47,54],[19,16]],[[46,37],[16]],[[49,40],[17],\"W2\"],[[48,50],[17]],[[49,51,42],[18,17],\"?3\"],[[50,52],[18],\"?3\"],[[51,53,44],[19,18]],[[52,54],[19],\"?3\"],[[53,46],[19],\"?3\"]],\"state\":{\"bld\":[],\"rds\":[]},\"players\":{\"A\":{\"vp\":0,\"res\":{}},\"B\":{\"vp\":0,\"res\":{}}}}", + "constraints": { + "usage_instructions": "Choose one action type from the list below. Populate the 'parameters' field in your response strictly according to the 'example_parameters' structure provided.", + "allowed_actions": [ + { + "type": "place_starting_settlement", + "description": "Place your starting settlement", + "example_parameters": "{\"node\": X}" + }, + { + "type": "wait_for_response", + "description": "Do nothing on the board, just wait or communicate. Use this when you want to talk, negotiate, or think without taking a game action.", + "example_parameters": "{}" + } + ] + } +} diff --git a/examples/ai_testing/my_games/session_20260109_020107/session_metadata.json b/examples/ai_testing/my_games/session_20260109_020107/session_metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..5f34fff444ae3e769d06e6bc3b2dd22a2b71e21e --- /dev/null +++ b/examples/ai_testing/my_games/session_20260109_020107/session_metadata.json @@ -0,0 +1,5 @@ +{ + "session_id": "session_20260109_020107", + "start_time": "2026-01-09T02:01:07.249081", + "version": "2.0" +} \ No newline at end of file diff --git a/pycatan/ai/ai_user.py b/pycatan/ai/ai_user.py index 78c876d4a27fd99f97c89ccd37ec976234478706..e9a49a2d905c8200a719bb5b3500ec1bcfd95b3f 100644 --- a/pycatan/ai/ai_user.py +++ b/pycatan/ai/ai_user.py @@ -14,6 +14,7 @@ from typing import List, Optional, Dict, Any, TYPE_CHECKING from pycatan.players.user import User from pycatan.management.actions import Action, ActionType, GameState from pycatan.ai.state_optimizer import game_state_to_dict, optimize_state_for_ai +from pycatan.config.board_definition import board_definition if TYPE_CHECKING: from pycatan.ai.ai_manager import AIManager @@ -91,7 +92,7 @@ class AIUser(User): return action else: # Auto mode - use LLM response directly - return self._decision_to_action(decision) + return self._decision_to_action(decision, allowed_actions) def _get_manual_input(self, allowed_actions: Optional[List[str]]) -> Action: """ @@ -114,7 +115,7 @@ class AIUser(User): llm_response = self.ai_manager._last_llm_response if llm_response: print(f" [OK] Using LLM suggestion") - return self._decision_to_action(llm_response) + return self._decision_to_action(llm_response, allowed_actions) else: print(f" [!] No input and no LLM suggestion") continue @@ -125,7 +126,7 @@ class AIUser(User): # Parse the input decision = self.ai_manager.parse_manual_action(user_input) - action = self._decision_to_action(decision) + action = self._decision_to_action(decision, allowed_actions) # Validate against allowed actions if allowed_actions and action.action_type.name not in allowed_actions: @@ -167,12 +168,13 @@ class AIUser(User): e -> end_turn """) - def _decision_to_action(self, decision: Dict[str, Any]) -> Action: + def _decision_to_action(self, decision: Dict[str, Any], allowed_actions: Optional[List[str]] = None) -> Action: """ Convert AI decision dict to Action object. Args: decision: Dict with 'action_type' and 'parameters' + allowed_actions: List of allowed action type names (for auto-detection) Returns: Action object @@ -214,11 +216,15 @@ class AIUser(User): "buy": ActionType.BUY_DEV_CARD, } - # Handle setup phase shortcuts + # Auto-detect setup phase: if only PLACE_STARTING_SETTLEMENT is allowed, use it if action_type_str.lower() in ["s", "settlement", "build_settlement"]: - # Could be either BUILD_SETTLEMENT or PLACE_STARTING_SETTLEMENT - # This will be determined by GameManager validation - pass + if allowed_actions and "PLACE_STARTING_SETTLEMENT" in allowed_actions and "BUILD_SETTLEMENT" not in allowed_actions: + action_type_str = "place_starting_settlement" + + # Auto-detect setup phase for roads + if action_type_str.lower() in ["rd", "road", "build_road"]: + if allowed_actions and "PLACE_STARTING_ROAD" in allowed_actions and "BUILD_ROAD" not in allowed_actions: + action_type_str = "place_starting_road" action_type = action_map.get(action_type_str.lower()) @@ -257,33 +263,45 @@ class AIUser(User): # Map AI parameter names to GameManager names if action_type in [ActionType.BUILD_SETTLEMENT, ActionType.BUILD_CITY, ActionType.PLACE_STARTING_SETTLEMENT]: - # AI uses "node", GameManager uses "point_coords" + # AI uses "node" (point ID), GameManager uses "point_coords" ([row, col]) if "node" in parameters: - return {"point_coords": parameters["node"]} + node_id = parameters["node"] + # Convert node ID to game coordinates + coords = board_definition.point_id_to_game_coords(node_id) + if coords is None: + # Invalid node ID - return as-is, GameManager will handle error + return {"point_coords": node_id} + return {"point_coords": list(coords)} elif "point_coords" in parameters: return parameters else: return parameters elif action_type in [ActionType.BUILD_ROAD, ActionType.PLACE_STARTING_ROAD]: - # AI uses "from"/"to", GameManager uses "start_coords"/"end_coords" + # AI uses "from"/"to" (node IDs), GameManager uses "start_coords"/"end_coords" ([row, col]) result = {} if "from" in parameters: - result["start_coords"] = parameters["from"] + from_id = parameters["from"] + coords = board_definition.point_id_to_game_coords(from_id) + result["start_coords"] = list(coords) if coords else from_id elif "start_coords" in parameters: result["start_coords"] = parameters["start_coords"] if "to" in parameters: - result["end_coords"] = parameters["to"] + to_id = parameters["to"] + coords = board_definition.point_id_to_game_coords(to_id) + result["end_coords"] = list(coords) if coords else to_id elif "end_coords" in parameters: result["end_coords"] = parameters["end_coords"] return result elif action_type == ActionType.ROBBER_MOVE: - # AI uses "hex", GameManager uses "tile_coords" + # AI uses "hex" (hex ID), GameManager uses "tile_coords" ([row, col]) if "hex" in parameters: - return {"tile_coords": parameters["hex"]} + hex_id = parameters["hex"] + coords = board_definition.hex_id_to_game_coords(hex_id) + return {"tile_coords": list(coords) if coords else hex_id} elif "tile_coords" in parameters: return parameters else: diff --git a/pycatan/ai/schemas.py b/pycatan/ai/schemas.py index 021652645fd3e7be264f663f8a0b32a7db8c530c..efcc109bd4cd9f312ab002bccd8db70870868343 100644 --- a/pycatan/ai/schemas.py +++ b/pycatan/ai/schemas.py @@ -24,17 +24,17 @@ ACTIVE_TURN_RESPONSE_SCHEMA = { "properties": { "internal_thinking": { "type": "string", - "description": "Private strategy. What's your plan and why?", + "description": "Private strategy. What's your plan and why? Do not invent resources. Verify indices in Array N carefully. Write a detailed analysis (600+ chars) only AFTER verifying the node data", "minLength": 1000 }, "note_to_self": { "type": "string", - "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "description": "Save important observations and plans for future turns. Examples: opponent strategies, key nodes to claim, resource priorities, or threats to watch. This helps maintain continuity between turns.", "maxLength": 100 }, "say_outloud": { "type": "string", - "description": "A short message to other players (max 100 chars). Use for negotiation, threats, or table talk. Keep in mind you pay for speak outload.", + "description": "Communicate with other players! Use for: trade proposals, warnings, bluffs, alliance hints, or strategic banter. Makes the game more interesting and can influence opponents.", "maxLength": 100 }, "action": { @@ -69,17 +69,17 @@ OBSERVING_RESPONSE_SCHEMA = { "properties": { "internal_thinking": { "type": "string", - "description": "Track what's happening. What are opponents doing? What's your strategy for next turn?", + "description": "Track what's happening. Analyze opponent moves by verifying their positions in Array N and resources from Array H. What patterns do you see? What's your strategy for next turn? Be specific about locations and threats.", "minLength": 30 }, "note_to_self": { "type": "string", - "description": "Important facts for when it's your turn. Use only if essential for clarity or direct user query. Omit otherwise.", + "description": "Track key developments! Note opponent positions, resource imbalances, or strategic opportunities you noticed. This memory persists between turns.", "maxLength": 100 }, "say_outloud": { "type": "string", - "description": "Optional message to other players (max 100 chars). Propose trades or negotiate. You pay for this.", + "description": "Even when observing, you can negotiate! Propose trades, form alliances, or send strategic messages. Example: 'I'll trade ore for wheat next turn' or 'Nice move!'", "maxLength": 100 } }, @@ -122,19 +122,19 @@ def get_schema_description(response_type: ResponseType) -> str: if response_type == ResponseType.ACTIVE_TURN: return ( "Response must include:\n" - "- internal_thinking: Your strategy (min 50 chars)\n" + "- internal_thinking: VERIFY data from Arrays N/H first, then write 1000+ char analysis\n" "- action: {type: action_name, parameters: {...}}\n" - "Optional:\n" - "- note_to_self: Important reminder (max 100 chars)\n" - "- say_outloud: Message to other players (max 100 chars)" + "Encouraged (use frequently!):\n" + "- note_to_self: Save key observations for future turns (max 100 chars)\n" + "- say_outloud: Communicate with other players (max 100 chars)" ) elif response_type == ResponseType.OBSERVING: return ( "Response must include:\n" - "- internal_thinking: What you observed (min 30 chars)\n" - "Optional:\n" - "- note_to_self: Important reminder (max 100 chars)\n" - "- say_outloud: Message to other players (max 100 chars)" + "- internal_thinking: Track opponent moves, verify positions in Arrays N/H (min 30 chars)\n" + "Encouraged (use frequently!):\n" + "- note_to_self: Track key developments for later (max 100 chars)\n" + "- say_outloud: Negotiate or send messages (max 100 chars)" ) else: return "Unknown response type"