Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/durmisi/OpenAIExtensions
AI Services & Extensions developed on top of Azure Open AI & SemanticKernel
https://github.com/durmisi/OpenAIExtensions
Last synced: 2 months ago
JSON representation
AI Services & Extensions developed on top of Azure Open AI & SemanticKernel
- Host: GitHub
- URL: https://github.com/durmisi/OpenAIExtensions
- Owner: durmisi
- License: mit
- Created: 2024-03-12T18:18:40.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-05-26T14:22:04.000Z (8 months ago)
- Last Synced: 2024-08-01T13:21:17.368Z (5 months ago)
- Language: C#
- Size: 449 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-semantickernel - OpenAIExtensions
README
# About OpenAIExtensions
OpenAIExtensions is a cutting-edge library designed to enhance and streamline the integration of Azure OpenAI services into your applications.
Leveraging the advanced capabilities of Azure OpenAI & developed on top of SematicKernel, my goal is to provide developers with a comprehensive toolkit that simplifies the process of building AI-powered solutions.# Using OpenAIExtensions in Your Project
In this guide, i'll walk you through the process of integrating OpenAIExtensions into your project and showcase how to use it effectively.
## Installation and Setup
To get started, you'll need to install OpenAIExtensions via NuGet Package Manager or by cloning the repository from GitHub.
```bash
dotnet add package OpenAIExtensions
```## AIConversationManager
Now, let's create an instance of the AIConversationManager class in your test or application code.
This manager orchestrates the conversation between users and the AI system.```bash
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Microsoft.SemanticKernel;
using OpenAIExtensions.Managers;
using OpenAIExtensions;
using Microsoft.SemanticKernel.ChatCompletion;var configuration = new ConfigurationBuilder()
.AddJsonFile($"appsettings.json")
.Build();var logger = LoggerFactory
.Create(x => x.AddConsole())
.CreateLogger();var endpoint = configuration.GetValue("OpenAI:Endpoint")!;
var key = configuration.GetValue("OpenAI:Key")!;var kernel = Kernel.CreateBuilder()
.AddAzureAIChatCompletion(endpoint: endpoint, apiKey: key)
.AddPlugin()
.Build();var aiConversationManager = new AIConversationManager(
kernel,
logger);var history = new ChatHistory();
history.AddUserMessage("What`s the weather like today in Skopje?");var systemMessage = @"
You are an AI bot that only knows how to answer questions about weather.
Always respond with text.
";var response = await aiConversationManager.ProcessConversationAsync(history, systemMessage);
var systemMessage = @"
You are an AI bot that only knows how to answer questions about weather.
Always respond with text.
";var response = await aiConversationManager.ProcessConversationAsync(history, systemMessage);
response => The weather in Skopje today is partly cloudy with a high of 15°C.
```