Why is the chatbot not able to retain history like in the playground?

Thankyou so much for replying , indeed really helpful. But the main issue is that why the model is unable to respond in the same way as it is responding in the playground? For the same prompt the model is unable to reply in the same way as it is doing in the playground, i have kept the temp, penalty ,top_p and others the same as in the playground even the model name still it is not producing the same response ,how to resolve that…

response = client.chat.completions.create(
model=“ft:gpt-3.5-turbo-1106:personal::8fnxqkawLD”,
messages=[
{
“role”: “user”,
“content”: Body} # The role can be ‘system’, ‘user’, or ‘assistant’
],
temperature=0,
max_tokens=256,
top_p=1,
frequency_penalty=0,
presence_penalty=0

)

chat_response = response.choices[0].message.content.strip()

how can i get the same response as in the playground, i kept the temp=0, although it is 1 in playground but even keeping that 1 does not work out. Please help