Spaces:
Sleeping
Sleeping
File size: 450 Bytes
7a4d005 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | from graph.chains.generation import generation_chain
from graph.state import GraphState
from typing import Dict, Any
def generate(state: GraphState) -> Dict[str, Any]:
print("----GENERATE----")
question = state["question"]
documents = state["documents"]
generation = generation_chain.invoke(
{"context": documents, "question":question}
)
return {"question":question, "documents":documents, "generation":generation} |