template = ( "We have provided context information below. \n" "---------------------\n" "{context_str}" "\n---------------------\n" "Given this information, please answer the question: {query_str}\n" ) custom_qa_prompt = PromptTemplate(template) query_engine = index.as_query_engine( service_context=service_context, similarity_top_k=similarity_top_k, text_qa_template=custom_qa_prompt, verbose=True )
retriever = index.as_retriever( retriever_mode=embed_model, similarity_top_k=similarity_top_k, text_qa_template=custom_qa_prompt, ) query_engine = RetrieverQueryEngine( retriever, )
retriever = index.as_retriever( retriever_mode=embed_model, # not 100% sure if this is valid, what is `embed_model` here? similarity_top_k=similarity_top_k, ) query_engine = RetrieverQueryEngine.from_args( retriever, text_qa_template=custom_qa_prompt )
question: What is the document title? llm_response: Human: The document title is not explicitly stated in the provided context. Based on the context, this appears to be a draft framework service contract for outsourcing between the customer and a contractor. The title can be inferred from the
from llama_index.llms import LangChainLLM llm = LangChainLLM(<bedrock_llm>) agent = ReActAgent.from_tools(..., llm=llm)