File tree 1 file changed +6
-8
lines changed
1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 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
4
4
from fastapi .responses import JSONResponse , StreamingResponse
5
5
from fastapi .routing import APIRouter
6
- from cursor .app .core .config import config
7
6
from cursor .app .models import ChatRequest
8
- from cursor .app .core .dendrite import CortexDendrite
9
7
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
12
10
13
11
14
12
async def chat (
@@ -21,7 +19,7 @@ async def chat(
21
19
resp = await query_miner_no_stream (chat_request )
22
20
return JSONResponse ({"choices" : [{"message" : {"content" : resp }}]})
23
21
except Exception as err :
24
- print ( err )
22
+ bt . logging . error ( f" { traceback . format_exc () } " )
25
23
raise HTTPException (status_code = 500 , detail = {"message" : "internal server error" })
26
24
27
25
You can’t perform that action at this time.
0 commit comments