microsoft / semantic-kernel

Integrate cutting-edge LLM technology quickly and easily into your apps
https://aka.ms/semantic-kernel
MIT License
21.36k stars 3.14k forks source link

Improve the getting started documentation for Copilot chat #1352

Closed securigy closed 1 year ago

securigy commented 1 year ago

I cloned the entire Semantic Kernel repository and here I read the following:

`Run func start --csharp from the command line. This will run the service API locally at http://localhost:7071.

Two endpoints will be exposed by the service API:

InvokeFunction: [POST] http://localhost:7071/api/skills/{skillName}/invoke/{functionName} Ping: [GET] http://localhost:7071/api/ping`

I tried to run the "func start --csharp" on the command line but it cannot find it. It does not say from what folder path I should run it, or do I misunderstand the statement?

Anyway, how to I run this project? (I'm not a web developer)

Also, where do I find clear example of Embeddings + Vector DB usage in C# for a scenario of questioning large number of private documents?

craigomatic commented 1 year ago

Try starting from here: https://github.com/microsoft/semantic-kernel/tree/main/samples/dotnet/kernel-syntax-examples

This sample may help get you moving in the right direction re embeddings: https://github.com/microsoft/semantic-kernel/blob/main/samples/dotnet/kernel-syntax-examples/Example15_MemorySkill.cs

What you are referring to above is how to being running the KernelHttpServer which is an Azure Function that wraps the Kernel so that a web client can make use of it.

securigy commented 1 year ago

Thank you for the reference. I started from Example38. I use VS2022. and having Pinecone key and environment. However, it crashes at the following line: string key1 = await kernel.Memory.SaveInformationAsync(MemoryCollectionName, "british short hair", "cat1", null, additionalMetadata); with 401 - Access denied. Did I need to create Pinecode resource or something like that on Azure? Or do I need to run KernelHttpServer locally? I still cannot figure out how to run the kernel locally on my PC... Can you explain in plain English? Where do I execute the "func start --csharp" from?

securigy commented 1 year ago

I realized that my problem was with the key: I used Azure OpenAI key instead of OpenAI key. So I replaced original code of instantiating kernel.

IKernel kernel = Kernel.Builder. WithAzureTextCompletionService("text-davinci-003", "https://azuresemantickernel.openai.azure.com/", azureOpenApiKey) .WithAzureTextEmbeddingGenerationService("text-embedding-ada-002", "https://azuresemantickernel.openai.azure.com/",azureOpenApiKey). WithMemoryStorage(memoryStore) .Build();

However, the same line: string key1 = await kernel.Memory.SaveInformationAsync(MemoryCollectionName, "british short hair", "cat1", null, additionalMetadata);

gives me now the exception: Microsoft.SemanticKernel.Connectors.Memory.Pinecone.PineconeMemoryException: 'Index creation is not supported within memory store. It should be created manually or using CreateIndexAsync. Ensure index state is Ready.'

So, I am kinda lost...

matthewbolanos commented 1 year ago

I've created an issue here in the docs repo that I'll be working on during the next sprint to improve the getting started documentation for Copilot chat. I'll also try to identify why you're running into the PineconeMemoryException.

https://github.com/MicrosoftDocs/semantic-kernel-docs/issues/22

matthewbolanos commented 1 year ago

The docs for Chat Copilot have been updated. Let us know if the instructions are still not clear.