Skip to content

feat(sdk): add basic chat ui example#2064

Merged
PetrBulanek merged 2 commits intomainfrom
sdk/ui-chat-example
Feb 13, 2026
Merged

feat(sdk): add basic chat ui example#2064
PetrBulanek merged 2 commits intomainfrom
sdk/ui-chat-example

Conversation

@PetrBulanek
Copy link
Contributor

Summary

Add basic chat ui example of how the client SDK can be used to build custom ui.

Linked Issues

Closes: #1749

Documentation

  • No Docs Needed:

If this PR adds new feature or changes existing. Make sure documentation is adjusted accordingly. If the docs is not needed, please explain why.

@PetrBulanek PetrBulanek requested review from kapetr and tomkis February 10, 2026 13:40
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Feb 10, 2026
@PetrBulanek PetrBulanek changed the title Sdk/UI chat example feat(sdk): add basic chat ui example Feb 10, 2026
@PetrBulanek
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a basic chat UI example, which is a great addition to demonstrate the SDK's capabilities. The implementation is solid, using modern React features and good practices for state management and asynchronous operations. I've identified a few areas for improvement, mainly concerning security best practices with permissions and a couple of minor code refinements for better correctness and maintainability. Overall, it's a well-structured example.

Comment on lines +37 to +51
async function createClient(contextToken: ContextToken) {
const fetchImpl = createAuthenticatedFetch(contextToken.token);

const factory = new ClientFactory(
ClientFactoryOptions.createFrom(ClientFactoryOptions.default, {
transports: [new JsonRpcTransportFactory({ fetchImpl })],
cardResolver: new DefaultAgentCardResolver({ fetchImpl }),
}),
);

const agentCardPath = getAgentCardPath(PROVIDER_ID);
const client = await factory.createFromUrl(BASE_URL, agentCardPath);

return client;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it would make sense to create an abstraction for this in our sdk?

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 10, 2026
@@ -0,0 +1,31 @@
/**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add documentation page where you link this example as well as some description and overall page descirbing what you had to do etc.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@jenna-winkler what's your take on this.

I was hoping we would squeze whole workign example in the docs itself, but that would make the page extremly long.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes let’s do a docs page - a guide on approach to building and link to example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a new Custom UI Architecture Guide page to docs. I'd appreciate any feedback.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @PetrBulanek ! @sandijean90 can you please review ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks great @PetrBulanek

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’m merging this so we can include it in the RC release.

@sandijean90 If you have any comments or concerns, please open a follow-up issue and I can address them there.

Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

@PetrBulanek @jenna-winkler thanks! I will take a look today/early next week at the whole Client SDk docs section as I need to familiarize myself before making comments/edits.

@dosubot dosubot bot removed the lgtm This PR has been approved by a maintainer label Feb 12, 2026
Signed-off-by: Petr Bulánek <bulanek.petr@gmail.com>
Signed-off-by: Petr Bulánek <bulanek.petr@gmail.com>
@jenna-winkler jenna-winkler requested review from sandijean90 and removed request for jenna-winkler February 12, 2026 15:47
@@ -0,0 +1,31 @@
/**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks great @PetrBulanek

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 13, 2026
@PetrBulanek PetrBulanek merged commit 881cbb7 into main Feb 13, 2026
8 checks passed
@PetrBulanek PetrBulanek deleted the sdk/ui-chat-example branch February 13, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Create example of how Client SDK can be used

5 participants