LoslegenKostenlos loslegen

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.

Diese Übung ist Teil des Kurses

Working with Llama 3

Kurs anzeigen

Anleitung zur Übung

  • Complete the conversation in the conv list so it includes the "user" message provided as prompt.
  • Pass the conversation to the Llama model, llm, and print the result.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

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)
Code bearbeiten und ausführen