C# and ChatGPT: How to Integrate the ChatGPT Completions into C# Application

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hello friends welcome to this office page today in this video session we will discuss about uh how to integrate a chat CPT and their completion features in csap application so today I will demonstrate this by with the example so first of all we need to create a API key for uh open API so we will open now open AI website and then we login by with any emails with your personal email and after logging this dashboard will be displayed and then you can go to your account and then click on view view API key here I already created one API for a sample and I will click this secret key after creating this video so this will not work at your own when you write so you can create your own API key for uh use this demonstration so first of all I create a one blank project for a console application this is the Totten framework console application currently this is the blanks so first of all we need to install a new kit package for open API so I am going to this this package manager console and then here we install the open API package then we write open AI since the install package openai sorry it's open AI then press enter button so this will install the latest open AI SDK now after that I'm writing one more namespace or open AI it's open AI underscore API and now uh I am writing here our console like a right line here like I'm uh we provide any questions for that opening a like uh I'm writing uh what is meaning of life like a simple questions or test and then we create our variable for open AI equal to new open AI underscore API and then here we we provide a API key it's open AI API so here this will require the API keych Ain so we can copy this from here from for this secret key so I am using that secret gear and then then we creating a completion request so I'm writing a completion request equal to we can think of one object for this and then it container difference properties like uh compiled from stop Echo this way when we move the cursors so this will provide the descriptions about their properties so like you go it's you go back to prompt means it's showing a prompt message uh what you want to ask from open API and there is a different properties you can check this by your own recording their tokens model names means which which model you want to use in open API for your answers so the other different options available for this so first of all we provide a form means I'm providing a questions for this click like I am writing this courses for open API and then we provide here a model for this for which model I am using so it's open AI or demonstration I am using DaVinci text so open AI and the square API dot model dot this is showing a different models here so for this demonstration I am like using this DaVinci text and this will here describe the models like a most Capital gpt3 model can do any tasks that models can do with higher quality and longer or 10 better instruction for links within text so like I'm using you can check with your own with different models and their output now now uh we providing like aware completions we getting the result where completions is equal to open AI Dot completions Dot dot create competition there is providing a two variables one is the completions like another one is like a format this required a format features also completions provide a multi-line answers and if I use com completion essing then this required only single output single lineup like power definition name firstly use this completion async and then use this completion request now I am using that forage make where completion and then completions Dot result Dot completion and then we can write here like a console Dot right then here it's a completion dot text and then I'm writing a returns console dot red light or reading that text then let me say Ctrl Ctrl s for save this application So within this application here this will show in our first message that we write in and this openly I provide the question of this answer like the meaning of life which was that it's impossible to answer definitely and we can run this application again and again this will provide a different different answers according to their algorithms so if we run application in different times and this will provide different different answers so if we change like a completion a sync and if I'm changing for multi-line like completions then this will provide a multi-lance multi-line answer for this and like a default is five lines means this will describe the answer in five different answers we can change the default uh outputs like here like I'm setting it as a 10 so this will provide a 10 line upper answer for this questions we can change their different types of models here like I'm changing something like any different text embedding so we'll provide a different line of answer different types of sponsors different formats so this will depend on the models something like that that changing like a different answers different models and we can also control the temperatures like this container temperature completion request Dot temperature is like a its higher value means model will take more risk this number of iterations to provide your answers so 0.95 more KT applications and zero or open width well defined answers like I'm changing a template temperatures like 0.9 and again run this application this will showing a different different answers according to their temperatures so and you can also there is another variables also available models equal penalty you can use different properties and check your answers according to that so one more is like it's a Top-Up P this is alternative to sampling with temperature and called nuclear sampling and you can use either temperature or or top of the this uh this can be said according to your need so this is a complete some sample and simple demonstration for how you can use a 10gpt in your csap applications so I will try to demonstrate and if you like my videos send for more creative uh topics so uh by that we can create our videos on that so please click on subscribe button and for getting a latest updates also click on notification Bell so thanks thanks for watching we will meet in next video season
Info
Channel: Csharp Space
Views: 4,967
Rating: undefined out of 5
Keywords: C#, ChatGPT, natural language processing, NLP, language model, API, programming, development, integration, tutorial, coding, software development, chatbot, virtual assistant, language understanding, C# developers, AI, machine learning, OpenAI, state-of-the-art NLP, csharp space, chat gpt, chatgpt explained, web development
Id: _J8LH3TKsFU
Channel Id: undefined
Length: 10min 53sec (653 seconds)
Published: Mon Jan 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.