Building a conversation
The Llama model you've been working with can accept prompts in the form of messages from different roles. In this exercise, you'll create messages to prompt a customer support chatbot for an internet service provider.
The Llama model is available as llm.
Este ejercicio forma parte del curso
Working with Llama 3
Instrucciones del ejercicio
- Complete the conversation in the
convlist so it includes the"user"message provided asprompt. - Pass the conversation to the Llama model,
llm, and print the result.
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
prompt = "Give me four short steps to troubleshoot my internet connection."
conv = [
# Complete the user message
{
"role": "____",
"content": ____
}
]
# Pass the conversation to the model
result = llm.create_chat_completion(messages=____, max_tokens=20)
print(result)