imbajin commented on code in PR #114:
URL:
https://github.com/apache/incubator-hugegraph-ai/pull/114#discussion_r1844949904
##########
hugegraph-llm/src/hugegraph_llm/api/models/rag_requests.py:
##########
@@ -21,23 +21,29 @@
class RAGRequest(BaseModel):
- query: str
- raw_llm: Optional[bool] = False
- vector_only: Optional[bool] = False
- graph_only: Optional[bool] = False
- graph_vector: Optional[bool] = False
+ text: str = ""
+ raw_answer: bool = False
+ vector_only_answer: bool = False
+ graph_only_answer: bool = False
+ graph_vector_answer: bool = False
Review Comment:
why remove `Optional`?
##########
hugegraph-llm/src/hugegraph_llm/demo/rag_demo/app.py:
##########
@@ -132,19 +132,27 @@ def refresh_ui_config_prompt() -> tuple:
parser.add_argument("--port", type=int, default=8001, help="port")
args = parser.parse_args()
app = FastAPI()
- api_auth = APIRouter(dependencies=[Depends(authenticate)])
settings.check_env()
prompt.update_yaml_file()
+ auth_enabled = os.getenv("ENABLE_LOGIN", "False").lower() == "true"
+ log.info("(Status) Authentication is %s now.", "enabled" if auth_enabled
else "disabled")
+
+ if auth_enabled == False:
+ api_auth = APIRouter()
+ else:
+ api_auth = APIRouter(dependencies=[Depends(authenticate)])
Review Comment:
```suggestion
api_auth = APIRouter(dependencies=[Depends(authenticate)] if auth_enabled
else [])
```
Note: test it first
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]