DEFAULT_CONTEXT_TEMPLATE = ( "Context information is below." "\n--------------------\n" "{context_str}" "\n--------------------\n" ) chat_engine = ContextChatEngine.from_defaults(..., context_template=DEFAULT_CONTEXT_TEMPLATE)
def completion_to_prompt(completion): return completion def messages_to_prompt(messages): return "\n".join([str(x) for x in messages]) llm = <LLM Class>(..., completion_to_prompt=completion_to_prompt, messages_to_prompt=messages_to_prompt)