How to activate Bing Chat Enterprise

Here we are, Bing Chat Enterprise is out ! Have a look at the official product page : Your AI-Powered Chat for Work | Bing Chat Enterprise (microsoft.com). With Edge for Business already available, Edge is placing itself as personal and professional place to browse and use Internet service.

  1. Connect to this link to accept Bing Chat Enterprise Supplemental terms : https://www.bing.com/business/bceadmin
  2. Check the box to accept terms and click on Activate in Bing chat Enterprise zone :

In case of success you will have the following message :

If you are licensed for Microsoft 365 E3, E5, Business Standard, Business Premium, or A3 or A5 for faculty, it will comes at no additional costs for your company.

Next time, you and your collegues, will open Edge, you should see a Protected label in the upper right corner that indicates Bing Enterprise is enable and you can share data and conversations with Bing Chat securely and privately.

Dall-E image generator directly accessible from Edge

Tired of MidJourney Discord chat based image generator or to log in Open AI ? This week, Microsoft discretly adds a shortcut in Edge to bring image generation directly to Edge users in the UI. To enable this feature :

  1. Get the lastest version of Edge
  2. Click on the + button in the right side panel
  3. Check the ‘Image creator’

4. Connect your to Microsoft account :

5. Play with Dall-E (25 credits) without quitting Edge :

You’ll be able to get your creation history by clicking on the ‘My creations’ tab. Happy image generation 🚀

How to integrate OpenAI API (Text, Codex, DALL-e, ChatGPT coming soon) in your .NET Core app in 15 minutes

OpenAI API overview (from Open AI)

The OpenAI API can be applied to virtually any task that involves understanding or generating natural language or code. We offer a spectrum of models with different levels of power suitable for different tasks, as well as the ability to fine-tune your own custom models. These models can be used for everything from content generation to semantic search and classification.

To makes it a little more understandable, so with OpenAI API you can : generate and edit text, generate/edit/explain code, generate and edit images, train a model, search, classify and comapre text. Checkt the documentation here.

We will use DaVinci GPT-3 model in our app, but you can try other models :

LATEST MODELDESCRIPTIONMAX REQUESTTRAINING DATA
text-davinci-003Most capable GPT-3 model. Can do any task the other models can do, often with higher quality, longer output and better instruction-following. Also supports inserting completions within text.4,000 tokensUp to Jun 2021
text-curie-001Very capable, but faster and lower cost than Davinci.2,048 tokensUp to Oct 2019
text-babbage-001Capable of straightforward tasks, very fast, and lower cost.2,048 tokensUp to Oct 2019
text-ada-001Capable of very simple tasks, usually the fastest model in the GPT-3 series, and lowest cost.2,048 tokensUp to Oct 2019

Important : today (02/17/2023), ChatGPT API is not yet available but OpenAI indicates that it will come soon.

Phase 1 : get your secret API key

  1. Go to the OpenAI website and create a new account
  2. Signup for an OpenAI account
  3. Confirm your email address
  4. Log in to your account and navigate to the ‘View API keys’ dashboard
  5. Click on ‘Create a new secret key’

Store your API key in a secure location. You can test the API right now, but if you intend to use OpenAI API in a real workld case scanerio, check OpenAI documentation for details on usage and pricing.

 Phase 2 : create you .NET Core project to consume OpenAI API

  1. Open Visual Studio 2022
  2. Create a new .NET Core project (in my case a Web API)
  3. Install the ‘OpenAI‘ NuGet package as below :

4. In your program.cs file, just copy the following code (replace the apiKey with yours, generated in phase 1)

using OpenAI_API;
using OpenAI_API.Completions;

var builder = WebApplication.CreateBuilder(args);

var app = builder.Build();

app.UseHttpsRedirection();

app.MapGet("/givemesecretoftheuniverse", (string prompt) =>
{
    var apiKey = "sk-5ucaz1m00000000000000000000000000000000";
    var answer = string.Empty;

    var openAIAPI = new OpenAIAPI(apiKey);

    var completionRequest = new CompletionRequest
    {
        Prompt = prompt,
        Model = OpenAI_API.Models.Model.DavinciText,
        MaxTokens = 2000
    };

    try
    {
        var result = openAIAPI.Completions.CreateCompletionAsync(completionRequest);

        if (result != null)
        {
            foreach (var item in result.Result.Completions)
            {
                answer += item.Text;
            }
            return Results.Text("Answer of the universe : " + answer);
        }
        else
        {
            return Results.BadRequest("Not found");
        }
    }
    catch (Exception)
    {
        return Results.Problem("OpenAI API is not available or key are incorrect");
    }
});

app.Run();

5. Run your application, and open your Postman app or your favorite web browser to open the following URL : https://<your computer ip / localhost>:<your project port>/givemesecretoftheuniverse?prompt=what is the secret of the universe

6. The flow of the power of OpenAI will flow throught your screen 😁🚀🌚

More possibilities 🚀😁

As said earlier, you can use Codex, Dall-E, etc from OpenAI just by changing the Model = OpenAI_API.Models.Model statement and adapt your code consequently. Today, ChatGPT API is not yet available but OpenAI indicates that it will come soon.

You can also try this .NET library which is pretty cool as well : https://github.com/betalgo/openai

Conclusion

Integrating OpenAI APIs into your application is just as easy as creating a minimal API with .NET Core, so test it, learn it, and make our world a better one. With ChatGPT coming soon, accessible AI is becoming a reality.

Session Machine Learning et .NET avec ML.NET au Diginova 2019

Pour cette session en compagnie de Christopher Maneu (Microsoft France R&D), j’ai eu le plaisir de pouvoir parler de ML.NET, cette bibliothèque que l’on a déjà implémenté dans un produit et qui fonctionne à merveille (ou presque quand ce ticket aura été corrigé) et qui permet à tout développeur d’intégrer du Machine Learning dans ses applications .NET.

Ce duo avec Christophe a permis de comparer les solutions et de préciser les différents scénarios d’utilisation des services et framewok que Microsoft met à disposition des développeurs (ACS, CNTK, ML.NET) : quand l’utiliser, les scénarios connectés/déconnectés d’ACS et ML.NET, quel effort de montée en compétence pour les développeurs (SDK + apprentissage du Machine Learning), etc.

Un sujet extrêmement intéressant qu’il a fallut traiter en peu de temps .. .mais qui sera traiter plus en profondeur au prochaine Afterworks Microsoft 😉