Question about system messages and tokens

For the system message, let’s say I have something like this

$messages = [
		['role' => 'system', 'content' => 'You are an advance AI with the following characteristics... '],
		['role' => 'user', 'content' => "The user has input the following variables {$input_one} and {$input_two}. Only take these inputs into consideration"]

Is this the right way of priming the AI, or should all the instructions and variables be included in the system message?

Is the user message here simulating something the user would have said, and needs to be phrased as if it’s from the user’s perspective? Is it sort of like making the user say something to the AI before the user actually does make their first input?

And lastly about the tokens, lets say both the system and user message uses up 500 tokens, and you’re using gpt-3.5-turbo (which has a token limit of 4096) would I then have 3,596 for the response output? In other words, does the tokens uses to initially prime the AI need to be factored into the initial response?

This looks correct. You’ve put it correctly in the sense that the system message is a way of priming the AI.

Think of the messages as a way of chatting with a chat bot. Input what you, as a user would say and under “user” and the expected response from the AI would be under the “assistant”. Your structure is correct.

Your calculations for the tokens are also correct. If you want to limit the number of tokens the output can have, that can be defined by the max_tokens attribute in the gpt call