From the course: A Start to Using Generative AI in .NET

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Solution: Use the OpenAI Playground to simulate a chat session

Solution: Use the OpenAI Playground to simulate a chat session - .NET Tutorial

From the course: A Start to Using Generative AI in .NET

Solution: Use the OpenAI Playground to simulate a chat session

(upbeat music) - [Instructor] So for this challenge, I decided to create a bot that can only answer using C sharp code. It is a good practice to start with the best model that you have, which is GPT-4 turbo in our case. We can always tweak things for a simpler AI model later on. Okay, let's start with the system prompt. I will use dictation so that you don't have to watch me type. When I ask you a question you should always answer in the form of C sharp code. Don't answer as a full program. Continue any existing code if you can. Okay, let's me fix some of the dictation mistakes. And let's see what happens. Let's talk about planets today. What planets are in the solar system? And we have a nice C sharp code there with a string array listing all eight planets. But I have a soft spot in my heart for Pluto. So let's just change the system prompt and say, assume it is 2005 because Pluto was a planet until 2005. I will remove this answer and submit again. And now we have Pluto in the list…

Contents