Spaces:
Runtime error
Runtime error
File size: 710 Bytes
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 |
from fastapi import FastAPI
from graph.rag_pipeline_graph import get_rag_pipeline_graph
from type.state_schema import RAGState
api = FastAPI()
# if __name__ == "__main__":
@app.get("/")
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", "[μλ΅ μμ]")
|