transforms
langroid/prompts/transforms.py
get_verbatim_extract_async(question, passage, LLM)
async
¶
Asynchronously, get verbatim extract from passage that is relevant to a question.
Source code in langroid/prompts/transforms.py
get_verbatim_extracts(question, passages, LLM)
¶
From each passage, extract verbatim text that is relevant to a question, using concurrent API calls to the LLM. Args: question: question to be answered passages: list of passages from which to extract relevant verbatim text LLM: LanguageModel to use for generating the prompt and extract Returns: list of verbatim extracts (Documents) from passages that are relevant to question
Source code in langroid/prompts/transforms.py
followup_to_standalone(LLM, chat_history, question)
¶
Given a chat history and a question, convert it to a standalone question. Args: chat_history: list of tuples of (question, answer) query: follow-up question
Returns: standalone version of the question