-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(llm): support async/streaming output mode in api layer #179
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@imbajin thx for the suggestion will do so! |
This comment was marked as outdated.
This comment was marked as outdated.
U could ignore it (not related to current PR) BTW, py-client here-> https://github.com/apache/incubator-hugegraph-ai/tree/main/hugegraph-python-client |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@imbajin shall I commit the changes that I made? |
This comment was marked as outdated.
This comment was marked as outdated.
@imbajin I have separated the files for stream_api and config too and tried to make the format better for passing the pylint test too I had to manually do it any way we can do it using a script? whenever i am running the script it is telling me I have to do it manually |
yield f"data: {error_data}\n\n" | ||
|
||
return StreamingResponse( | ||
generate_stream(), |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
yield f"data: {error_data}\n\n" | ||
|
||
return StreamingResponse( | ||
generate_graph_stream(), |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
Not quite sure what you mean when you say the |
sir I have been going through them manually one by one, which is pretty time-consuming. Is there a better approach I'm missing? Maybe a tool or command that can automatically fix some of the common pylint issues instead of just listing them? I'm not very experienced with pylint and wondered if there's a more efficient way to handle this than the manual corrections I've been doing. and I saw that there are a few errors which are coming like the |
If you're saying that repairing As for automated Lint repair tools, I'm not very familiar with them. If there are any suitable ones, could recommend it and introduce them into our project, which would be even better |
Thank you so much sir I really appreciate your guidance. I'm still getting up to speed with best practices, but I'm confident about handling the code logic correctly. If any issues arise, I'll make sure to work on them swiftly. |
Sir I check the repo I was telling you about shall I share the script that the used? |
Okay, regarding the issue of lint and automatic formatting, we can create a separate PR or issue for management, and we will keep the current PR independent |
This comment was marked as outdated.
This comment was marked as outdated.
@imbajin Sir please check the pr and let me know if there is any changes that I need to make |
Fine, we add a separate refer
PS: Remember pull code first~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, could tell me how u test the APIs? By directly request them?
The gradio UI loss the API link now
Maybe refer here: (Or Gradio's mount doc?)
app = gr.mount_gradio_app( |
from hugegraph_llm.operators.hugegraph_op.graph_rag_query import GraphRAGQuery | ||
graph_rag = GraphRAGQuery() | ||
graph_rag.init_client(chunk) | ||
vertex_details = await graph_rag.get_vertex_details(chunk["match_vids"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'await' operator can't be used on list?
@@ -108,7 +110,7 @@ def graph_rag_recall_api(req: GraphRAGRequest): | |||
from hugegraph_llm.operators.hugegraph_op.graph_rag_query import GraphRAGQuery | |||
graph_rag = GraphRAGQuery() | |||
graph_rag.init_client(result) | |||
vertex_details = graph_rag.get_vertex_details(result["match_vids"]) | |||
vertex_details = await graph_rag.get_vertex_details(result["match_vids"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so as here
# pylint: disable=too-many-statements | ||
def rag_http_api( | ||
async def rag_http_api( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try to resolve the issues and then I will ping you again sir!
@chiruu12 Also note the And it's better to follow the design of LLM such as |
understood sir I will try to get this done as soon as my exams are over and then maybe we can work on the other issue too! |
close #177