download
raw
961 Bytes
from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse
app = FastAPI()
@app.post("/v1/chat/completions")
async def chat_completions(request: Request):
body = await request.json()
print("\n===== πŸ“₯ Incoming Request Body =====")
print(body)
print("====================================\n")
# OpenAI 응닡 ν˜•μ‹ 흉내내기
return JSONResponse({
"id": "chatcmpl-mock",
"object": "chat.completion",
"created": 1234567890,
"model": body.get("model", "mock-model"),
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a mock response."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 5,
"total_tokens": 15
}
})

Xet Storage Details

Size:
961 Bytes
Β·
Xet hash:
04b7f16be9d6c6552e201ad769db4707c22787b867569aed2dde326034b9f0e1

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.