Different response from Web and API with same prompt

Hello,

I hope you can help with a problem using OpenAI with a german prompt.

I am using this prompt with gpt-3.5-turbo:
Erstelle Klassifikationen für das Buch “Als die Welt uns gehörte” von “Liz Kessler” in den Bibliothekssystemen ASB, KAB und SFB. Generiere je eine passende Signatur pro System für eine **Schulbibliothek** sowie für eine **öffentliche Bibliothek**. Gib nur die jeweilige Signatur und das verwendete Bibliothekssystem zurück, ohne weitere Erläuterungen. ## Schritte: - Analysiere Buchinhalt, Genre und Zielgruppe, um passende Signaturen pro System zu bestimmen. - Erstelle jeweils eine Signatur pro System für **Schulbibliothek** und **öffentliche Bibliothek**. - Formatiere die Ergebnisse ausschließlich als JSON. Als Schlüssel nutze das Bibliothekssystem, als Wert die Signatur. - Gib zuerst das Ergebnis für die Schulbibliothek, dann für die öffentliche Bibliothek zurück. - Füge keine weiteren Erklärungen, Kommentare oder Fließtext hinzu. **Wichtige Hinweise:** - Die Reihenfolge ist stets: ASB, dann KAB, dann SFB. - Das Ergebnis darf ausschließlich die finale JSON-Struktur enthalten. - ersetze im JSon den String **Schulbibliothek** durch School und **öffentliche Bibliothek** durch **Library**

translated to english:
Create classifications for the book ‘Als die Welt uns gehörte’ by Liz Kessler in the ASB, KAB and SFB library systems. Generate a suitable classification number for each system for a school library and a public library. Return only the respective classification number and the library system used, without further explanation. ## Steps: - Analyse the book’s content, genre and target audience to determine suitable call numbers for each system. - Create one call number per system for school libraries and public libraries. - Format the results exclusively as JSON. Use the library system as the key and the call number as the value. - Return the result for the school library first, then for the public library. - Do not add any further explanations, comments or continuous text. Important notes: - The order is always: ASB, then KAB, then SFB. - The result may only contain the final JSON structure. - Replace the string **School Libray** with **School** and **public library** with **library** in the JSON.

Using this prompt in the web-interface returns the correct Json:
{
“School”: {
“ASB”: “Z KES”,
“KAB”: “R KES”,
“SFB”: “ERL KES”
},
“Library”: {
“ASB”: “Z KES”,
“KAB”: “R000 KES”,
“SFB”: “ERL KES”
}
}

Using this prompt via API returns (shortened here to show only the difference):
{
“model”: “gpt-3.5-turbo-0125”,
“choices”: [
{
“index”: 0,
“message”: {
“role”: “assistant”,
“content”: “{\n “ASB”: “Fiction - Youth - Kessler”,\n “KAB”: “Jugendbuch - Kessler - Fiktion”,\n “SFB”: “Kessler - Jugendbuch - Belletristik”\n}”,
“refusal”: null
},

“service_tier”: “default”,
“system_fingerprint”: null
}

What do I have to change to get
“content”: “{
“School”: {\n “ASB”: “Z KES”, \n “KAB”: “R KES”, \n “SFB”: “ERL KES” \n}, \n“Library”: {\n“ASB”: “Z KES”, \n“KAB”: “R000 KES”, \n “SFB”: “ERL KES” \n } \n }”

instead of

“content”: “{\n “ASB”: “Fiction - Youth - Kessler”,\n “KAB”: “Jugendbuch - Kessler - Fiktion”,\n “SFB”: “Kessler - Jugendbuch - Belletristik”\n}”,

When I send the prompt in english I get
“content”: “{\n “School”: {\n “ASB”: “F Kessler, L. 2021”,\n “KAB”: “F Kessler”,\n “SFB”: “FIC/KES”\n },\n “Library”: {\n “ASB”: “F Kessler, L. 2021”,\n “KAB”: “F Kessler”,\n “SFB”: “FIC/KES”\n }\n}”,

That is wrong because for example it must be “ASB”: “Z KES” like in the response from web and not “ASB”: “F Kessler, L. 2021”,

Maybe I have to use an other model instead of ‘gpt-3.5-turbo’ ??

best regards,

Siegbert

I found one mistake by myself: using an old model. I changed to gpt-5.2 with a little better but already wrong response:
“content”: “{\n “School”: {\n “ASB”: “J 5 KESS”,\n “KAB”: “KESS”,\n “SFB”: “J KESS”\n },\n “Library”: {\n “ASB”: “H KESS”,\n “KAB”: “KESS”,\n “SFB”: “ROM KESS”\n }\n}”,

the classification “J” doesn’t exist in the classification-systems KAB and ASB

I post the request with parameters:

  • role: user
  • content: prompt
  • model: gpt-5.2

Sorry for asking and self-answering :slight_smile:
I found the solution:
I have to set the parameter “temperature” to a low value. With the default there are errors with 0.1 i get the correct result.

This topic was automatically closed after 24 hours. New replies are no longer allowed.