Spaces:
Sleeping
Sleeping
remove logging for production
Browse files
backend/__pycache__/config.cpython-310.pyc
CHANGED
|
Binary files a/backend/__pycache__/config.cpython-310.pyc and b/backend/__pycache__/config.cpython-310.pyc differ
|
|
|
backend/__pycache__/main.cpython-310.pyc
CHANGED
|
Binary files a/backend/__pycache__/main.cpython-310.pyc and b/backend/__pycache__/main.cpython-310.pyc differ
|
|
|
backend/config.py
CHANGED
|
@@ -227,4 +227,4 @@ Return only the final **JSON object**. Do not include:
|
|
| 227 |
}
|
| 228 |
]
|
| 229 |
}
|
| 230 |
-
"""
|
|
|
|
| 227 |
}
|
| 228 |
]
|
| 229 |
}
|
| 230 |
+
"""
|
backend/main.py
CHANGED
|
@@ -72,7 +72,7 @@ async def extract_metadata(data: MetadataRequest):
|
|
| 72 |
@app.post("/generate/flashcards")
|
| 73 |
async def generate_flashcards(data: GenerationRequest):
|
| 74 |
try:
|
| 75 |
-
logging.info(f"Received flashcard generation request: {data.query}")
|
| 76 |
response = await generate_completions.get_completions(
|
| 77 |
data.query,
|
| 78 |
config.flashcard_mode_instructions
|
|
@@ -88,29 +88,11 @@ async def generate_flashcards(data: GenerationRequest):
|
|
| 88 |
except Exception as e:
|
| 89 |
raise HTTPException(status_code=500, detail=str(e))
|
| 90 |
|
| 91 |
-
# @app.post("/generate/flashcards")
|
| 92 |
-
# async def generate_flashcards(data: GenerationRequest):
|
| 93 |
-
# try:
|
| 94 |
-
# response = await generate_completions.get_completions(
|
| 95 |
-
# data.query,
|
| 96 |
-
# config.flashcard_mode_instructions
|
| 97 |
-
# )
|
| 98 |
-
# return JSONResponse(
|
| 99 |
-
# content={
|
| 100 |
-
# "data": response,
|
| 101 |
-
# "type": "flashcards",
|
| 102 |
-
# "status": "success"
|
| 103 |
-
# },
|
| 104 |
-
# status_code=200
|
| 105 |
-
# )
|
| 106 |
-
# except Exception as e:
|
| 107 |
-
# raise HTTPException(status_code=500, detail=str(e))
|
| 108 |
-
|
| 109 |
|
| 110 |
@app.post("/generate/exercises")
|
| 111 |
async def generate_exercises(data: GenerationRequest):
|
| 112 |
try:
|
| 113 |
-
logging.info(f"Received exercise generation request: {data.query}")
|
| 114 |
response = await generate_completions.get_completions(
|
| 115 |
data.query,
|
| 116 |
config.exercise_mode_instructions
|
|
@@ -131,7 +113,7 @@ async def generate_exercises(data: GenerationRequest):
|
|
| 131 |
@app.post("/generate/simulation")
|
| 132 |
async def generate_simulation(data: GenerationRequest):
|
| 133 |
try:
|
| 134 |
-
logging.info(f"Received simulation generation request: {data.query}")
|
| 135 |
response = await generate_completions.get_completions(
|
| 136 |
data.query,
|
| 137 |
config.simulation_mode_instructions
|
|
|
|
| 72 |
@app.post("/generate/flashcards")
|
| 73 |
async def generate_flashcards(data: GenerationRequest):
|
| 74 |
try:
|
| 75 |
+
# logging.info(f"Received flashcard generation request: {data.query}")
|
| 76 |
response = await generate_completions.get_completions(
|
| 77 |
data.query,
|
| 78 |
config.flashcard_mode_instructions
|
|
|
|
| 88 |
except Exception as e:
|
| 89 |
raise HTTPException(status_code=500, detail=str(e))
|
| 90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
@app.post("/generate/exercises")
|
| 93 |
async def generate_exercises(data: GenerationRequest):
|
| 94 |
try:
|
| 95 |
+
# logging.info(f"Received exercise generation request: {data.query}")
|
| 96 |
response = await generate_completions.get_completions(
|
| 97 |
data.query,
|
| 98 |
config.exercise_mode_instructions
|
|
|
|
| 113 |
@app.post("/generate/simulation")
|
| 114 |
async def generate_simulation(data: GenerationRequest):
|
| 115 |
try:
|
| 116 |
+
# logging.info(f"Received simulation generation request: {data.query}")
|
| 117 |
response = await generate_completions.get_completions(
|
| 118 |
data.query,
|
| 119 |
config.simulation_mode_instructions
|