Does conversation object store deverloper message?
I am wondering if the developer message or instructions are stored in conversation object.
For example I have. toy code
model_name = "gpt-4.1-mini"
stream_mode = False if "gpt-5" in model_name else True
developer_msg = """
You are a friendly and helpful AI assistant. Please follow these guidelines:
1. Respond to user questions in Thai language
2. Keep your answers concise and to the point.
3. Use polite and respectful language appropriate for Thai culture
4. While you don't have a gender, maintain a courteous and professional tone
5. Pay attention to and remember user preferences and information they share
6. Be attentive to context from previous messages in the conversation
Always aim to be helpful while being culturally appropriate and respectful.
"""
chat_hist = []
while True:
item = {
"id": str(uuid.uuid4()),
"user_id_bot_id": f"{user_id}_{bot_id}",
"ts": Decimal(str(time.time() * 1000)),
"openai_conversation_id": conversation.id,
}
user_msg: str = input().strip()
user_timestamp = Decimal(str(time.time() * 1000))
if user_msg in ["exit", "quit", "q"]:
break
response = client.responses.create(
model=model_name,
input=user_msg,
stream=stream_mode,
instructions=developer_msg,
conversation=conversation.id,
)
print("=" * 20, "User", "=" * 20)
print(user_msg)
print("=" * 20, "Assistant", "=" * 20)
assistant_msg = response_stream(response, stream_mode)
assistant_timestamp = Decimal(str(time.time() * 1000))
print()
conversation_data = [
{"role": "user", "content": user_msg, "timestamp": user_timestamp},
{
"role": "assistant",
"content": assistant_msg,
"timestamp": assistant_timestamp,
},
]
item["conversation"] = [
{"role": "user", "content": user_msg, "timestamp": user_timestamp},
{
"role": "assistant",
"content": assistant_msg,
"timestamp": assistant_timestamp,
},
]
chat_hist.append(item)
When I use the below code to get conversation items, it return
items = client.conversations.items.list("my_id", limit=100)
items.data
[Message(id='msg_68c2364f6288819780db9ea2c4e28e100343fa374e895ca5', content=[OutputTextContent(annotations=[], text='ถ้าอย่างนั้นผม/ดิฉันขอแนะนำร้านก๋วยเตี๋ยวต้มยำที่ดังและรสชาติเยี่ยมหลายร้านเลยครับ/ค่ะ เช่น ร้านต้มยำต้นตำรับ ร้านก๋วยเตี๋ยวต้มยำเจ้าเก่า หรือถ้าชอบแบบสตรีทฟู้ด มีร้านรถเข็นใกล้บ้านที่มักจะเป็นที่ชื่นชอบของคนท้องถิ่นด้วยครับ/ค่ะ \n\nคุณอยู่แถวไหนครับ/ค่ะ จะได้ช่วยแนะนำร้านใกล้ๆ ให้เหมาะกับคุณมากขึ้นครับ/ค่ะ?', type='output_text', logprobs=[])], role='assistant', status='completed', type='message'),
Message(id='msg_68c2364f10288197b583e6df49c3d2010343fa374e895ca5', content=[InputTextContent(text='ยังไม่มีเลย', type='input_text')], role='user', status='completed', type='message'),
Message(id='msg_68c2364a6b148197932166870cafa9e60343fa374e895ca5', content=[OutputTextContent(annotations=[], text='ขอโทษครับ/ค่ะ พอดีไม่แน่ใจความหมายของคำว่า "บั" คุณช่วยอธิบายเพิ่มเติมได้ไหมครับ/ค่ะ?', type='output_text', logprobs=[])], role='assistant', status='completed', type='message'),
Message(id='msg_68c23649c60881979237d6e8a86fd8aa0343fa374e895ca5', content=[InputTextContent(text='บั', type='input_text')], role='user', status='completed', type='message'),
Message(id='msg_68c236432b9c819794e515cc07874b400343fa374e895ca5', content=[OutputTextContent(annotations=[], text='ก๋วยเตี๋ยวต้มยำอร่อยเปรี้ยวเผ็ดกำลังดีเลยครับ/ค่ะ มีร้านก๋วยเตี๋ยวต้มยำร้านโปรดในใจหรืออยากให้ช่วยแนะนำร้านใกล้ๆ ที่น่าสนใจไหมครับ/ค่ะ?', type='output_text', logprobs=[])], role='assistant', status='completed', type='message'),
Message(id='msg_68c236428dac8197bca848e56271d1890343fa374e895ca5', content=[InputTextContent(text='ต้มยำนะ', type='input_text')], role='user', status='completed', type='message'),
Message(id='msg_68c23638d8f481978163906199fab4d60343fa374e895ca5', content=[OutputTextContent(annotations=[], text='น่าทานมากเลยนะครับ/ค่ะ คุณชอบก๋วยเตี๋ยวแบบไหนเป็นพิเศษไหมครับ/ค่ะ เช่น ก๋วยเตี๋ยวเรือ ก๋วยเตี๋ยวน้ำใส หรือก๋วยเตี๋ยวต้มยำ?', type='output_text', logprobs=[])], role='assistant', status='completed', type='message'),
Message(id='msg_68c23637fc24819784bd3724d8a5a5e60343fa374e895ca5', content=[InputTextContent(text='อยากไปกินก๋วยเตี๋ยวจัง', type='input_text')], role='user', status='completed', type='message'),
Message(id='msg_68c23625d5488197bfd8db02396cb4de0343fa374e895ca5', content=[OutputTextContent(annotations=[], text='สวัสดีครับ/ค่ะ มีอะไรให้ช่วยเหลือหรือสอบถามไหมครับ/ค่ะ?', type='output_text', logprobs=[])], role='assistant', status='completed', type='message'),
Message(id='msg_68c236253c0c819797f89ad5b028e86e0343fa374e895ca5', content=[InputTextContent(text='สวัสดี', type='input_text')], role='user', status='completed', type='message')]