-
Notifications
You must be signed in to change notification settings - Fork 29
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 basic rag api(v1) #64
Conversation
…n test_api_connection
…ration and the hg-server configuration graphspace problem
… on functionality
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.
Function apply_embedding_configuration does not return a value.
…r issues and encapsulate the http api in a single package
def rag_http_api(app: FastAPI, graph_rag_func, apply_graph_configuration_func, | ||
apply_llm_configuration_func, apply_embedding_configuration_func): | ||
@app.post("/rag") | ||
def graph_rag_api(req: RAGRequest): |
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.
Is it the proper/right way to use the fastapi?
- method -> http_method?
- class -> http_method?
- directly http_method?
@@ -141,13 +134,110 @@ def build_kg(file, schema, example_prompt, build_mode): # pylint: disable=too-m | |||
raise gr.Error(str(e)) |
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.
raise gr.Error("PDF will be supported later! Try to upload text/docx now") | ||
else: | ||
raise gr.Error("Please input txt or docx file.") | ||
builder = KgBuilder(LLMs().get_llm(), Embeddings().get_embedding(), get_hg_client()) | ||
|
||
if build_mode != "Rebuild vertex index": | ||
if build_mode != BuildMode.REBUILD_VERTEX_INDEX: |
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.
Maybe this should be build_mode != BuildMode.REBUILD_VERTEX_INDEX.value
?
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.
right
There may be 2 ways to integrate fastapi into the gradio app:
refer: