dosubot[bot] commented on issue #333: URL: https://github.com/apache/hugegraph-ai/issues/333#issuecomment-4477445921
<!-- Answer --> Thanks for the detailed report! I looked into the affected components and can confirm your findings: **1. Uvicorn `reload=True`**: Confirmed hardcoded at line 205 with no environment variable or CLI flag to control it [[1]](https://github.com/apache/hugegraph-ai/blob/4dd6a1642f203406403539ef0d96d7d378dfbaef/hugegraph-llm/src/hugegraph_llm/demo/rag_demo/app.py#L200-L206). Adding something like `--reload` to the existing argparse or an `UVICORN_RELOAD` env var would be a straightforward fix. **2. Keyword extraction parser**: The `_extract_keywords_from_response` method [[2]](https://github.com/apache/hugegraph-ai/blob/4dd6a1642f203406403539ef0d96d7d378dfbaef/hugegraph-llm/src/hugegraph_llm/operators/llm_op/keyword_extract.py#L146-L180) does raw regex splitting on `KEYWORDS:` tokens and colon/comma delimiters with **no markdown code block handling whatsoever**. This is in contrast to other parts of the codebase that already handle this — for example, `GremlinGenerateSynthesize._extract_response()` [[3]](https://github.com/apache/hugegraph-ai/blob/4dd6a1642f203406403539ef0d96d7d378dfbaef/hugegraph-llm/src/hugegraph_llm/operators/llm_op/gremlin_generate.py#L45-L49) and `SchemaBuilder._extract_schema()` [[4]](https://github.com/apache/hugegraph-ai/blob/4dd6a1642f203406403539ef0d96d7d378dfbaef/hugegraph-llm/src/hugegraph_llm/operators/llm_op/schema_build.py#L76-L80) both use patterns like `re.search(r"```(?:json)?\s*(.*?)```", response, re.DOTALL)` to strip markdown fenc es before parsing. The fix from PR #332 [[5]](https://github.com/apache/incubator-hugegraph-ai/pull/192) uses a similar approach — stripping markdown code fences with `re.sub(r"```\w*\n?", "", text)` before attempting JSON extraction. Applying the same pattern to keyword extraction would be straightforward: strip any markdown fences from the LLM response before searching for the `KEYWORDS:` token. A possible patch for `keyword_extract.py` would look something like: ```python # Strip markdown code blocks before parsing import re response = re.sub(r"```\w*\n?", "", response) response = re.sub(r"```", "", response) response = response.strip() ``` Added before the existing token-based extraction logic. There might also be value in consolidating these markdown-stripping patterns into a shared utility, since at least 4 different operators implement their own version independently. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fhugegraph-ai).* --- Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fhugegraph-ai). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fhugegraph-ai&message_id=5e3f0e02-e727-424c-b73c-ee92bcbe542f) [](https://github.dosu.com/apache/hugegraph-ai?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fhugegraph-ai) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fhugegraph-ai) -- 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]
