Skip to content

feat: add analytics demo example - #344

Closed
AbhinRustagi wants to merge 7 commits into
thesysdev:mainfrom
AbhinRustagi:feat/analytics-demo
Closed

feat: add analytics demo example#344
AbhinRustagi wants to merge 7 commits into
thesysdev:mainfrom
AbhinRustagi:feat/analytics-demo

Conversation

@AbhinRustagi

@AbhinRustagi AbhinRustagi commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Closes #300

Summary

  • Adds examples/analytics-demo, a conversational analytics chat app showcasing OpenUI's chart, table, and metric card components
  • Uses Google Gemini SDK (@google/genai) with streaming and manual tool-call loop
  • Includes 4 mock analytics tools (query_revenue, query_sales, query_metrics, query_customers) with built-in sample data — works out of the box with no external data source
  • Follows the same structure as examples/openui-chat

Test plan

  • Set GEMINI_API_KEY in .env.local and run pnpm dev from examples/analytics-demo
  • Verify conversation starters render and clicking them produces streamed analytics UI (charts, tables, metric cards)
  • Try multi-turn queries (e.g., "Show me revenue trends" → "Now compare by region")
  • Confirm pnpm -r run build passes for all workspace packages

🤖 Generated with Claude Code

Example Screenshot:

Screenshot 2026-03-16 at 14-40-49 Analytics Demo

AbhinRustagi and others added 2 commits March 16, 2026 14:38
Adds a conversational analytics chat app in examples/analytics-demo
that showcases OpenUI's chart, table, and metric card components.
Uses Google Gemini SDK with mock analytics tools (revenue, sales,
metrics, customers) and built-in sample data.

Closes thesysdev#300

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds documentation for the analytics-demo example to the OpenUI Lang
examples section, covering architecture, setup, key files, tools table,
and system prompt generation. Includes a video placeholder.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread docs/content/docs/openui-lang/examples/analytics-demo.mdx Outdated
Comment thread examples/analytics-demo/src/app/api/chat/route.ts Outdated
@AbhinRustagi

Copy link
Copy Markdown
Contributor Author

@ankit-thesys, I haven't been able to test this; it is modeled on the openui-chat example. I don't yet have an API key for OpenAI. Will perhaps need your help, or if you can allow another day.

@zahlekhan

zahlekhan commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

https://ai.google.dev/gemini-api/docs/openai
@AbhinRustagi you can use Gemini with OpenAI SDK

@AbhinRustagi

Copy link
Copy Markdown
Contributor Author

thanks @zahlekhan for this

@ankit-thesys

Copy link
Copy Markdown
Contributor

I will test it once i am little free 😄

@AbhinRustagi

AbhinRustagi commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author

Thank you @ankit-thesys

@zahlekhan I tried using Gemini with the OpenAI SDK, in my exploration, the tool calling does not work well yet with Gemini. Gemini's streaming endpoint sends the tool calling chunks as a single completed chunk, but OpenAI SDK runTools() expects a stream of chunks because of which the accumulator loses the tool calls. I was able to write a custom tool calling loop. Do you think adding that for this project would be overkill? But happy to push it to help add it and document it since it might help someone. Would also be happy to hear if you've any experience/inputs with that

@zahlekhan

Copy link
Copy Markdown
Contributor

Not needed, let ankit test it out this time.

@ankit-thesys

Copy link
Copy Markdown
Contributor

Hi! First of all, thank you for putting in the effort to create the analytical demo — we really appreciate the time and thought you invested in it.

With the upcoming 0.5 release of reactlang, we’re planning to introduce a dedicated dashboard demo focused on demonstrating data fetching and refresh workflows, which will also cover analytics-related use cases more comprehensively.

Because of that direction, we won’t be moving forward with this at the moment. That said, we truly appreciate the contribution and the ideas behind it — it helped us think more clearly about how we want to approach this area going forward. We hope you’ll continue contributing and sharing ideas with us!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Analytics Demo

3 participants