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

[Bug]: StreamingResponse citations do not have working URLs #2330

Open
tianjing-li opened this issue Feb 27, 2025 · 4 comments
Open

[Bug]: StreamingResponse citations do not have working URLs #2330

tianjing-li opened this issue Feb 27, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@tianjing-li
Copy link

Language

Javascript/Typescript

Version

latest - 1.7.3

Description

Using the StreamingResponse with .setCitation(), I have added an array of citations that are all formatted like so

                        return {
                            title: doc.title || '',
                            url: doc.url || '',
                            content: truncLong(doc.text || ''),
                            filepath: '',
                        };

The citations appear:

Image

However the URLs do not work, and it also seems like the title and content fields might be misplaced?

Reproduction Steps

1. Inside a message handler `app.activity(ActivityTypes.Message,`
2. Initialize a `let streamer = new StreamingResponse(context);`
3. 
Format citations and set them on the streamer like so:


let stream_citations: Citation[] = docs.map((doc) => {
                        return {
                            title: doc.title || '',
                            url: doc.url || '',
                            content: truncLong(doc.text || ''),
                            filepath: '',
                        };
                    });

                    streamer.setCitations(stream_citations);
@tianjing-li tianjing-li added the bug Something isn't working label Feb 27, 2025
@sayali-MSFT
Copy link

@tianjing-li ,Thank you for your inquiry about your Teams app development issue! To assist you better, could you please provide the following details?

Documentation Links: Any specific documentation you followed that relates to your problem.

This information will help us better understand the situation and provide a more accurate response.

@tianjing-li
Copy link
Author

@sayali-MSFT I've looked at the docs for the StreamingResponse class directly. Here there is a setCitations() method which I've called with correctly formatted Citation objects

@tianjing-li
Copy link
Author

When using context.sendActivity(..) to send a message directly with citations attached this seems to work for the URL, however I need citations to work for my streamed response. Let me know if my approach with setCitations() is not correct, otherwise there's likely a bug.

@lilyydu
Copy link
Collaborator

lilyydu commented Mar 1, 2025

Hi @tianjing-li , what are the URLs linking to right now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants