Skip to content

json display issue #2741

@tqosu

Description

@tqosu

`from fastapi import FastAPI
import boto3
import json
import time
import uuid

app = FastAPI()

@app.post("/v1/chat/completions")
async def chat_completions():
with open('./openai.json', 'r') as file:
data = json.load(file)
return data`

{ "id": "chatcmpl-Ce5Cfb4uESFgq7jsEBcn2ZchvZhab", "object": "chat.completion", "created": 1763669157, "model": "gpt-5-nano-2025-08-07", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hi there! How can I help today? I can answer questions, explain concepts, help with writing or editing, code, brainstorm ideas, translate, or plan tasks. Tell me what you’d like to do.", "refusal": null, "annotations": [] }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 8, "completion_tokens": 244, "total_tokens": 252, "prompt_tokens_details": { "cached_tokens": 0, "audio_tokens": 0 }, "completion_tokens_details": { "reasoning_tokens": 192, "audio_tokens": 0, "accepted_prediction_tokens": 0, "rejected_prediction_tokens": 0 } }, "service_tier": "default", "system_fingerprint": null }
I directly used FastAPI to return the JSON, but the UI doesn't show the message appropriately.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions