imbajin commented on code in PR #188:
URL: 
https://github.com/apache/incubator-hugegraph-ai/pull/188#discussion_r2022406119


##########
hugegraph-llm/src/hugegraph_llm/utils/decorators.py:
##########
@@ -90,3 +90,13 @@ def wrapper(*args: Any, **kwargs: Any) -> Any:
             log.debug("%s QPS: %f/s", args[0].__class__.__name__, qps)
         return result
     return wrapper
+
+def with_task_id(func: Callable) -> Callable:
+    def wrapper(*args: Any, **kwargs: Any) -> Any:
+        import uuid
+        task_id = str(uuid.uuid4())
+        log.info("New task created with id: %s", task_id)

Review Comment:
   > Hi, yes, I got back to this issue recently after taking a break for my 
exams and academics, after testing the implementation with the changes here is 
what I'd like to share. This current implementation's decorator was made to 
function with Gradio Blocks instead of inside the gradio button. This current 
implementation worked by generating a uuid for the ongoing task. This 
implementation has now been modified to handle in-button task_ids for 
concurrency instead of at the gradio-blocks level. It now successfully works. 
![Screenshot 2025-03-31 
233127](https://private-user-images.githubusercontent.com/126225558/428731247-d9fd3460-3cde-42b3-88b6-aea503f9ae87.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDM0OTY2NzcsIm5iZiI6MTc0MzQ5NjM3NywicGF0aCI6Ii8xMjYyMjU1NTgvNDI4NzMxMjQ3LWQ5ZmQzNDYwLTNjZGUtNDJiMy04OGI2LWFlYTUwM2Y5YWU4Ny5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGV
 
udGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwNDAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDQwMVQwODMyNTdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lNDM2ZjhmM2NkMWUyOWUxZGNhMjVhNTg0YjI4MzA0M2ZkZmIxZTBkZWE1YzI4MzhlMjY4ZTU2MDM0MmNmZjVhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.jZB4JaTkopNsx2cyXTeMRBm5HqZwdIOkpqLgMCUVVqc)
   
   LGTM, some pylint info
   <img width="796" alt="image" 
src="https://github.com/user-attachments/assets/d98f561b-669f-4400-ab59-3cfc41aa7a6c";
 />
   



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