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

Add a sample for streaming callables #1185

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jhuleatt
Copy link
Collaborator

No description provided.

@jhuleatt jhuleatt requested review from egilmorez and taeold January 16, 2025 19:43
let channelData;
try {
// tell the client app we're starting
response.sendChunk({status: "fetching channel info", channelInfo});
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@egilmorez Here's an example that sends multiple updates to the client via sendChunk as it makes calls to the Youtube API. I think this might be a better generic example for streaming callables, since an LLM-y example might be better served by the onCallGenkit trigger. What do you think?

Comment on lines +94 to +100
response.sendChunk({
status: `found ${videos.length} videos`,
channelInfo,
});

return channelInfo;
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO snippet tag this

(channelInfo.channelDescription = channel.snippet.description),
(channelInfo.subscriberCount = channel.statistics.subscriberCount),
// send latest data to the client app
response.sendChunk({status: "found channel info", channelInfo});
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO snippet tag this

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.

1 participant