| 99 | |
| 100 | |
| 101 | def configure_llm_only_chain(llm): |
| 102 | # LLM only response |
| 103 | template = """ |
| 104 | You are a helpful assistant that helps a support agent with answering programming questions. |
| 105 | If you don't know the answer, just say that you don't know, you must not make up an answer. |
| 106 | """ |
| 107 | system_message_prompt = SystemMessagePromptTemplate.from_template(template) |
| 108 | human_template = "{question}" |
| 109 | human_message_prompt = HumanMessagePromptTemplate.from_template(human_template) |
| 110 | chat_prompt = ChatPromptTemplate.from_messages( |
| 111 | [system_message_prompt, human_message_prompt] |
| 112 | ) |
| 113 | chain = chat_prompt | llm | StrOutputParser() |
| 114 | return chain |
| 115 | |
| 116 | |
| 117 | def configure_qa_rag_chain(llm, embeddings, embeddings_store_url, username, password): |