diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa5ec2b --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.pyc +__pycache__ +vectore_stores +sajith_vectorstore \ No newline at end of file diff --git a/RAG/agents/answer_grader.py b/RAG/agents/answer_grader.py new file mode 100644 index 0000000..6dbc7fe --- /dev/null +++ b/RAG/agents/answer_grader.py @@ -0,0 +1,32 @@ +from langchain_core.output_parsers import StrOutputParser +from langchain_core.prompts import PromptTemplate +from langchain_core.prompts import ChatPromptTemplate +from pydantic import BaseModel , Field +from langchain_mistralai import ChatMistralAI +import os +os.environ["MISTRAL_API_KEY"] = "naAG2SIBHoKW5KtKS7B2MN5z49roSnzV" + +# Data model +class GradeAnswer(BaseModel): + """Binary score to assess answer addresses question.""" + + binary_score: str = Field( + description="Answer addresses the question, 'yes' or 'no'" + ) + + +# LLM with function call +llm = ChatMistralAI(model="mistral-large-latest", api_key=os.getenv("MISTRAL_API_KEY")) +structured_llm_grader = llm.with_structured_output(GradeAnswer) + +# Prompt +system = """You are a grader assessing whether an answer addresses / resolves a question \n + Give a binary score 'yes' or 'no'. Yes' means that the answer resolves the question.""" +answer_prompt = ChatPromptTemplate.from_messages( + [ + ("system", system), + ("human", "User question: \n\n {question} \n\n LLM generation: {generation}"), + ] +) + +answer_grader = answer_prompt | structured_llm_grader \ No newline at end of file diff --git a/RAG/agents/contextualize.py b/RAG/agents/contextualize.py new file mode 100644 index 0000000..bf3f61c --- /dev/null +++ b/RAG/agents/contextualize.py @@ -0,0 +1,43 @@ +from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder +from pydantic import BaseModel , Field +from langchain_mistralai import ChatMistralAI +from langchain_core.output_parsers import StrOutputParser +from dotenv import load_dotenv +import os + +class ContextualizeQuestion(BaseModel): + """Contextualize the question.""" + + contextualized_question: str = Field( + ..., + description="The contextualized question.", + ) + +contextualize_q_system_prompt = ( + "Given a chat history and the latest user question, " + "which might reference context in the chat history, " + "formulate a standalone question that can be understood " + "without the chat history. Specifically:" + "\n1. Replace pronouns (e.g., 'he', 'she', 'it', 'they') with their specific referents." + "\n2. Expand references like 'that', 'this', 'those' to what they specifically refer to." + "\n3. Include any relevant context from previous messages that's necessary to understand the question." + "\n4. Ensure the reformulated question is clear, specific, and self-contained." + "\nDo NOT answer the question, just reformulate it to be self-explanatory." +) + +load_dotenv() +mistral_api_key = os.getenv("MISTRAL_API_KEY") +if not mistral_api_key: + raise ValueError("MISTRAL_API_KEY environment variable not set") +llm = ChatMistralAI(model="mistral-large-latest", api_key=os.getenv("MISTRAL_API_KEY")) + +contextualize_q_prompt = ChatPromptTemplate.from_messages( + [ + ("system", contextualize_q_system_prompt), + MessagesPlaceholder("chat_history"), + ("human", "{input}"), + ] +) +structured_llm_router = llm.with_structured_output(ContextualizeQuestion) + +contextualizer = contextualize_q_prompt | structured_llm_router diff --git a/RAG/agents/extractor.py b/RAG/agents/extractor.py new file mode 100644 index 0000000..7e820f1 --- /dev/null +++ b/RAG/agents/extractor.py @@ -0,0 +1,66 @@ +### Router + +from typing import Literal + +from langchain_core.prompts import ChatPromptTemplate +from pydantic import BaseModel , Field +from langchain_mistralai import ChatMistralAI +from dotenv import load_dotenv +import os +# Data model +class ExtractQuery(BaseModel): + """Route a user query to the relevant datasources with subquestions.""" + + namal_vector_search_query: str = Field( + ..., + description="The query to search the vector store of namal.", + ) + ranil_vector_search_query: str = Field( + ..., + description="The query to search the vector store of ranil.", + ) + sajith_vector_search_query: str = Field( + ..., + description="The query to search the vector store of sajith.", + ) + web_search_query: str = Field( + ..., + description="The query to search the web.", + ) + +load_dotenv() +mistral_api_key = os.getenv("MISTRAL_API_KEY") + +if not mistral_api_key: + raise ValueError("MISTRAL_API_KEY environment variable not set") + +# Initialize the ChatMistralAI client with the API key +llm = ChatMistralAI(model="mistral-large-latest", api_key=mistral_api_key) +structured_llm_router = llm.with_structured_output(ExtractQuery) + +# Prompt +system = """You are an expert at routing a user question to a vectorstore or web search. +There are three vectorstores. One contains documents related to Manifests of political candidate Sajith Premadasa. +Another contains documents related to Manifests of political candidate Namal Rajapaksa. +The third contains documents related to Manifests of political candidate Ranil Wickramasinghe. + +for an example, what this candidate do for education sector, health sector etc is on the vectorstore. +And also their plans for the future of the country is on the vectorstore. + +If the question involves something about a candidate's policies in a past year, then you will have to do a websearch. +And also if you feel like a web search will be usefull. Do a web search. + +After deciding, +Output the 'namal_vector_search_query': The query that needs to be searched from the vector store of namal. +And the 'ranil_vector_search_query': The query that needs to be searched from the vector store of ranil. +And the 'sajith_vector_search_query': The query that needs to be searched from the vector store of sajith. +And the 'web_search_query': The query that needs to be searched from the web. +""" +route_prompt = ChatPromptTemplate.from_messages( + [ + ("system", system), + ("human", "{question}"), + ] +) + +question_extractor = route_prompt | structured_llm_router \ No newline at end of file diff --git a/RAG/agents/generate.py b/RAG/agents/generate.py new file mode 100644 index 0000000..82428f6 --- /dev/null +++ b/RAG/agents/generate.py @@ -0,0 +1,43 @@ +from langchain_core.output_parsers import StrOutputParser +from langchain_core.prompts import PromptTemplate +from langchain_core.prompts import ChatPromptTemplate +from pydantic import BaseModel , Field +from langchain_mistralai import ChatMistralAI +import os +template = """You are a very vigilant and helpful journalist. Use the following pieces of +context to answer the question at the end. +If you don't know the answer, just say that you don't know, don't try to make up an answer. +Be concise and helpful. + +________________________________________________________________________________ +Here are the web results regarding the question: +{web_context} + +Here are the results from the manifesto of the candidates: +________________________________________________________________________________ +namel rajapakse: +{namal_context} + +________________________________________________________________________________ +ranil wickramasinghe: +{ranil_context} + +________________________________________________________________________________ +sajith premadasa: +{sajith_context} + +________________________________________________________________________________ +Question: {question} + +Helpful Answer:""" +custom_rag_prompt = PromptTemplate.from_template(template) + +# LLM +llm = ChatMistralAI(model="mistral-large-latest", api_key=os.getenv("MISTRAL_API_KEY")) + +# Post-processing +def format_docs(docs): + return "\n\n".join(doc.page_content for doc in docs) + + +rag_chain = custom_rag_prompt | llm | StrOutputParser() \ No newline at end of file diff --git a/RAG/agents/grader.py b/RAG/agents/grader.py new file mode 100644 index 0000000..e97f2ef --- /dev/null +++ b/RAG/agents/grader.py @@ -0,0 +1,29 @@ +from langchain_core.prompts import ChatPromptTemplate +from pydantic import BaseModel , Field +from langchain_mistralai import ChatMistralAI +import os + +class GradeDocuments(BaseModel): + """Binary score for relevance check on retrieved documents.""" + + binary_score: str = Field( + description="Documents are relevant to the question, 'yes' or 'no'" + ) + + +llm = ChatMistralAI(model="mistral-large-latest", api_key=os.getenv("MISTRAL_API_KEY")) +structured_llm_grader = llm.with_structured_output(GradeDocuments) + +# Prompt +system = """You are a grader assessing relevance of a retrieved document to a user question. \n + If the document contains keyword(s) or semantic meaning related to the user question, grade it as relevant. \n + It does not need to be a stringent test. The goal is to filter out erroneous retrievals. \n + Give a binary score 'yes' or 'no' score to indicate whether the document is relevant to the question.""" +grade_prompt = ChatPromptTemplate.from_messages( + [ + ("system", system), + ("human", "Retrieved document: \n\n {document} \n\n User question: {question}"), + ] +) + +retrieval_grader = grade_prompt | structured_llm_grader \ No newline at end of file diff --git a/RAG/agents/hallucinate_checker.py b/RAG/agents/hallucinate_checker.py new file mode 100644 index 0000000..7e2be34 --- /dev/null +++ b/RAG/agents/hallucinate_checker.py @@ -0,0 +1,28 @@ +from langchain_core.output_parsers import StrOutputParser +from langchain_core.prompts import PromptTemplate +from langchain_core.prompts import ChatPromptTemplate +from pydantic import BaseModel , Field +from langchain_mistralai import ChatMistralAI +class GradeHallucinations(BaseModel): + """Binary score for hallucination present in generation answer.""" + + binary_score: str = Field( + description="Answer is grounded in the facts, 'yes' or 'no'" + ) + +import os +# LLM with function call +llm = ChatMistralAI(model="mistral-large-latest", api_key=os.getenv("MISTRAL_API_KEY")) +structured_llm_grader = llm.with_structured_output(GradeHallucinations) + +# Prompt +system = """You are a grader assessing whether an LLM generation is grounded in / supported by a set of retrieved facts. \n + Give a binary score 'yes' or 'no'. 'Yes' means that the answer is grounded in / supported by the set of facts.""" +hallucination_prompt = ChatPromptTemplate.from_messages( + [ + ("system", system), + ("human", "Set of facts: \n\n {documents} \n\n LLM generation: {generation}"), + ] +) + +hallucination_grader = hallucination_prompt | structured_llm_grader \ No newline at end of file diff --git a/RAG/agents/question_rewriter.py b/RAG/agents/question_rewriter.py new file mode 100644 index 0000000..c24edaa --- /dev/null +++ b/RAG/agents/question_rewriter.py @@ -0,0 +1,22 @@ +from langchain_core.output_parsers import StrOutputParser +from langchain_core.prompts import PromptTemplate +from langchain_core.prompts import ChatPromptTemplate +from pydantic import BaseModel , Field +from langchain_mistralai import ChatMistralAI +import os +llm = ChatMistralAI(model="mistral-large-latest", api_key=os.getenv("MISTRAL_API_KEY")) + +# Prompt +system = """You a question re-writer that converts an input question to a better version that is optimized \n + for vectorstore retrieval. Look at the input and try to reason about the underlying semantic intent / meaning.""" +re_write_prompt = ChatPromptTemplate.from_messages( + [ + ("system", system), + ( + "human", + "Here is the initial question: \n\n {question} \n Formulate an improved question.", + ), + ] +) + +question_rewriter = re_write_prompt | llm | StrOutputParser() diff --git a/RAG/edges/decide_to_generate.py b/RAG/edges/decide_to_generate.py new file mode 100644 index 0000000..b322d1d --- /dev/null +++ b/RAG/edges/decide_to_generate.py @@ -0,0 +1,26 @@ +def decide_to_generate(state): + """ + Determines whether to generate an answer, or re-generate a question. + + Args: + state (dict): The current graph state + + Returns: + str: Binary decision for next node to call + """ + + print("---ASSESS GRADED DOCUMENTS---") + state["question"] + filtered_documents = state["documents"] + + if not filtered_documents: + # All documents have been filtered check_relevance + # We will re-generate a new query + print( + "---DECISION: ALL DOCUMENTS ARE NOT RELEVANT TO QUESTION, TRANSFORM QUERY---" + ) + return "transform_query" + else: + # We have relevant documents, so generate answer + print("---DECISION: GENERATE---") + return "generate" \ No newline at end of file diff --git a/RAG/edges/generation_grader.py b/RAG/edges/generation_grader.py new file mode 100644 index 0000000..a70da12 --- /dev/null +++ b/RAG/edges/generation_grader.py @@ -0,0 +1,44 @@ +from RAG.agents.answer_grader import answer_grader +from RAG.agents.hallucinate_checker import hallucination_grader + +def grade_generation_v_documents_and_question(state): + """ + Determines whether the generation is grounded in the document and answers question. + + Args: + state (dict): The current graph state + + Returns: + str: Decision for next node to call + """ + + print("---CHECK HALLUCINATIONS---") + question = state["question"] + documents = state["namal_vector_search_documents"] + state["ranil_vector_search_documents"] + state["sajith_vector_search_documents"] + state["web_search_documents"] + generation = state["generation"] + + score = hallucination_grader.invoke( + {"documents": documents, "generation": generation} + ) + grade = score.binary_score + + if state.get("generated_count", 0) > 1: + print("---DECISION: AlREADY TRIED AND FAILED. CONTINUING ANYWAYS---") + return "useful" + + # Check hallucination + if grade == "yes": + print("---DECISION: GENERATION IS GROUNDED IN DOCUMENTS---") + # Check question-answering + print("---GRADE GENERATION vs QUESTION---") + score = answer_grader.invoke({"question": question, "generation": generation}) + grade = score.binary_score + if grade == "yes": + print("---DECISION: GENERATION ADDRESSES QUESTION---") + return "useful" + else: + print("---DECISION: GENERATION DOES NOT ADDRESS QUESTION---") + return "not useful" + else: + print("---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---") + return "not supported" \ No newline at end of file diff --git a/RAG/graph.py b/RAG/graph.py new file mode 100644 index 0000000..8cdb7dc --- /dev/null +++ b/RAG/graph.py @@ -0,0 +1,58 @@ +from langgraph.graph import END, StateGraph, START +from RAG.graph_state import GraphState +from RAG.nodes.extract_queries import extract_queries +from RAG.nodes.web_search import web_search +from RAG.nodes.retrieve import retrieve +from RAG.nodes.generate import generate +from RAG.nodes.transform import transform_query +from RAG.nodes.contextualize_query import contextualize_question as contextualize +from RAG.edges.generation_grader import grade_generation_v_documents_and_question +from langchain_core.chat_history import InMemoryChatMessageHistory + + +import os +# import uuid +from langchain_mistralai import ChatMistralAI +from dotenv import load_dotenv +from langgraph.checkpoint.memory import MemorySaver + +workflow = StateGraph(GraphState) + +workflow.add_node("web_search", web_search) # web search +workflow.add_node("retrieve", retrieve) # retrieve +workflow.add_node("generate", generate) # generatae +workflow.add_node("transform_query", transform_query) # transform_query +workflow.add_node("contextualize", contextualize) +workflow.add_node("extract queries", extract_queries) + +workflow.add_edge(START, "contextualize") +workflow.add_edge("contextualize", "extract queries") +workflow.add_edge("extract queries", "web_search") +workflow.add_edge("extract queries", "retrieve") + +workflow.add_edge(["web_search", "retrieve"], "generate") + +workflow.add_conditional_edges( + "generate", + grade_generation_v_documents_and_question, + { + "not supported": "generate", + "useful": END, + "not useful": "transform_query", + }, +) + +workflow.add_edge("transform_query", "extract queries") + +from langgraph.checkpoint.memory import MemorySaver + +memory = MemorySaver() +app = workflow.compile(checkpointer=memory) + +try: + graph_image = app.get_graph(xray=True).draw_mermaid_png() + with open("graph_image.png", "wb") as f: + f.write(graph_image) +except Exception: + pass + \ No newline at end of file diff --git a/RAG/graph_state.py b/RAG/graph_state.py new file mode 100644 index 0000000..93a2536 --- /dev/null +++ b/RAG/graph_state.py @@ -0,0 +1,37 @@ +from typing import List, Dict +from langchain_core.messages.base import BaseMessage +# from langchain_core.chat_history import InMemoryChatMessageHistory +from typing_extensions import TypedDict, Annotated +from langgraph.graph.message import add_messages +from langchain_core.messages import HumanMessage, AIMessage +from langchain.memory import ConversationBufferMemory + +class Message(TypedDict): + role: str + content: str + +class GraphState(TypedDict): + """ + Represents the state of our graph. + + Attributes: + question: question + generation: LLM generation + documents: list of documents + """ + + question: str + contextualized_question: str + namal_vector_search_query: str + ranil_vector_search_query: str + sajith_vector_search_query: str + web_search_query: str + generation: str + + namal_vector_search_documents: List[str] + ranil_vector_search_documents: List[str] + sajith_vector_search_documents: List[str] + web_search_documents: List[str] + + generated_count: int + chat_history: Annotated[List[BaseMessage], add_messages] \ No newline at end of file diff --git a/RAG/nodes/contextualize_query.py b/RAG/nodes/contextualize_query.py new file mode 100644 index 0000000..7dfe97e --- /dev/null +++ b/RAG/nodes/contextualize_query.py @@ -0,0 +1,19 @@ +from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder +from dotenv import load_dotenv +from langchain_core.messages import HumanMessage, AIMessage +from RAG.agents.contextualize import contextualizer +from RAG.graph_state import GraphState +import os + + +def contextualize_question(state): + print("---CONTEXTUALIZE QUESTION---") + + question = state["question"] + chat_history = state["chat_history"] + result = contextualizer.invoke({"input": question, "chat_history": chat_history}) + + return { + "contextualized_question": result.contextualized_question, + } + diff --git a/RAG/nodes/extract_queries.py b/RAG/nodes/extract_queries.py new file mode 100644 index 0000000..caeb71b --- /dev/null +++ b/RAG/nodes/extract_queries.py @@ -0,0 +1,27 @@ +from RAG.agents.extractor import question_extractor +from langchain_core.messages import HumanMessage + +def extract_queries(state): + from RAG.graph import app + """ + Extract queries for vector search and web search. + + Args: + state (dict): The current graph state + + Returns: + str: Next node to call + """ + + print("---EXTRACT QUERIES---") + + contextualized_question = state["contextualized_question"] + source = question_extractor.invoke({"question": contextualized_question}) + + return { + "namal_vector_search_query": source.namal_vector_search_query, + "ranil_vector_search_query": source.ranil_vector_search_query, + "sajith_vector_search_query": source.sajith_vector_search_query, + "web_search_query": source.web_search_query, + "question": contextualized_question, + } diff --git a/RAG/nodes/generate.py b/RAG/nodes/generate.py new file mode 100644 index 0000000..e1b791a --- /dev/null +++ b/RAG/nodes/generate.py @@ -0,0 +1,45 @@ +from RAG.agents.generate import rag_chain +from langchain_core.messages import AIMessage + + +def generate(state): + """ + Generate answer + + Args: + state (dict): The current graph state + + Returns: + state (dict): New key added to state, generation, that contains LLM generation + """ + print("---GENERATE---") + question = state["question"] + # question = state["contextualized_question"] + web_documents = state["web_search_documents"] + namal_vector_documents = state["namal_vector_search_documents"] + ranil_vector_documents = state["ranil_vector_search_documents"] + sajith_vector_documents = state["sajith_vector_search_documents"] + # chat_history = state["chat_history"] + # print(chat_history) + # RAG generation + generation = rag_chain.invoke( + { + "web_context": web_documents, + "namal_context": namal_vector_documents, + "ranil_context": ranil_vector_documents, + "sajith_context": sajith_vector_documents, + "question": question, + # "chat_history": chat_history + } + ) + + # state["chat_history"].append(AIMessage(content=generation)) + generated_count = state.get("generated_count", 0) + 1 + + return { + "question": state["question"], + "contextualized_question": question, + "generation": generation, + "generated_count": generated_count, + "state": state + } \ No newline at end of file diff --git a/RAG/nodes/grade_documents.py b/RAG/nodes/grade_documents.py new file mode 100644 index 0000000..2c65afb --- /dev/null +++ b/RAG/nodes/grade_documents.py @@ -0,0 +1,32 @@ +from RAG.agents.grader import retrieval_grader + +def grade_documents(state): + """ + Determines whether the retrieved documents are relevant to the question. + + Args: + state (dict): The current graph state + + Returns: + state (dict): Updates documents key with only filtered relevant documents + """ + + print("---CHECK DOCUMENT RELEVANCE TO QUESTION---") + + question = state["question"] + documents = state["documents"] + + # Score each doc + filtered_docs = [] + for d in documents: + score = retrieval_grader.invoke( + {"question": question, "document": d.page_content} + ) + grade = score.binary_score + if grade == "yes": + print("---GRADE: DOCUMENT RELEVANT---") + filtered_docs.append(d) + else: + print("---GRADE: DOCUMENT NOT RELEVANT---") + continue + return {"documents": filtered_docs, "question": question} \ No newline at end of file diff --git a/RAG/nodes/retrieve.py b/RAG/nodes/retrieve.py new file mode 100644 index 0000000..4a662c8 --- /dev/null +++ b/RAG/nodes/retrieve.py @@ -0,0 +1,28 @@ +from langchain.schema import Document +from RAG.tools.vectore_store_retriever import sajith_retriever, namal_retriever, ranil_retriever + + +def retrieve(state): + """ + Retrieve documents + + Args: + state (dict): The current graph state + + Returns: + state (dict): New key added to state, documents, that contains retrieved documents + """ + print("---RETRIEVE---") + + namal_vector_search_query = state["namal_vector_search_query"] + ranil_vector_search_query = state["ranil_vector_search_query"] + sajith_vector_search_query = state["sajith_vector_search_query"] + + # Retrieval + namal_documents = namal_retriever.get_relevant_documents(namal_vector_search_query) + ranil_documents = ranil_retriever.get_relevant_documents(ranil_vector_search_query) + sajith_documents = sajith_retriever.get_relevant_documents(sajith_vector_search_query) + + return {"namal_vector_search_documents": namal_documents, + "ranil_vector_search_documents": ranil_documents, + "sajith_vector_search_documents": sajith_documents} diff --git a/RAG/nodes/transform.py b/RAG/nodes/transform.py new file mode 100644 index 0000000..1e49e0d --- /dev/null +++ b/RAG/nodes/transform.py @@ -0,0 +1,18 @@ +from RAG.agents.question_rewriter import question_rewriter + +def transform_query(state): + """ + Transform the query to produce a better question. + + Args: + state (dict): The current graph state + + Returns: + state (dict): Updates question key with a re-phrased question + """ + + print("---TRANSFORM QUERY---") + question = state["question"] + + better_question = question_rewriter.invoke({"question": question}) + return {"question": better_question} \ No newline at end of file diff --git a/RAG/nodes/web_search.py b/RAG/nodes/web_search.py new file mode 100644 index 0000000..159dbdc --- /dev/null +++ b/RAG/nodes/web_search.py @@ -0,0 +1,26 @@ +from RAG.tools.web_search import web_search_tool +from langchain_core.documents import Document + +def web_search(state): + """ + Web search based on the re-phrased question. + + Args: + state (dict): The current graph state + + Returns: + state (dict): Updates documents key with appended web results + """ + + print("---WEB SEARCH---") + search_query = state["web_search_query"] + if search_query == "": + return {"web_search_documents": []} + + # Web search + docs = web_search_tool.invoke({"query": search_query}) + print(docs) + web_results = [d["content"] for d in docs] + # web_results = Document(page_content=web_results) + + return {"web_search_documents": web_results} \ No newline at end of file diff --git a/RAG/tools/vectore_store_retriever.py b/RAG/tools/vectore_store_retriever.py new file mode 100644 index 0000000..9fd264e --- /dev/null +++ b/RAG/tools/vectore_store_retriever.py @@ -0,0 +1,40 @@ +from langchain_community.document_loaders import TextLoader +from langchain_community.vectorstores import FAISS +from langchain_huggingface import HuggingFaceEmbeddings +from dotenv import load_dotenv +import os + +# Load environment variables +load_dotenv() + +file_names = ["namal.txt", "ranil.txt", "sajith.txt"] +file_name_to_source = { + "namal.txt": "namal", + "ranil.txt": "ranil", + "sajith.txt": "sajith", +} +docs = [] + +for file_name in file_names: + loader = TextLoader(f"documents/{file_name}", encoding="utf-8") + doc = loader.load() + for d in doc: + d.metadata = {"file_name": file_name, "source": file_name_to_source[file_name]} + docs.append(d) + +from langchain_text_splitters import RecursiveCharacterTextSplitter + +text_splitter = RecursiveCharacterTextSplitter( + chunk_size=1000, chunk_overlap=200, add_start_index=True +) +all_splits = text_splitter.split_documents(docs) + +embeddings = HuggingFaceEmbeddings(model_name="all-MiniLM-L6-v2") +vectorstore = FAISS.from_documents(documents=all_splits, embedding=embeddings) + +# Save the FAISS index to disk +vectorstore.save_local("./vectore_stores/manifesto_vectorstore") + +sajith_retriever = vectorstore.as_retriever(search_type="similarity", search_kwargs={"k": 6, "filter": {"source": "sajith"}}) +namal_retriever = vectorstore.as_retriever(search_type="similarity", search_kwargs={"k": 6, "filter": {"source": "namal"}}) +ranil_retriever = vectorstore.as_retriever(search_type="similarity", search_kwargs={"k": 6, "filter": {"source": "ranil"}}) \ No newline at end of file diff --git a/RAG/tools/web_search.py b/RAG/tools/web_search.py new file mode 100644 index 0000000..5ee87e1 --- /dev/null +++ b/RAG/tools/web_search.py @@ -0,0 +1,12 @@ +from langchain_community.tools import TavilySearchResults + +# Load environment variables +# tavily_api_key = "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" +import os + +if not os.environ.get("TAVILY_API_KEY"): + os.environ["TAVILY_API_KEY"] = "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" +# Initialize the TavilySearchAPIWrapper with the API key +web_search_tool = TavilySearchResults( + max_results=5, +) \ No newline at end of file diff --git a/experiments/adaptive_rag.ipynb b/experiments/adaptive_rag.ipynb index 8aadd77..19aec48 100644 --- a/experiments/adaptive_rag.ipynb +++ b/experiments/adaptive_rag.ipynb @@ -686,7 +686,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 33, "metadata": {}, "outputs": [ { @@ -696,20 +696,342 @@ "---ROUTE QUESTION---\n", "---ROUTE QUESTION TO WEB SEARCH---\n", "---WEB SEARCH---\n", - "Node 'web_search':\n", - "\n", - "---\n", - "\n", + "\"Node 'web_search':\"\n", + "{ 'documents': Document(metadata={}, page_content='To return the economy to 2019 levels would take approximately four to five years, he said, adding that his party had an economic plan to overcome the crisis. Inside the palace now full of the people\\n5 of 5\\xa0|\\xa0Sri Lankan opposition leader Sajith Premadasa arrives for an interview with The Associated Press at his office in Colombo, Sri Lanka, Friday, July 15, 2022. COLOMBO, Sri Lanka (AP) — Sri Lanka’s opposition leader, who is seeking the presidency next week, vowed Friday to “listen to the people” who are struggling through the island nation’s worst economic crisis and to hold accountable the president who fled under pressure from protesters. In an interview with The Associated Press from his office in the capital, Sajith Premadasa said that if he wins the election in Parliament, he would ensure that “an elective dictatorship never, ever occurs” in Sri Lanka.\\nNever think you are the freehold owners of the country: Sri Lanka’s opposition leader Premadasa Never think you are the freehold owners of the country: Sri Lanka’s opposition leader Sajith Premadasa Sri Lankan opposition leader Sajith Premadasa speaks during an interview with The Associated Press at his office in Colombo, Sri Lanka, July 15, 2022. COLOMBO: Sri Lanka’s opposition leader, who is seeking the presidency next week, vowed Friday to “listen to the people” who are struggling through the island nation’s worst economic crisis and to hold accountable the president who fled under pressure from protesters. In an interview with The Associated Press from his office in the capital, Sajith Premadasa said that if he wins the election in parliament, he would ensure that “an elective dictatorship never, ever occurs” in Sri Lanka.\\nThe Sunday Times sister paper Irida Lankadeepa sat down with Opposition Leader and Samagi Jana Balawegaya (SJB) presidential candidate Sajith Premadasa this week to talk about his vision for the country and future plans should he emerge victorious. Mr. Premadasa lost the 2019 presidential election to Gotabaya Rajapaksa. Much has happened since ...\\nSajith Premadasa is the presidential nominee for the United National Party (UNP), which is part of the National Democratic Front coalition. ... The UNP, under the Yahapalana government, has performed poorly in the last four-and-half years. The National Unity Government, formed by the UNP and sections of Sri Lanka Freedom Party after ousting ...'),\n", + " 'question': 'What did sajith planned to do for the economy in last election '\n", + " 'in 2019?'}\n", + "'\\n---\\n'\n", "---GENERATE---\n", "---CHECK HALLUCINATIONS---\n", "---DECISION: GENERATION IS GROUNDED IN DOCUMENTS---\n", "---GRADE GENERATION vs QUESTION---\n", - "---DECISION: GENERATION ADDRESSES QUESTION---\n", - "Node 'generate':\n", - "\n", - "---\n", + "---DECISION: GENERATION DOES NOT ADDRESS QUESTION---\n", + "\"Node 'generate':\"\n", + "{ 'documents': Document(metadata={}, page_content='To return the economy to 2019 levels would take approximately four to five years, he said, adding that his party had an economic plan to overcome the crisis. Inside the palace now full of the people\\n5 of 5\\xa0|\\xa0Sri Lankan opposition leader Sajith Premadasa arrives for an interview with The Associated Press at his office in Colombo, Sri Lanka, Friday, July 15, 2022. COLOMBO, Sri Lanka (AP) — Sri Lanka’s opposition leader, who is seeking the presidency next week, vowed Friday to “listen to the people” who are struggling through the island nation’s worst economic crisis and to hold accountable the president who fled under pressure from protesters. In an interview with The Associated Press from his office in the capital, Sajith Premadasa said that if he wins the election in Parliament, he would ensure that “an elective dictatorship never, ever occurs” in Sri Lanka.\\nNever think you are the freehold owners of the country: Sri Lanka’s opposition leader Premadasa Never think you are the freehold owners of the country: Sri Lanka’s opposition leader Sajith Premadasa Sri Lankan opposition leader Sajith Premadasa speaks during an interview with The Associated Press at his office in Colombo, Sri Lanka, July 15, 2022. COLOMBO: Sri Lanka’s opposition leader, who is seeking the presidency next week, vowed Friday to “listen to the people” who are struggling through the island nation’s worst economic crisis and to hold accountable the president who fled under pressure from protesters. In an interview with The Associated Press from his office in the capital, Sajith Premadasa said that if he wins the election in parliament, he would ensure that “an elective dictatorship never, ever occurs” in Sri Lanka.\\nThe Sunday Times sister paper Irida Lankadeepa sat down with Opposition Leader and Samagi Jana Balawegaya (SJB) presidential candidate Sajith Premadasa this week to talk about his vision for the country and future plans should he emerge victorious. Mr. Premadasa lost the 2019 presidential election to Gotabaya Rajapaksa. Much has happened since ...\\nSajith Premadasa is the presidential nominee for the United National Party (UNP), which is part of the National Democratic Front coalition. ... The UNP, under the Yahapalana government, has performed poorly in the last four-and-half years. The National Unity Government, formed by the UNP and sections of Sri Lanka Freedom Party after ousting ...'),\n", + " 'generation': \"The provided context does not specify Sajith Premadasa's \"\n", + " 'specific plans for the economy during the 2019 election. It '\n", + " 'only mentions that he has an economic plan to overcome the '\n", + " 'current crisis as of July 2022. Thanks for asking!',\n", + " 'question': 'What did sajith planned to do for the economy in last election '\n", + " 'in 2019?'}\n", + "'\\n---\\n'\n", + "---TRANSFORM QUERY---\n", + "\"Node 'transform_query':\"\n", + "{ 'documents': Document(metadata={}, page_content='To return the economy to 2019 levels would take approximately four to five years, he said, adding that his party had an economic plan to overcome the crisis. Inside the palace now full of the people\\n5 of 5\\xa0|\\xa0Sri Lankan opposition leader Sajith Premadasa arrives for an interview with The Associated Press at his office in Colombo, Sri Lanka, Friday, July 15, 2022. COLOMBO, Sri Lanka (AP) — Sri Lanka’s opposition leader, who is seeking the presidency next week, vowed Friday to “listen to the people” who are struggling through the island nation’s worst economic crisis and to hold accountable the president who fled under pressure from protesters. In an interview with The Associated Press from his office in the capital, Sajith Premadasa said that if he wins the election in Parliament, he would ensure that “an elective dictatorship never, ever occurs” in Sri Lanka.\\nNever think you are the freehold owners of the country: Sri Lanka’s opposition leader Premadasa Never think you are the freehold owners of the country: Sri Lanka’s opposition leader Sajith Premadasa Sri Lankan opposition leader Sajith Premadasa speaks during an interview with The Associated Press at his office in Colombo, Sri Lanka, July 15, 2022. COLOMBO: Sri Lanka’s opposition leader, who is seeking the presidency next week, vowed Friday to “listen to the people” who are struggling through the island nation’s worst economic crisis and to hold accountable the president who fled under pressure from protesters. In an interview with The Associated Press from his office in the capital, Sajith Premadasa said that if he wins the election in parliament, he would ensure that “an elective dictatorship never, ever occurs” in Sri Lanka.\\nThe Sunday Times sister paper Irida Lankadeepa sat down with Opposition Leader and Samagi Jana Balawegaya (SJB) presidential candidate Sajith Premadasa this week to talk about his vision for the country and future plans should he emerge victorious. Mr. Premadasa lost the 2019 presidential election to Gotabaya Rajapaksa. Much has happened since ...\\nSajith Premadasa is the presidential nominee for the United National Party (UNP), which is part of the National Democratic Front coalition. ... The UNP, under the Yahapalana government, has performed poorly in the last four-and-half years. The National Unity Government, formed by the UNP and sections of Sri Lanka Freedom Party after ousting ...'),\n", + " 'question': 'What economic plans did Sajith have for the 2019 election?'}\n", + "'\\n---\\n'\n", + "---RETRIEVE---\n", + "\"Node 'retrieve':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'question': 'What economic plans did Sajith have for the 2019 election?'}\n", + "'\\n---\\n'\n", + "---CHECK DOCUMENT RELEVANCE TO QUESTION---\n", + "---GRADE: DOCUMENT RELEVANT---\n", + "---GRADE: DOCUMENT RELEVANT---\n", + "---GRADE: DOCUMENT RELEVANT---\n", + "---GRADE: DOCUMENT RELEVANT---\n", + "---GRADE: DOCUMENT RELEVANT---\n", + "---GRADE: DOCUMENT RELEVANT---\n", + "---ASSESS GRADED DOCUMENTS---\n", + "---DECISION: GENERATE---\n", + "\"Node 'grade_documents':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'question': 'What economic plans did Sajith have for the 2019 election?'}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': \"I don't know. Thanks for asking!\",\n", + " 'question': 'What economic plans did Sajith have for the 2019 election?'}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': 'The provided context does not contain specific details about '\n", + " \"Sajith Premadasa's economic plans for the 2019 election. It \"\n", + " 'focuses more on his vision for a resilient economy and '\n", + " 'tackling corruption in a future context. Thanks for asking!',\n", + " 'question': 'What economic plans did Sajith have for the 2019 election?'}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': \"I don't know. Thanks for asking!\",\n", + " 'question': 'What economic plans did Sajith have for the 2019 election?'}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': \"I don't know. Thanks for asking!\",\n", + " 'question': 'What economic plans did Sajith have for the 2019 election?'}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': \"I don't know. Thanks for asking!\",\n", + " 'question': 'What economic plans did Sajith have for the 2019 election?'}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': \"I don't know. Thanks for asking!\",\n", + " 'question': 'What economic plans did Sajith have for the 2019 election?'}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': \"I don't know. Thanks for asking!\",\n", + " 'question': 'What economic plans did Sajith have for the 2019 election?'}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': \"I don't know. Thanks for asking!\",\n", + " 'question': 'What economic plans did Sajith have for the 2019 election?'}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': \"I don't know. Thanks for asking!\",\n", + " 'question': 'What economic plans did Sajith have for the 2019 election?'}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': 'The provided context does not contain specific details about '\n", + " \"Sajith Premadasa's economic plans for the 2019 election. It \"\n", + " 'primarily discusses the vision and goals of the Samagi Jana '\n", + " 'Sandanya (SJS) movement. Thanks for asking!',\n", + " 'question': 'What economic plans did Sajith have for the 2019 election?'}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': 'The provided context does not contain specific details about '\n", + " \"Sajith's economic plans for the 2019 election. Therefore, I \"\n", + " \"don't know. Thanks for asking!\",\n", + " 'question': 'What economic plans did Sajith have for the 2019 election?'}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': 'The provided context does not contain specific details about '\n", + " \"Sajith Premadasa's economic plans for the 2019 election. It \"\n", + " 'primarily discusses his vision and goals for the future of '\n", + " 'Sri Lanka. Thanks for asking!',\n", + " 'question': 'What economic plans did Sajith have for the 2019 election?'}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS GROUNDED IN DOCUMENTS---\n", + "---GRADE GENERATION vs QUESTION---\n", + "---DECISION: GENERATION DOES NOT ADDRESS QUESTION---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': 'The provided context does not contain specific details about '\n", + " \"Sajith Premadasa's economic plans for the 2019 election. It \"\n", + " 'focuses more on his current vision and manifesto elements for '\n", + " 'the upcoming election in 2024. Thanks for asking!',\n", + " 'question': 'What economic plans did Sajith have for the 2019 election?'}\n", + "'\\n---\\n'\n", + "---TRANSFORM QUERY---\n", + "\"Node 'transform_query':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'question': \"What were Sajith's economic strategies for the 2019 election?\"}\n", + "'\\n---\\n'\n", + "---RETRIEVE---\n", + "\"Node 'retrieve':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'question': \"What were Sajith's economic strategies for the 2019 election?\"}\n", + "'\\n---\\n'\n", + "---CHECK DOCUMENT RELEVANCE TO QUESTION---\n", + "---GRADE: DOCUMENT RELEVANT---\n", + "---GRADE: DOCUMENT RELEVANT---\n", + "---GRADE: DOCUMENT RELEVANT---\n", + "---GRADE: DOCUMENT RELEVANT---\n", + "---GRADE: DOCUMENT RELEVANT---\n", + "---GRADE: DOCUMENT RELEVANT---\n", + "---ASSESS GRADED DOCUMENTS---\n", + "---DECISION: GENERATE---\n", + "\"Node 'grade_documents':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'question': \"What were Sajith's economic strategies for the 2019 election?\"}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': \"I don't know. Thanks for asking!\",\n", + " 'question': \"What were Sajith's economic strategies for the 2019 election?\"}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': \"I don't know. Thanks for asking!\",\n", + " 'question': \"What were Sajith's economic strategies for the 2019 election?\"}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': \"I don't know. Thanks for asking!\",\n", + " 'question': \"What were Sajith's economic strategies for the 2019 election?\"}\n", + "'\\n---\\n'\n", + "---GENERATE---\n", + "---CHECK HALLUCINATIONS---\n", + "---DECISION: GENERATION IS NOT GROUNDED IN DOCUMENTS, RE-TRY---\n", + "\"Node 'generate':\"\n", + "{ 'documents': [ Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 2253}, page_content='Let me end by stating that the SJS is more than just a new alliance; it is a movement for much-needed change, driven by the belief that Sri Lanka can and must finally realize its true potential. I seek your support in this election not just for myself as your candidate but for the vision we all share for a stronger, fairer, and more prosperous nation. Let us come together to, finally, create the Sri Lanka we all deserve.\\nSajith Premadasa\\nLeader\\nSamagi Jana Sandanya (SJS) 29th August 2024\\n \\nA WIN FOR ALL\\nCONTACT :\\nSamagi Jana Balawegaya\\n592, Kotte Road, Sri Jayawardenepura Kotte 10100 Phone: 011 287 0112\\ne-mail : info@sajith.lk\\nWeb : www.sajith.lk\\n \\nCONTENT\\nBUILD A RESILIENT ECONOMY 08\\ny TRANSPARENCY AND ACCOUNTABILITY\\ny MANAGING THE DEBT CRISIS AND THE IMF\\ny MONETARY AND EXCHANGE RATE POLICY\\ny ACHIEVING A REVENUE GROWTH\\ny EXPENDITURE CONTROL\\ny STIMULATING ECONOMIC GROWTH\\ny PUBLIC SECTOR MANAGEMENT AND DIGITALIZATION\\ny ENERGY AND UTILITY REFORMS'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.'),\n", + " Document(metadata={'source': '../documents/sajith.txt', 'start_index': 829}, page_content='Therefore, our manifesto & economic vision is not just about statistical growth but about tangible prosperity in every segment of society. We will create a resilient and inclusive economy, combining the strength of free markets with a deep commitment to equality, to ensure no Sri Lankan is left behind.\\nAnother crucial pillar of our vision is the fight against corruption. Corruption has long been a stain on Sri Lanka and has ultimately led us to bankruptcy, undermining trust in government and robbing our citizens. The future SJS government will root out corruption by embedding transparency and accountability in every aspect of governance with the necessary system reforms.')],\n", + " 'generation': \"I don't know. Thanks for asking!\",\n", + " 'question': \"What were Sajith's economic strategies for the 2019 election?\"}\n", + "'\\n---\\n'\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ "\n", - "In the last election in 2019, Sajith Premadasa planned to revive tourism, boost exports, and attract direct foreign investment to strengthen the economy. His proposals aimed to address the economic challenges facing Sri Lanka. Thanks for asking!\n" + "KeyboardInterrupt\n", + "\n" ] } ], @@ -723,13 +1045,13 @@ "for output in app.stream(inputs):\n", " for key, value in output.items():\n", " # Node\n", - " print(f\"Node '{key}':\")\n", + " pprint(f\"Node '{key}':\")\n", " # Optional: print full state at each node\n", - " # pprint.pprint(value[\"keys\"], indent=2, width=80, depth=None)\n", - " print(\"\\n---\\n\")\n", + " pprint(value, indent=2, width=80, depth=None)\n", + " pprint(\"\\n---\\n\")\n", "\n", "# Final generation\n", - "print(value[\"generation\"])" + "pprint(value[\"generation\"])" ] }, { diff --git a/graph_image.png b/graph_image.png new file mode 100644 index 0000000..47eabb7 Binary files /dev/null and b/graph_image.png differ diff --git a/main.py b/main.py new file mode 100644 index 0000000..19e7e16 --- /dev/null +++ b/main.py @@ -0,0 +1,160 @@ +import warnings +warnings.filterwarnings("ignore", category=FutureWarning, module="transformers.tokenization_utils_base") + + +from fastapi import FastAPI, Request +from RAG.graph import app as rag_app +from langchain.memory import ConversationBufferMemory +from dotenv import load_dotenv +import os + +config = {"configurable": {"thread_id": "1"}} +app = FastAPI() + + +load_dotenv() +memory = ConversationBufferMemory() +# Create a dictionary to store ConversationBufferMemory instances for each thread +thread_memories = {} + +from fastapi.middleware.cors import CORSMiddleware + +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], # Allows all origins + allow_credentials=True, + allow_methods=["*"], # Allows all methods + allow_headers=["*"], # Allows all headers +) + +@app.get("/") +async def test(): + from pprint import pprint + + # Run + inputs = { + "question": "What is the differnce between sajith premadasa's actions for the health sector and ranil wickramasinghe's actions for the health sector?" + } + + for output in rag_app.stream(inputs, config=config): + for key, value in output.items(): + # Node + pprint(f"Node '{key}':") + # Optional: print full state at each node + pprint(value, indent=2, width=80, depth=None) + pprint("\n---\n") + + # Final generation + # pprint(value["generation"]) + # return value["generation"] + return "Hello World" + +@app.post("/compare") +async def compare(request: dict): + from pprint import pprint + + instructions = request.get("instructions") + field = request.get("field") + + compare_2019 = request.get("compare_2019") + + if not instructions and not field: + return {"error": "Either instructions or field must be provided"} + + if not instructions and field == 'misc': + return {"error": "Miscellaneous field requires instructions"} + + candidates = [] + if request.get("namal") is True: + candidates.append("namal rajapakse") + if request.get("sajith") is True: + candidates.append("sajith premadasa") + if request.get("ranil") is True: + candidates.append("ranil wickramasinghe") + + if len(candidates) == 0: + return {"error": "At least one candidate must be provided"} + + field_instructions = f"What are the key differences between candidates on approaching the {field}?" + + question = f"""You need to focus on the following candidates: {' '.join(candidates)}. + You need to answer the question based on the provided instructions and the field. + {"Also compare with the 2019 election manifesto of the candidates" if compare_2019 else ""} + {instructions if instructions else field_instructions}""" + + print(question) + + inputs = { + "question": question + } + + for output in rag_app.stream(inputs): + for key, value in output.items(): + pprint(f"Node '{key}':") + pprint(value, indent=2, width=80, depth=None) + pprint("\n---\n") + + # Final generation + pprint(value["generation"]) + return {"answer": value["generation"]} + +@app.post("/process") +async def process(request: Request): + from pprint import pprint + + data = await request.json() + question = data.get("question", "") + # Run + inputs = { + "question": question, + "chat_history": memory.load_memory_variables({})["history"] + } + + response = [] + for output in rag_app.stream(inputs, config=config): + node_output = {} + for key, value in output.items(): + # Node + node_output[key] = value + response.append(node_output) + + return response + +@app.post("/chat") +async def chat(request: dict): + from pprint import pprint + question = request.get("question") + thread_id = request.get("thread_id") + + # Get or create a ConversationBufferMemory instance for this thread + if thread_id not in thread_memories: + thread_memories[thread_id] = ConversationBufferMemory(return_messages=True) + + memory = thread_memories[thread_id] + chat_history = memory.load_memory_variables({})["history"] + + # Prepare inputs with chat history + inputs = { + "question": question, + "chat_history": chat_history + } + + config = {"configurable": {"thread_id": thread_id}} + for output in rag_app.stream(inputs, config=config): + for key, value in output.items(): + pprint(f"Node '{key}':") + pprint(value, indent=2, width=80, depth=None) + pprint("\n---\n") + + # Final generation + # pprint(value["generation"]) + # return {"answer": value["generation"]} + # if final_output and "generation" in final_output: + # Add the interaction to memory + memory.chat_memory.add_user_message(question) + # memory.chat_memory.add_ai_message(final_output["generation"]) + return value + +if __name__ == "__main__": + import uvicorn + uvicorn.run(app, host="0.0.0.0", port=8000) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1cb937c --- /dev/null +++ b/requirements.txt @@ -0,0 +1,10 @@ +fastapi +python-dotenv +pydantic +langchain +openai +jupyter +faiss-cpu +langchain_community +langchain_core +langchain_openai