microsoft / teams-ai

SDK focused on building AI based applications and extensions for Microsoft Teams and other Bot Framework channels
MIT License
406 stars 176 forks source link

[Bug]: Citations are not displayed because formatted content text is not used to match citation marks #1617

Closed therealjohn closed 5 months ago

therealjohn commented 5 months ago

Language

Javascript/Typescript

Version

latest

Description

https://github.com/microsoft/teams-ai/blob/c17f248380f1dfcef8e2ee9b31c25730a761483d/js/packages/teams-ai/src/actions/SayCommand.ts#L192

getUsedCitations should use contentText instead of content. The reason is because content still has marks like [doc1] in it, so the regex in getUsedCitations fails to find any matches like [1].

Reproduction Steps

1. Build latest in `main` and run the OpenAI sample to get citations.