Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response rendering #3151

Open
1 task done
justrp opened this issue Feb 11, 2025 · 0 comments
Open
1 task done

Response rendering #3151

justrp opened this issue Feb 11, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@justrp
Copy link
Contributor

justrp commented Feb 11, 2025

EPAM AI DIAL chat version

0.22.3

How to reproduce

Make the model produce code response with no backticks (`)

Chat example:

{
          "content": "Below is a simple, text-based adventure game written in Python. It demonstrates a few basic concepts: printing text to the console, taking user input, and applying simple logic based on that input.\n\n---------------------------------------\n# Simple Text Adventure: \"Escape the Cavern\"\n\ndef play_game():\n    print(\"Welcome, adventurer! You have awakened in a dark cavern.\")\n    print(\"You see an old torch on the ground nearby. Do you pick it up? (yes/no)\")\n\n    action = input(\"> \").lower()\n\n    if action == \"yes\":\n        print(\"\\nYou pick up the torch. Its flickering light reveals two tunnels:\")\n        print(\"A) The narrow tunnel to the left.\\nB) The rocky tunnel to the right.\")\n    else:\n        print(\"\\nWithout the torch, you stumble in the darkness and hit your head.\")\n        print(\"You awake hours later, but the cavern is even darker now.\")\n        print(\"It's probably best to pick up the torch if you get another chance.\")\n        return  # End the game if the player refuses to pick up the torch\n\n    print(\"\\nWhich tunnel do you choose? (A/B)\")\n    tunnel_choice = input(\"> \").lower()\n\n    if tunnel_choice == \"a\":\n        print(\"\\nYou carefully move through the narrow tunnel.\")\n        print(\"Eventually, it opens into a small chamber with a wooden door.\")\n        print(\"You turn the handle, push it open, and escape to freedom!\")\n        print(\"Congratulations, you have survived the cavern adventure!\")\n    elif tunnel_choice == \"b\":\n        print(\"\\nYou head down the rocky tunnel. It's filled with strange echoes.\")\n        print(\"Suddenly, you hear a roar from deeper within!\")\n        print(\"A giant creature leaps out, and you have nowhere to run!\")\n        print(\"Alas, adventurer, you have met an untimely end...\")\n    else:\n        print(\"\\nYou hesitate and stand in the darkness. Time passes...\")\n        print(\"You decide to turn back, but it seems the way is blocked.\")\n        print(\"It appears you're trapped with no clear way out.\")\n        print(\"Game over.\")\n\ndef main():\n    while True:\n        print(\"\\nType 'start' to begin a new adventure, or 'quit' to exit.\")\n        command = input(\"> \").lower()\n        if command == 'start':\n            play_game()\n        elif command == 'quit':\n            print(\"Goodbye! Thanks for playing.\")\n            break\n        else:\n            print(\"Sorry, I didn't understand that command.\")\n\nif __name__ == \"__main__\":\n    main()\n---------------------------------------\n\nHow the game works:\n• The game begins with a prompt asking if you want to pick up a torch.  \n• Depending on your choice, you either continue or the game ends abruptly.  \n• If you pick up the torch, you then choose one of two tunnels.  \n• Your choice of tunnel determines whether you escape or meet a bad fate.  \n\nFeel free to extend this game by adding more rooms, puzzles, or branching storylines!",
          "model": {
            "id": "o1-2024-12-17"
          },
          "settings": {
            "prompt": "",
            "temperature": 1,
            "selectedAddons": []
          },
          "role": "assistant",
          "responseId": "chatcmpl-AzRnomMznMjFNcC3DnSwbTjPz7u4Q"
        }

Chat export - PFA

exported-chat-with-rendering-issue.json

Actual result

Part of response is rendered as a code block (albeit no markdown code block syntax presented)

Image

Expected result

The output rendered as the whole text since no code markdown syntax presented

Confidential information

  • I confirm that do not share any confidential information
@justrp justrp added the bug Something isn't working label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant