You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for creating this library. It greatly simplifies calling the Gradient API. I am wondering how we can add something to the streaming chunk. Our current code, just plain javascript, is below and we are trying to simplify it using this SDK, but we are not sure how to add the "type": "sources" to the stream, and this is essential for our front end RAG application. Can you please let me know how we can use the Stream part of the SDK to do something like below? Specifically, it's this line we are not sure how to implement with the SDK: controller.enqueue(textEncoder.encode(JSON.stringify({ type: "sources", data: usedSources })));
Thanks for creating this library. It greatly simplifies calling the Gradient API. I am wondering how we can add something to the streaming chunk. Our current code, just plain javascript, is below and we are trying to simplify it using this SDK, but we are not sure how to add the "type": "sources" to the stream, and this is essential for our front end RAG application. Can you please let me know how we can use the Stream part of the SDK to do something like below? Specifically, it's this line we are not sure how to implement with the SDK: controller.enqueue(textEncoder.encode(JSON.stringify({ type: "sources", data: usedSources })));
Current code