I gave the system instructions an example and did some experiments.
Here’s an example,
Player AI action data is organised in a map (key:value) structure.
{Flee : 1, Throw : 2, Charge : 3, Dodge : 4} when you create a player AI action data, it can only respond with example struct below.
answer :
{1,3,2} or {3,2,14}
1.5 flash AI same answer or include key{“Dodge”: 4,“Charge”: 3,“Throw”: 2, “Flee”: 1}
1.5 pro answer is { 3,2,1,4} or { 1,2,3,4}
Do you have any recommendations for creating like this format data?
The first is to make your instructions explicitly clear about what the expected input is and what the expected output should be. Remember - these are pattern machines, so you need to establish what the pattern is. For example:
The user will give an instruction.
Based on this table, you should give the number that matches their
actions.
Action table:
{
Flee: 1,
Throw: 2,
Charge: 3,
Dodge: 4
}
You should respond with a list of number about the player's action.
Action example 1: Avoid the arrow while trying to run away
Response example 1: (4, 1)
Action example 2: Attack with my sword
Response example 2: (3)
Action: ${user input here}
Response:
The second is that you may wish to use JSON Mode with a JSON schema to specify the output. Note that in 1.5 Flash you need to specify the schema as part of the prompt - there isn’t a separate field.
The problem here is you are misusing data structures very common across multiple programming languages within AI training.
Dictionary: {"this key's value": 3}
List: [3, 3, 4, 2]
Dictionary with list as value: {"list_of_actions": [1, 2, 4, 2]}
JSON has nearly indistinguishable forms “object” and “array”.
So, if you want a list as output, specify and parse a list. You can make it more data-like instead of ambiguous.
If your post is representative of the kind of language in the system prompt, it also could be clearer and task-based, stating the intention and the recipient of the data.