Skip to content

Commit 7f52a11

Browse files
author
acer-king
committed
add more logging for cursor support
1 parent 40cd30d commit 7f52a11

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

cursor/app/endpoints/text.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import json
2-
from typing import Any, AsyncGenerator, Dict
3-
from fastapi import Depends, HTTPException
1+
from __future__ import annotations
2+
3+
from fastapi import HTTPException
44
from fastapi.responses import JSONResponse, StreamingResponse
55
from fastapi.routing import APIRouter
6-
from cursor.app.core.config import config
76
from cursor.app.models import ChatRequest
8-
from cursor.app.core.dendrite import CortexDendrite
97
from cursor.app.core.query_to_validator import query_miner, query_miner_no_stream
10-
import asyncio
11-
import time
8+
import bittensor as bt
9+
import traceback
1210

1311

1412
async def chat(
@@ -21,7 +19,7 @@ async def chat(
2119
resp = await query_miner_no_stream(chat_request)
2220
return JSONResponse({"choices": [{"message": {"content": resp}}]})
2321
except Exception as err:
24-
print(err)
22+
bt.logging.error(f"{traceback.format_exc()}")
2523
raise HTTPException(status_code=500, detail={"message": "internal server error"})
2624

2725

0 commit comments

Comments
 (0)