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

message annotations are repeated #952

Closed
mohamedcherifmo opened this issue Jan 31, 2024 · 3 comments
Closed

message annotations are repeated #952

mohamedcherifmo opened this issue Jan 31, 2024 · 3 comments

Comments

@mohamedcherifmo
Copy link
Contributor

Description

I'm combining appendMessageAnnotation with function calling where I'm storing the result of the function call into the message annotations as follow:
data.appendMessageAnnotation({ messageID: messageID, result: top_stories.map((story: any) => ({ id: story.id, title: story.title, description: story.subtitle || story.description, image_url: story.image_url || story.image, category: story.type, url: story.url, })) })

When i console.log the message.annotations from the client side, the annotations array has 294 items. It should only have one

Code example

No response

Additional context

No response

@mohamedcherifmo
Copy link
Contributor Author

I figured out that when adding it to the onFinal it works as intended however when added as a result of a function call, it repeats the annotations with every response. I tried onStart (to have it stream at the start instead of at the end, but still repeated)

@nick-inkeep
Copy link
Contributor

@mohamedcherifmo , proposed fix above, please take a look and see if it resolves your issue.

@nick-inkeep
Copy link
Contributor

Should be resolved now @mohamedcherifmo with latest version

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

No branches or pull requests

3 participants