Conversation
Summary of ChangesHello @tomkis, 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 a foundational feature for dynamic user interface generation within the AgentStack ecosystem. It includes a new prototype agent that can generate UI elements on the fly, along with comprehensive updates to both the Python and TypeScript SDKs to support this new "Generative Interface Extension." The AgentStack UI has also been enhanced to interpret and render these dynamically generated UI specifications, paving the way for more interactive and flexible agent-user interactions. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a prototype for a generative UI feature. It adds a new generative-interface agent that uses an LLM to dynamically generate UI components based on a catalog. The changes include the agent's implementation, its Dockerfile, and necessary extensions to both the Python and TypeScript SDKs. Additionally, it adds new React components to the agentstack-ui to render the JSON-based UI specification. My review focuses on cleaning up placeholder code, removing debug artifacts, and addressing an incomplete implementation of user interactions in the new UI components.
| onAction: (a) => { | ||
| const setData = setDataRef.current; | ||
| const data = dataRef.current; | ||
| if (setData) { | ||
| // executeAction(a.name, a.params, setData, data); | ||
| } | ||
| }, |
There was a problem hiding this comment.
The UI interaction handling seems incomplete. The onAction handler in buildRegistry has a commented-out call to executeAction, and there's no mechanism to propagate user actions to the MessageGenerativeInterface component to trigger submitGenerativeInterface. This results in a UI that is rendered but not interactive.
To fix this, you could pass an action handler function (e.g., onAction) as a prop to GenerativeInterfaceRenderer and buildRegistry, and then call it from the component's onAction handler.
| except json.JSONDecodeError: | ||
| continue |
There was a problem hiding this comment.
The try...except json.JSONDecodeError: continue block silently ignores any lines from the LLM output that are not valid JSON. While this makes the parsing robust, it can make debugging difficult if the LLM consistently produces malformed output. Consider adding a log statement within the except block to record these errors for easier debugging.
| except json.JSONDecodeError: | |
| continue | |
| except json.JSONDecodeError: | |
| # Consider logging this error for easier debugging of LLM output. | |
| continue |
| class FoobarParams(BaseModel): | ||
| foobar: str | ||
|
|
||
| class GenerativeInterfaceExtensionSpec(BaseExtensionSpec[FoobarParams]): | ||
| URI: str = "https://a2a-extensions.agentstack.beeai.dev/services/generative_interface/v1" | ||
|
|
||
| @classmethod | ||
| def demand(cls) -> Self: | ||
| return cls(params=FoobarParams(foobar="xxx")) |
There was a problem hiding this comment.
The FoobarParams class and its use in GenerativeInterfaceExtensionSpec.demand appear to be placeholder code. The parameter foobar is hardcoded to "xxx" and doesn't seem to be used elsewhere. The corresponding TypeScript schema generativeInterfaceDemandsSchema defines an empty object for the demands. To improve clarity and remove prototype remnants, consider removing FoobarParams and simplifying the demand method if no parameters are actually needed.
| class FoobarParams(BaseModel): | |
| foobar: str | |
| class GenerativeInterfaceExtensionSpec(BaseExtensionSpec[FoobarParams]): | |
| URI: str = "https://a2a-extensions.agentstack.beeai.dev/services/generative_interface/v1" | |
| @classmethod | |
| def demand(cls) -> Self: | |
| return cls(params=FoobarParams(foobar="xxx")) | |
| class GenerativeInterfaceDemandParams(BaseModel): | |
| pass | |
| class GenerativeInterfaceExtensionSpec(BaseExtensionSpec[GenerativeInterfaceDemandParams]): | |
| URI: str = "https://a2a-extensions.agentstack.beeai.dev/services/generative_interface/v1" | |
| @classmethod | |
| def demand(cls) -> Self: | |
| return cls(params=GenerativeInterfaceDemandParams()) |
| fulfilledMetadata = fulfillFormDemand(fulfilledMetadata, await fulfillments.form(formDemands)); | ||
| } | ||
|
|
||
| console.log(generativeInterfaceDemands); |
| /** | ||
| * Copyright 2025 © BeeAI a Series of LF Projects, LLC | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| 'use client'; | ||
|
|
||
| import { Button as CarbonButton } from '@carbon/react'; | ||
| import type { ComponentProps, ComponentType } from 'react'; | ||
|
|
||
| export interface ButtonProps { | ||
| id: string; | ||
| label: string; | ||
| kind?: 'primary' | 'secondary' | 'tertiary'; | ||
| onInteraction?: (componentId: string, eventType: string, payload?: Record<string, unknown>) => void; | ||
| } | ||
|
|
||
| export const Button: ComponentType<ButtonProps> = ({ id, label, kind = 'primary', onInteraction }) => { | ||
| return ( | ||
| <CarbonButton | ||
| kind={kind as ComponentProps<typeof CarbonButton>['kind']} | ||
| size="md" | ||
| onClick={() => onInteraction?.(id, 'click')} | ||
| > | ||
| {label} | ||
| </CarbonButton> | ||
| ); | ||
| }; |
There was a problem hiding this comment.
This file, along with the components directory it resides in, seems to contain an alternative or unused implementation for UI components. The GenerativeInterfaceRenderer.tsx component defines its own components, including a Button, and does not use this implementation. To avoid confusion and code duplication, consider removing this dead code.
Summary
Linked Issues
Documentation
If this PR adds new feature or changes existing. Make sure documentation is adjusted accordingly. If the docs is not needed, please explain why.