imbajin commented on code in PR #188:
URL:
https://github.com/apache/incubator-hugegraph-ai/pull/188#discussion_r1977219767
##########
hugegraph-llm/src/hugegraph_llm/utils/decorators.py:
##########
@@ -90,3 +90,14 @@ def wrapper(*args: Any, **kwargs: Any) -> Any:
log.debug("%s QPS: %f/s", args[0].__class__.__name__, qps)
return result
return wrapper
+
+# A decorator to wrap functions with a task id generation and logging
+def with_task_id(func):
+ def wrapper(*args, **kwargs):
+ import uuid
+ task_id = str(uuid.uuid4())
+ log.info(f"New task created with id: {task_id}")
+ # Optionally, you could also pass the task_id to the function if
needed:
+ # kwargs['task_id'] = task_id
+ return func(*args, **kwargs)
+ return wrapper
Review Comment:
Is this decorator still useful now or in the future? Is the main purpose of
logging newly created tasks?
##########
hugegraph-llm/src/hugegraph_llm/demo/rag_demo/rag_block.py:
##########
@@ -200,6 +208,9 @@ def toggle_slider(enable):
example_num,
],
outputs=[raw_out, vector_only_out, graph_only_out, graph_vector_out],
+ queue=True, # Enable queueing for this event
+ concurrency_limit=5, # Maximum of 5 concurrent executions
+ concurrency_id="rag_answer_task"
Review Comment:
so as here
--
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]