github-advanced-security[bot] commented on code in PR #54:
URL: 
https://github.com/apache/incubator-hugegraph-ai/pull/54#discussion_r1663611762


##########
hugegraph-llm/src/hugegraph_llm/demo/rag_web_demo.py:
##########
@@ -0,0 +1,280 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+import json
+import uvicorn
+import docx
+import gradio as gr
+from fastapi import FastAPI
+
+from hugegraph_llm.models.llms.init_llm import LLMs
+from hugegraph_llm.models.embeddings.init_embedding import Embeddings
+from hugegraph_llm.operators.graph_rag_task import GraphRAG
+from hugegraph_llm.operators.kg_construction_task import KgBuilder
+from hugegraph_llm.config import settings
+from hugegraph_llm.utils.hugegraph_utils import (
+    init_hg_test_data,
+    get_hg_client,
+    run_gremlin_query
+)
+
+
+def graph_rag(text, vector_search: str):
+    searcher = GraphRAG().extract_keyword(text=text).query_graph_for_rag()
+    if vector_search == "true":
+        searcher.query_vector_index_for_rag()
+    return searcher.merge_dedup_rerank().synthesize_answer().run(verbose=True)
+
+
+def build_kg(file, schema, disambiguate_word_sense, commit_to_hugegraph, 
build_vector_index):
+    if str(file).endswith(".txt"):
+        with open(str(file), "r", encoding="utf-8") as f:

Review Comment:
   ## Uncontrolled data used in path expression
   
   This path depends on a [user-provided value](1).
   
   [Show more 
details](https://github.com/apache/incubator-hugegraph-ai/security/code-scanning/2)



##########
hugegraph-llm/src/hugegraph_llm/demo/gremlin_generate_web_demo.py:
##########
@@ -0,0 +1,207 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+import json
+import uvicorn
+import gradio as gr
+from fastapi import FastAPI
+from hugegraph_llm.config import settings
+from hugegraph_llm.models.llms.init_llm import LLMs
+from hugegraph_llm.models.embeddings.init_embedding import Embeddings
+from hugegraph_llm.operators.gremlin_generate_task import GremlinGenerator
+
+
+def build_example_vector_index(temp_file):
+    if str(temp_file).endswith(".json"):
+        with open(str(temp_file), "r", encoding="utf-8") as f:

Review Comment:
   ## Uncontrolled data used in path expression
   
   This path depends on a [user-provided value](1).
   
   [Show more 
details](https://github.com/apache/incubator-hugegraph-ai/security/code-scanning/1)



-- 
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]

Reply via email to