Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request]: Expose CituationUtils class #2309

Open
xzf0587 opened this issue Feb 13, 2025 · 1 comment
Open

[Feature request]: Expose CituationUtils class #2309

xzf0587 opened this issue Feb 13, 2025 · 1 comment
Labels
dotnet Change/fix applies to dotnet. If all three, use the 'JS & dotnet & Python' label enhancement New feature or request

Comments

@xzf0587
Copy link

xzf0587 commented Feb 13, 2025

Please be sure to check the Discussions Q&A section before filing a new question.
In the Teams Toolkit, we have a CEA template which overrides the SayCommand to customize the citation content.
The teams ai library exposes a useful citation utility as the following shows.
https://github.com/OfficeDev/teams-toolkit/blob/2113c3332df66d88e8955115ca46c945ccbd637e/templates/ts/custom-copilot-rag-customize/src/app/customSayCommand.ts#L68
We want to migrate this code to dotnet project. It is found that the implementation of CitationUtils in dotnet is an internal class and the project code cannot access to it.
https://github.com/microsoft/teams-ai/blob/main/dotnet/packages/Microsoft.TeamsAI/Microsoft.TeamsAI/Utilities/CitationUtils.cs

Question

Can we expose the CitationUtils class(maybe more utilities class) to library users?

One more question, is there any suggestion for the best practice to customize the citation?
I find that we want to customize the citation content rather override the SayCommand.
If there is hook which we can update the citation before the real SayCommand action (somehow BeforeSayCommand), we do not need to override the SayCommand action.

Code snippets

  // If there are citations, modify the content so that the sources are numbers instead of [doc1], [doc2], etc.
    const contentText = citations.length < 1 ? content : Utilities.formatCitationsResponse(content);

    // If there are citations, filter out the citations unused in content.
    const referencedCitations =
      citations.length > 0 ? Utilities.getUsedCitations(contentText, citations) : undefined;
@xzf0587 xzf0587 added the dev support Dev support tracking label Feb 13, 2025
@aacebo
Copy link
Collaborator

aacebo commented Feb 13, 2025

we do plan to expose better utilities for creating complex activities such as this, we are working on it actively but unsure when these new changes will be available.

@lilyydu lilyydu changed the title [Dev support]: [Feature request]: Expose CituationUtils class Feb 21, 2025
@lilyydu lilyydu added enhancement New feature or request dotnet Change/fix applies to dotnet. If all three, use the 'JS & dotnet & Python' label and removed dev support Dev support tracking labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet Change/fix applies to dotnet. If all three, use the 'JS & dotnet & Python' label enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants