Spaces:
Runtime error
Runtime error
File size: 777 Bytes
f5d128f 6b590d0 8c2b3fc 6b590d0 8c2b3fc f5d128f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
from fastapi import FastAPI
from graph.rag_pipeline_graph import get_rag_pipeline_graph
from type.state_schema import RAGState
api = FastAPI()
@api.get("/")
def greet_json():
return {"Hello": "World!"}
# if __name__ == "__main__":
@api.post("/")
def rag_pipeline_graph():
graph = get_rag_pipeline_graph()
input_data = RAGState(
query="μ μ©ν μ¬λ¬΄μ 보μ μ§μ νΉμ±μ κ΄ν μ€λͺ
",
top_k=5
)
final_state = graph.invoke(input_data)
# print("\nπ§ μ΅μ’
μλ΅:", final_state.final_response)
# print("\nπ§ μ΅μ’
μλ΅:", final_state["final_response"])
# print("\nπ§ μ΅μ’
μλ΅:", final_state.get("final_response", "[μλ΅ μμ]"))
return final_state.get("final_response", "[μλ΅ μμ]")
|