Build a prompt that includes the system prompt, context, and chat history.
"""
history = get_session_history(session_id)
history_text = "\n".join(history)
default_string = "System instruction here"
if custom_prompt.lower() == default_string.lower() and "opengpt" in model_name.lower():
system_prompt = f"""
System: Ein Gespräch zwischen einem Menschen und einem Assistenten mit künstlicher Intelligenz. Der Assistent gibt hilfreiche und höfliche Antworten auf die Fragen des Menschen.
Konversation_Geschichte: {history_text}
Kontext: {context}
Beantworte folgende Frage ausschließlich auf Basis des oben gegebenen Kontextes und Konversation Geschichte. Beziehen Sie sich in der abschließenden Antwort nicht auf interne Prozesse und Gedankenketten.
Frage: {question}
Assistant:
"""
#system_prompt = f"""
#System: A chat between a human and an artificial intelligence assistant. The assistant gives helpful and polite answers to the user's questions and must provide answers concisely in English langauge.
#previous_conversations: {history_text}
#Context: {context}
#Answer the following user's question based solely on the context given above. Do not reference any internal processing, chain-of-thought, or previous conversation details in the final answer.