add official Next.js and Vite sample projects (closes #430)fix next-js template#622
add official Next.js and Vite sample projects (closes #430)fix next-js template#622Demiladepy wants to merge 2 commits intoIQAIcom:mainfrom
Conversation
|
Someone is attempting to deploy a commit to the IQ Team on Vercel. A member of the Team first needs to authorize it. |
|
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces two new official sample projects, one for Next.js and one for Vite, to showcase the integration of ADK-TS. These examples provide clear demonstrations of core functionalities such as agent setup, streaming responses, and tool utilization within modern web frameworks. Additionally, it includes a refinement to the existing Next.js template to improve its build process and simplify agent interaction. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request provides fixes for the Next.js starter template. The changes include removing the experimental --turbopack flag from the build script for improved stability, and refactoring the server action for interacting with the agent. The refactoring correctly removes a problematic in-memory caching mechanism, resolving a potential state-sharing bug in a serverless environment. My review includes a suggestion to consider the performance implications of this change for production environments.
|
|
||
| export async function askAgent(message: string) { | ||
| const runner = await getAgentRunner(); | ||
| const { runner } = await getRootAgent(); |
There was a problem hiding this comment.
Calling getRootAgent() on every request might introduce performance overhead if agent initialization is a costly process. While this change correctly fixes a state-sharing bug from the previous implementation by ensuring request isolation, this approach could become a bottleneck in a production application.
A potential optimization would be to cache the agent definition and only create a new runner or session for each request. This would depend on the specific API provided by the @iqai/adk library for creating sessions from a pre-built agent.
|
Hey @Demiladepy — thanks for contributing, great to have our first community PR! 🎉 A few things I need clarification on:
Just want to make sure I'm not missing context here. |
|
For sure, I took a look at the issues on the repo and decided to resolve
the next js issue. If you aren't satisfied with any changes please let me
know, I would do the needful to correct it.
…On Mon, 23 Mar 2026, 3:48 pm Timonwa Akintokun, ***@***.***> wrote:
*Timonwa* left a comment (IQAIcom/adk-ts#622)
<#622 (comment)>
Hey @Demiladepy <https://github.com/Demiladepy> — thanks for
contributing, great to have our first community PR! 🎉
A few things I need clarification on:
1.
The PR description says "adds official Next.js and Vite starter
projects" but the actual changes are just 3 small edits to the existing
next-js-starter. Did you forget to push some commits, or is the
description from a different PR?
2.
On the actual changes — can you explain the reasoning behind them?
- *Removing --turbopack from the build command* — Turbopack is the
recommended bundler for Next.js builds now, why remove it?
- *Removing the agentRunner singleton in _actions.ts* — this was
caching the runner to avoid re-initializing on every call. Without it,
getRootAgent() runs on every request, which seems like a regression?
- *Deleting card.tsx* — was this component actually unused, or is
something else importing it?
Just want to make sure I'm not missing context here.
—
Reply to this email directly, view it on GitHub
<#622?email_source=notifications&email_token=BLI7BW56WCNWHYG4KU6X76T4SFFCNA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJRGEYTSNRYGMY2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4111196831>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BLI7BW23QJGNQNIAAIMR6CD4SFFCNAVCNFSM6AAAAACWX4IUNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCMJRGE4TMOBTGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Description
Adds official starter sample projects for Next.js and Vite integrations with ADK-TS. Both projects demonstrate basic agent setup, streaming responses, and tool usage with their own README and setup instructions.
Related Issue
Closes #430
Type of Change
How Has This Been Tested?
cd apps/examples/nextjs-starter && pnpm install && pnpm dev— Next.js app builds and agent responds correctlycd apps/examples/vite-starter && pnpm install && pnpm dev— Vite app builds and agent responds correctlyChecklist
Additional Notes
Both sample projects use
@iqai/adkand follow the same structure as existing examples inapps/examples/. Each project includes a standalone README with setup steps, required environment variables, and usage instructions.