LoopAI-103

Before you start

Short explainers for ideas this lesson builds on. Watch these first if they're new to you.

0 of 1 watched · about 2 min
Read this lesson

Try before you code

Before you write a single line of code, it pays to poke around your project in the Foundry portal. The portal lets you try models interactively, and it even writes starter code for you. Your main tool is the model playground, found in the left navigation: a scratchpad for trying a model with no code at all. You send prompts to a deployed model and watch it answer live, tweak settings like temperature, how adventurous its wording is, on models that offer it, and max tokens, how long it may answer, give it a system message to shape how it behaves, and experiment with other models and setups. Ask which bike suits a city commute, with the temperature turned up, then down, and you'll learn more in five minutes than from an hour of reading, which makes your app far easier to design.

The Code button

The most useful button in the playground is Code, in the chat pane. Whenever you like what you see, select it, and you get code that recreates that exact chat session in your own app. You pick the API, such as the Responses API or ChatCompletions, then your programming language, then the SDK to use. The sample is already filled in with your project endpoint, your model deployment name, and the settings you just chose, so it's ready to run as a starting point. Paste it into your development environment, and shape it to fit your app.

From playground to code

Put together, the usual rhythm has four beats. Explore in the playground: try prompts, adjust settings, and find what works. Generate a code sample with the Code button. Build your application by customizing that code. Then loop back: test each new idea in the playground first, and carry what works into your code. It's like a chef tasting a sauce before cooking for a hundred people: cheap experiments first, so your real development time goes into ideas that already work.

Facts from Microsoft's documentation: Microsoft Foundry Playgrounds (CC BY 4.0), rewritten in Loop's own words and examples. Narration, animation, and quiz by Loop. Microsoft, Azure, and Microsoft Foundry are trademarks of Microsoft. Loop is independent and not affiliated with or endorsed by Microsoft.