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

Howie/fully customizable event handler #14

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

howieleung
Copy link
Collaborator

@howieleung howieleung commented Nov 27, 2024

use the new version of event handler. Fixed citation.

@howieleung howieleung marked this pull request as ready for review December 23, 2024 18:58

if stream_data:
yield f"data: {stream_data}\n\n"
async for _, _, to_be_yield in stream:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What triggers to_be_yield?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer you get the concept from my inline comment and variable names rather than answering here. Let me know if my new comment answer your question.

self, message: "ThreadMessage"
) -> Optional[str]:
if message.status == "completed":
annotations = [annotation.as_dict() for annotation in message.file_citation_annotations]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are annotations always citations? Do they have any other additional information?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are annotations always citations?
No, a while ago there was issue that the delta text has annotation, but we got no citation. Backend claimed they have fixed it. To do our best, we collect all citation and convert the anntations into clickable links only if the corresponded citation exist.

Do they have any other additional information?
Yes, but for citation, I only care about file_citation_annotations.

@sophia-ramsey
Copy link

Are PRs to this repo always into main?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants