Coder Social home page Coder Social logo

basicchat's Introduction

Sample code to demonstrate use of Semantic Kernel.

After cloning or copying the repo, you'll need to open the solution in Visual Studio, which should automatically resolve the dependencies.

You will also need an Azure subscription with an Azure OpenAI resource provisioned and a deployed model (GPT3.5 or GPT4). You also need to create environment variables for your Azure OpenAI endpoint, apiKey, and the deploymentname.

You can also use an OpenAI subscription if you have one, but you'll need to adjust the code by changing line 14 to:

builder.Services.AddOpenAIChatCompletion(modelID, endpoint, apiKey);

Note that OpenAI uses a modelID rather than deploymentName, and you may also need to supply other parameters. It should work the same, but I haven't tested using the model through OpenAI directly.

You can also use Visual Studio Code and resolve the NuGet dependencies and setup at the command line:

# set up environment variables
[Environment]::SetEnvironmentVariable("endpoint", "https://xxxxxx.openai.azure.com/", "Machine")
[Environment]::SetEnvironmentVariable("deploymentName", "xxxx", "User")
[Environment]::SetEnvironmentVariable("apiKey", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "User")

# install packages
dotnet add package Microsoft.SemanticKernel

basicchat's People

Contributors

spdoctor avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.