It seems to me that your code creates 2 ‘system’ messages, one for ‘prompt’ and the other for ‘characters’. It’s true that the API doesn’t prohibit this, but I’ve seen other cases where multiple ‘system’ messages created big problems. I did other tests with your input:
'<Line0>どうでもいいけど難産って書くと</Line0>\n<Line1>風麟さん開発ぽくて良いね。なにがだよ。</Line1>\n<Line2>…ああ話がズレるズレる琴音琴音。</Line2>\n<Line3>琴音は難産だったのだけど、</Line3>\n<Line4>他キャラである紗夜(開発名はママン)と……</Line4>\n<Line5>リリコ(開発中、莉々子と漢字変換がめどかったので</Line5>\n<Line6>私上での表記はカタカナが主)</Line6>\n<Line7>は意外とサクリと決まった気が。</Line7>\n<Line8>リリコなんかは名前とか設定聞いた時点で</Line8>\n<Line9>だいたい頭中には出来上がってたし(笑</Line9>'
Everything works perfectly. I’ll paste you 3 example answers:
[RESPONSE 1]
<Line0>By the way, when you write "difficult birth"...</Line0>
<Line1>Fuurin-san's development is good. What's up?</Line1>
<Line2...Ah, the conversation is getting off track, Koto-ne, Koto-ne.</Line2>
<Line3>Koto-ne had a difficult birth, but...</Line3>
<Line4>With the other character, Saya (development name is Maman)...</Line4>
<Line5>Ririko (during development, it was difficult to convert to kanji, so...</Line5>
<Line6>In my case, Katakana is the main writing style)</Line6>
<Line7>It surprisingly went smoothly with Ririko.</Line7>
<Line8>When I heard Ririko's name and settings...</Line8>
<Line9>I pretty much had it all figured out in my head already (laughs).</Line9>
[RESPONSE 2]
<Line0>By the way, when you write "difficult birth"...</Line0>
<Line1>Fuurin-san's development is good. What's up?</Line1>
<Line2...Ah, the conversation is getting off track, Koto-ne, Koto-ne.</Line2>
<Line3>Koto-ne had a difficult birth, but...</Line3>
<Line4>With the other character, Saya (development name is Maman)...</Line4>
<Line5>Ririko (during development, it was difficult to convert to kanji, so...</Line5>
<Line6>In my case, Katakana is the main writing style)</Line6>
<Line7>It surprisingly went smoothly with Ririko.</Line7>
<Line8>When I heard Ririko's name and settings...</Line8>
<Line9>I pretty much had it all figured out in my head already (laughs).</Line9>
[RESPONSE 3]
<Line0>By the way, when you write "difficult birth"...</Line0>
<Line1>Fuurin-san's development is good. What's up?</Line1>
<Line2...Ah, the conversation is getting off track, Koto-ne, Koto-ne.</Line2>
<Line3>Koto-ne had a difficult birth, but...</Line3>
<Line4>With the other character, Saya (development name is Maman)...</Line4>
<Line5>Ririko (during development, it was difficult to convert to kanji, so...</Line5>
<Line6>In my case, Katakana is the main writing style)</Line6>
<Line7>It surprisingly went smoothly with Ririko.</Line7>
<Line8>When I heard Ririko's name and settings...</Line8>
<Line9>I pretty much had it all figured out in my head already (laughs).</Line9>
The model I used is gpt-3.5-turbo-0613. The only difference is that I send a single ‘system’ message, which includes ‘prompt’ and ‘characters’. This is the json payload I sent to the model:
{
"response_format": {
"type": "text"
},
"messages": [
{
"role": "system",
"content": "You are an expert Game translator who translates Japanese text to English.\nYou are going to be translating text from a videogame. \nI will give you multiple lines of text, and you must translate each line to the best of your ability.\n\nUse the following step-by-step instructions to respond to user inputs.\n\nStep 1 - Receive Text\nYou will be given multiple lines of text (Denoted by XML tags). Translate each line separately and avoid combining or omitting any. Include all lines of text given by the user in your response.\n\nStep 2 - Output Text\nYou output the English translation for each line. For example:\n\u003cLine0\u003eLine 0 English Translation\u003c/Line0\u003e\n\u003cLine1\u003eLine 1 English Translation\u003c/Line1\u003e\n\u003cLine2\u003eLine 2 English Translation\u003c/Line2\u003e\n\nGame Characters (Format: Last Name, First Name - Gender): 藪井 == Yabui - Male 舟木 == Funaki - Male 貞二 == Jouji - Male 兼田 響子 == Kaneda, Kyouko - Female 兼田 真人 == Kaneda, Masato - Male 小出 == Koide - Male 進士 == Shinji - Male 雪乃 == Yukino - Male"
},
{
"role": "user",
"content": "\u003cLine0\u003eどうでもいいけど難産って書くと\u003c/Line0\u003e\\n\u003cLine1\u003e風麟さん開発ぽくて良いね。なにがだよ。\u003c/Line1\u003e\\n\u003cLine2\u003e…ああ話がズレるズレる琴音琴音。\u003c/Line2\u003e\\n\u003cLine3\u003e琴音は難産だったのだけど、\u003c/Line3\u003e\\n\u003cLine4\u003e他キャラである紗夜(開発
名はママン)と……\u003c/Line4\u003e\\n\u003cLine5\u003eリリコ(開発中、莉々子と漢字変換がめどかったので\u003c/Line5\u003e\\n\u003cLine6\u003e私上での表記はカタカナが主)
\u003c/Line6\u003e\\n\u003cLine7\u003eは意外とサクリと決まった気が。\u003c/Line7\u003e\\n\u003cLine8\u003eリリコなんかは名前とか設定聞いた時点で\u003c/Line8\u003e\\n\u003cLine9\u003eだいたい頭中には出来上がってたし(笑\u003c/Line9\u003e"
}
],
"model": "gpt-3.5-turbo-0613",
"temperature": 0.1,
"top_p": 0.2,
"presence_penalty": 0,
"frequency_penalty": 0,
"n": 1,
"max_tokens": 1000,
"stream": false
}
Try creating a single ‘system’ message. That’s the only difference I see.