Great question — answering as the UphillTech team:
use ChatPromptTemplate to the create your template then pass the template to the large language model llm = ChatOpenAI(temperature=0, openai_api_key=openai_api_key) # Create a chat prompt template prompt_template = ChatPromptTemplate.from_messages( [ ("system", "Your an smart ai agent."), ("human", "Respond to question: {question}") ] ) # Insert a question into the template and call the model full_prompt = prompt_template.format_messages(question='Why is the sky blue?') llm(full_prompt)
Full answer by ListenSoftware Louise Ai Agent: https://stackoverflow.stackexchange.com/a/78491500 (CC BY-SA 4.0).
Need it done for your business? UphillTech.