Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building AI Applications with Microsoft Semantic Kernel

You're reading from   Building AI Applications with Microsoft Semantic Kernel Easily integrate generative AI capabilities and copilot experiences into your applications

Arrow left icon
Product type Paperback
Published in Jun 2024
Publisher Packt
ISBN-13 9781835463703
Length 252 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Lucas A. Meyer Lucas A. Meyer
Author Profile Icon Lucas A. Meyer
Lucas A. Meyer
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Part 1:Introduction to Generative AI and Microsoft Semantic Kernel FREE CHAPTER
2. Chapter 1: Introducing Microsoft Semantic Kernel 3. Chapter 2: Creating Better Prompts 4. Part 2: Creating AI Applications with Semantic Kernel
5. Chapter 3: Extending Semantic Kernel 6. Chapter 4: Performing Complex Actions by Chaining Functions 7. Chapter 5: Programming with Planners 8. Chapter 6: Adding Memories to Your AI Application 9. Part 3: Real-World Use Cases
10. Chapter 7: Real-World Use Case – Retrieval-Augmented Generation 11. Chapter 8: Real-World Use Case – Making Your Application Available on ChatGPT 12. Index 13. Other Books You May Enjoy

Using Semantic Kernel to connect to AI services

To complete this section, you must have an API key. The process to obtain an API key was described at the beginning of this chapter.

In the upcoming subsections, we are only going to connect to the OpenAI text models GPT-3.5 and GPT-4. If you have access to the OpenAI models through Azure, you will need to make minor modifications to your code.

Although it would be simpler to connect to a single model, we are already going to show a simple but powerful Microsoft Semantic Kernel feature: we’re going to connect to two different models and run a simple prompt using the simpler but less expensive model, GPT-3.5, and a more complex prompt on the more advanced but also more expensive model, GPT-4.

This process of sending simpler requests to simpler models and more complex requests to more complex models is something that you will frequently do when creating your own applications. This approach is called LLM cascade, and it was...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime