-
Notifications
You must be signed in to change notification settings - Fork 30
feat: Support auto-streaming with langchain #1271
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
base: main
Are you sure you want to change the base?
Conversation
* origin/main: chore: update pnpm transitive dependencies (#1263) chore(deps-dev): Bump @types/node from 22.18.13 to 22.19.0 (#1257) chore(deps-dev): Bump eslint from 9.39.0 to 9.39.1 (#1261) chore: update pnpm transitive dependencies (#1254) chore(deps-dev): Bump @sap/cds-dk from 9.4.2 to 9.4.3 (#1251)
b556127 to
3b40abe
Compare
| // Todo: Extend BaseChatModelParams? | ||
| this.streaming = | ||
| (langchainOptions as { streaming?: boolean })?.streaming ?? false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The streaming-option is supported here, but I felt like extending or replacing BaseChatModelParams might be considered a breaking change which leads to any use needing to avoid type-checks.
| finalOutput = | ||
| finalOutput !== undefined ? finalOutput.concat(chunk) : chunk; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A snapshot test directly on the final output is not possible here, because langgraph will add uuids to the response object, but other tests should already be verifying the general execution with auto-streaming enabled.
77b712f to
b17650a
Compare
…stream * origin/main: (34 commits) chore: Monthly Transitive Dependency Update (#1318) chore(deps): Bump yaml from 2.8.1 to 2.8.2 (#1313) chore(deps-dev): Bump tsx from 4.20.6 to 4.21.0 (#1312) chore(deps-dev): Bump @changesets/cli from 2.29.7 to 2.29.8 (#1307) v2.3.0 feat: Support protected_material_code (#1285) chore: Add sample-code/e2e-test for scoped prompt-template refs (#1292) chore: Update sample code with new MCP SDK (#1303) chore(deps): Bump @modelcontextprotocol/sdk from 1.22.0 to 1.23.0 (#1301) chore(deps): Bump the langchain group with 5 updates (#1299) feat!: Update langchain to v1 (#1187) chore(deps): Bump actions/checkout from 5 to 6 (#1294) chore(deps-dev): Bump orval from 7.16.1 to 7.17.0 (#1298) chore(deps-dev): Bump orval from 7.16.0 to 7.16.1 (#1295) chore(deps-dev): Bump glob from 12.0.0 to 13.0.0 (#1289) chore: update pnpm transitive dependencies (#1291) chore(deps): Bump glob from 10.4.5 to 12.0.0 (#1288) chore(deps): Bump glob from 10.4.5 to 11.1.0 (#1284) chore(deps-dev): Bump glob from 11.0.3 to 12.0.0 (#1280) chore(deps-dev): Bump glob from 11.0.3 to 11.1.0 (#1283) ...
df681d3 to
259f0da
Compare
Context
Closes SAP/ai-sdk-js-backlog#344.
What this PR does and why it is needed
This PR adds basic support for passing
streaming: trueto the constructors and saving it as an attribute. Results are collected via.concat(). In addition this PR updates the unit tests, sample code and e2e tests.