Skip to content

Commit

Permalink
add more logging for cursor support
Browse files Browse the repository at this point in the history
  • Loading branch information
acer-king committed Dec 9, 2024
1 parent 40cd30d commit 7f52a11
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions cursor/app/endpoints/text.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import json
from typing import Any, AsyncGenerator, Dict
from fastapi import Depends, HTTPException
from __future__ import annotations

from fastapi import HTTPException
from fastapi.responses import JSONResponse, StreamingResponse
from fastapi.routing import APIRouter
from cursor.app.core.config import config
from cursor.app.models import ChatRequest
from cursor.app.core.dendrite import CortexDendrite
from cursor.app.core.query_to_validator import query_miner, query_miner_no_stream
import asyncio
import time
import bittensor as bt
import traceback


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


Expand Down

0 comments on commit 7f52a11

Please sign in to comment.