FIx ollama endpoints not using ollama router
All checks were successful
Build and Publish college-bot-v2 / build_and_publish (push) Successful in 13s
All checks were successful
Build and Publish college-bot-v2 / build_and_publish (push) Successful in 13s
This commit is contained in:
parent
41e2daa265
commit
854abd9a6b
1 changed files with 3 additions and 3 deletions
|
@ -150,7 +150,7 @@ ollama_router = APIRouter(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.get("/threads")
|
@ollama_router.get("/threads")
|
||||||
def get_ollama_threads(db: redis.Redis = Depends(get_db_factory(0))):
|
def get_ollama_threads(db: redis.Redis = Depends(get_db_factory(0))):
|
||||||
"""
|
"""
|
||||||
Retrieves all stored threads
|
Retrieves all stored threads
|
||||||
|
@ -161,7 +161,7 @@ def get_ollama_threads(db: redis.Redis = Depends(get_db_factory(0))):
|
||||||
return keys
|
return keys
|
||||||
|
|
||||||
|
|
||||||
@app.get("/thread/{thread_id}")
|
@ollama_router.get("/thread/{thread_id}")
|
||||||
def get_ollama_thread(thread_id: str, db: redis.Redis = Depends(get_db_factory(0))):
|
def get_ollama_thread(thread_id: str, db: redis.Redis = Depends(get_db_factory(0))):
|
||||||
"""Retrieves a stored thread"""
|
"""Retrieves a stored thread"""
|
||||||
data: str = db.get(thread_id)
|
data: str = db.get(thread_id)
|
||||||
|
@ -170,7 +170,7 @@ def get_ollama_thread(thread_id: str, db: redis.Redis = Depends(get_db_factory(0
|
||||||
return json.loads(data)
|
return json.loads(data)
|
||||||
|
|
||||||
|
|
||||||
@app.delete("/thread/{thread_id}", status_code=204)
|
@ollama_router.delete("/thread/{thread_id}", status_code=204)
|
||||||
def delete_ollama_thread(thread_id: str, db: redis.Redis = Depends(get_db_factory(0))):
|
def delete_ollama_thread(thread_id: str, db: redis.Redis = Depends(get_db_factory(0))):
|
||||||
"""Deletes a stored thread"""
|
"""Deletes a stored thread"""
|
||||||
if not db.delete(thread_id):
|
if not db.delete(thread_id):
|
||||||
|
|
Loading…
Reference in a new issue