basic backend
This commit is contained in:
parent
16e5004228
commit
89ec0476ca
29 changed files with 2125 additions and 13 deletions
28
rag-chat-backend/src/endpoints/configurations.py
Normal file
28
rag-chat-backend/src/endpoints/configurations.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
"""Endpoints to retrieve information about the backend configuration."""
|
||||
|
||||
import json
|
||||
from fastapi import APIRouter, Response
|
||||
from endpoints.llm import LLM
|
||||
import os
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/configs", tags=["configurations"])
|
||||
def get_configs():
|
||||
"""Get configurations of the backend"""
|
||||
|
||||
backend_configs = {
|
||||
"llm": {
|
||||
'language': LLM.language,
|
||||
'max_num_tokens': LLM.max_num_tokens,
|
||||
'modelname': LLM.modelname
|
||||
},
|
||||
'env_vars': {
|
||||
'language': os.getenv('LLM_LANGUAGE'),
|
||||
'llm_option': os.getenv('LLM_OPTION'),
|
||||
'bucket_name': os.getenv('BUCKET_NAME'),
|
||||
}
|
||||
}
|
||||
|
||||
return Response(status_code=200, content=json.dumps(backend_configs))
|
||||
Loading…
Add table
Add a link
Reference in a new issue