microsoft / semantic-kernel

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

No working: GetMessageContext: Invalid URI: The format of the URI could not be determined #9708

Open bpw320 opened 2 weeks ago

bpw320 commented 2 weeks ago

in your example:

private static IReadOnlyList GetCitations(ChatMessageContent chatMessageContent) { var message = chatMessageContent.InnerContent as OpenAI.Chat.ChatCompletion;

 var messageContext = message.GetMessageContext();

 return messageContext.Citations;

}

 var messageContext = message.GetMessageContext();

return an error: Invalid URI: The format of the URI could not be determined

I am not sure if it is a bug or not, but it did not work

Thanks

bpw320 commented 1 week ago

turns out I used an index for UrlFieldName in DataSourceFieldMappings caused the error, my other question is, I have a bunch of indexes, how do I get their values? ChatCitation only has a few properties, Title, Chunkid, FilePath.etc. Thanks

dmytrostruk commented 1 week ago

@bpw320 Thanks for your question! Could you please specify what do you mean by index values?

If you are interested in getting actual property values from Azure AI Search index, I'm not sure if it's possible to receive it directly from ChatCitation, but it should be possible to get an index data by using Azure AI Search directly in combination with ChatCitation.ChunkId. Please let me know if that helps.

Thanks!

bpw320 commented 1 week ago

Thanks for this.