Is Xano filtering OpenAI's response?

Options

I've got Xano successfully connected to OpenAI and the responses that I am generating almost always have multiple paragraphs. Here is a screenshot of a sample response inside of their "Playground" tool:

When I click "View Code" at the top, here is the JSON response code they show for this particular response:

{
"model": "gpt-3.5-turbo-16k",
"messages": [
{
"role": "system",
"content": "Write a 200 word analysis on the monitor that is provided. The analysis should be written in the context of PC and console gaming and should ultimately give an honest answer as to what type of gamer this monitor is and isn't for.\n"
},
{
"role": "user",
"content": "Name: HP Omen 27q 27" QHD Monitor\nSize: 27 inches\nResolution: QHD\nRefresh Rate: 165Hz\nResponse Time: 1ms\nPanel Type: IPS\nAspect Ratio: Widescreen\nCurved: False\nHDMI 2.1 Support: False"
},
{
"role": "assistant",
"content": "The HP Omen 27q 27" QHD Monitor is a solid choice for both PC and console gaming enthusiasts. With its QHD resolution and 27-inch size, it offers a crisp and immersive viewing experience. The IPS panel type ensures accurate colors and wide viewing angles, making it suitable for competitive gaming or enjoying visually stunning games.\n\nThe 165Hz refresh rate and 1ms response time enhance the overall gaming experience, providing smooth and lag-free gameplay. This makes it an ideal choice for fast-paced shooters or action games, where quick reaction times are crucial.\n\nHowever, the lack of HDMI 2.1 support may be a drawback for console gamers. HDMI 2.1 offers features like variable refresh rate (VRR) and support for higher resolutions and frame rates, which is beneficial for next-gen consoles like the PlayStation 5 and Xbox Series X. Without HDMI 2.1 support, console gamers may not be able to take full advantage of their gaming consoles' capabilities.\n\nIn conclusion, the HP Omen 27q is an excellent choice for PC gamers who value high refresh rates, quick response times, and accurate colors. It offers a smooth and immersive gaming experience at the QHD resolution. However, it may not be the best choice for console gamers who want to fully utilize the advanced features of next-gen consoles due to the lack of HDMI 2.1 support."
}
],
"temperature": 1.2,
"max_tokens": 660,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0
}

As you can see in the code, two "\n" tags are being added after each paragraph to space them out. However, when I make this same request through Xano, those newline tags don't appear anywhere in the content response:

I've tried adjusting the system prompt to include things like asking it to wrap the response in HTML, but it's not 100% consistent.

From my reading around the web, it seems other developers always see the newline tags in their responses, so I'm guessing Xano is doing some magic behind the scenes that, in this case, isn't doing me any favors.

Am I missing something here? How do I get around this?

Best Answer

  • Brandon Hassler
    Brandon Hassler Member
    Answer ✓
    Options

    Alright, well I finally found the answer and it was right under my nose 🤦‍♂️

    When I copy and pasted the JSON response from Xano into other tools, I noticed that the \n tags were included! So Xano doesn't actually touch any of that, it's just visually removed from the response. False alarm!

Answers

  • Brandon Hassler
    Options

    One update to this:

    Can confirm it's something with Xano that ignores the \n tags. As you can see, when I make the call in Postman I get the true response: