feat(apollo-vertex): switch ai chat to tanstack ai [AGVSOL-1682]#343
feat(apollo-vertex): switch ai chat to tanstack ai [AGVSOL-1682]#343pieman1313 wants to merge 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
Adds UiPath AgentHub-backed LLM providers to the apollo-vertex AI Chat utilities, restructuring provider code under an agenthub/ namespace and documenting usage for both OpenAI and Anthropic models.
Changes:
- Introduces AgentHub provider implementations:
OpenAIProvider(OpenAI-compatible endpoint) andAnthropicProvider(normalized Anthropic endpoint). - Refactors shared request/stream helpers into
agenthub/utils(buildBaseMessages,readAIStream). - Updates docs, templates, and registry mappings to the new provider paths.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/apollo-vertex/templates/AiChatTemplate.tsx | Switches demo import/usage to OpenAIProvider. |
| apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/utils/agenthub-stream.ts | Renames/centralizes SSE streaming reader as readAIStream. |
| apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/utils/agenthub-messages.ts | Introduces shared BaseMessage + buildBaseMessages. |
| apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/openai/openai-provider.ts | Implements AgentHub OpenAI-compatible provider using shared helpers. |
| apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/openai/openai-messages.ts | Adds OpenAI-native tool definition builder. |
| apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/anthropic/anthropic-provider.ts | Adds AgentHub normalized Anthropic provider. |
| apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/anthropic/anthropic-messages.ts | Adds BaseMessage→Anthropic conversion + Anthropic tool definitions. |
| apps/apollo-vertex/registry/ai-chat/utils/ai-chat-types.ts | Updates barrel exports to include new providers/configs. |
| apps/apollo-vertex/registry.json | Updates registry file mappings to new provider locations (+ minor formatting change). |
| apps/apollo-vertex/app/vertex-components/ai-chat/page.mdx | Updates documentation and examples for AgentHub providers. |
apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/anthropic/anthropic-messages.ts
Outdated
Show resolved
Hide resolved
cb394ae to
52d4503
Compare
0xr3ngar
left a comment
There was a problem hiding this comment.
talking in a slack thread
apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/anthropic/anthropic-messages.ts
Outdated
Show resolved
Hide resolved
52d4503 to
76ccf97
Compare
There was a problem hiding this comment.
Pull request overview
Introduces a unified AgentHubProvider for the Apollo Vertex AI Chat, routing all LLM interactions through UiPath AgentHub’s normalized endpoint and updating the demo, registry mapping, and documentation accordingly.
Changes:
- Replaced the OpenAI-specific provider with a new unified
AgentHubProvider(supports OpenAI + Anthropic wire formats viamodel.vendor). - Added AgentHub message serialization and OpenAI-compatible SSE stream reader utilities; removed the old OpenAI provider implementation.
- Updated exports (
ai-chat-types), registry wiring, and the AI Chat docs to reflect the new provider.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/apollo-vertex/templates/AiChatTemplate.tsx | Swaps the demo to use AgentHubProvider and the { vendor, name } model config. |
| apps/apollo-vertex/registry/ai-chat/utils/providers/openai/openai-provider.ts | Removes the OpenAI-specific provider implementation. |
| apps/apollo-vertex/registry/ai-chat/utils/providers/openai/openai-messages.ts | Removes OpenAI-specific message/tool-definition builders. |
| apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/agenthub-provider.ts | Adds the unified AgentHub provider that hits /chat/completions and streams responses. |
| apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/agenthub-messages.ts | Adds normalized message + tool-definition builders, including Anthropic-specific constraints. |
| apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/agenthub-stream.ts | Renames/generalizes the SSE reader to readAIStream and broadens data: parsing. |
| apps/apollo-vertex/registry/ai-chat/utils/ai-chat-types.ts | Re-exports AgentHub provider/types for consumers; removes OpenAI provider exports. |
| apps/apollo-vertex/registry.json | Updates the registry wiring to include the new AgentHub provider files instead of OpenAI ones. |
| apps/apollo-vertex/app/vertex-components/ai-chat/page.mdx | Updates documentation and examples to use AgentHubProvider and AgentHub base URL. |
Comments suppressed due to low confidence (1)
apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/agenthub-stream.ts:55
- In this function there is an
// eslint-disable-next-line no-await-in-loopdirective a couple of lines below this block that does not include a justification suffix. Withunicorn/no-abusive-eslint-disableenabled for this app, the disable comment should include a reason (e.g.-- streaming reader loop) or be refactored away; otherwisepnpm lintis likely to fail.
apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/agenthub-provider.ts
Outdated
Show resolved
Hide resolved
76ccf97 to
3a5acd2
Compare
apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/agenthub-provider.ts
Outdated
Show resolved
Hide resolved
apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/agenthub-provider.ts
Outdated
Show resolved
Hide resolved
apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/agenthub-provider.ts
Outdated
Show resolved
Hide resolved
apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/agenthub-provider.ts
Outdated
Show resolved
Hide resolved
apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/agenthub-messages.ts
Outdated
Show resolved
Hide resolved
apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/agenthub-messages.ts
Outdated
Show resolved
Hide resolved
apps/apollo-vertex/registry/ai-chat/utils/providers/agenthub/agenthub-messages.ts
Outdated
Show resolved
Hide resolved
apps/apollo-vertex/registry/ai-chat/utils/providers/openai/openai-stream.ts
Show resolved
Hide resolved
3a5acd2 to
743882e
Compare
Dependency License Review
License distribution
Excluded packages
|
There was a problem hiding this comment.
Pull request overview
This PR migrates the apollo-vertex AI Chat UI to TanStack AI message types and introduces an AgentHub connection adapter that supports both OpenAI and Anthropic models via UiPath’s normalized LLM gateway.
Changes:
- Add TanStack AI dependencies and refactor the chat UI to accept
UIMessage[]plus typed display tool renderers. - Introduce an AgentHub adapter (message normalization + SSE stream → AG-UI
StreamChunkmapping). - Remove the legacy OpenAI-compatible provider/tool-loop implementation and update registry metadata + docs accordingly.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Locks newly added TanStack AI dependencies. |
| apps/apollo-vertex/package.json | Adds @tanstack/ai, @tanstack/ai-client, @tanstack/ai-react. |
| apps/apollo-vertex/templates/AiChatTemplate.tsx | Updates demo template to use UIMessage mocks instead of the removed custom hook/provider. |
| apps/apollo-vertex/registry/ai-chat/utils/ai-chat-utils.ts | Updates grouping + “choices” extraction to work on TanStack UIMessage parts. |
| apps/apollo-vertex/registry/ai-chat/types.ts | Adds typed display-tool renderer helpers (toolRenderer, buildToolRenderers). |
| apps/apollo-vertex/registry/ai-chat/components/ai-chat.tsx | Switches component props from internal ChatMessage/tools to UIMessage/toolRenderers. |
| apps/apollo-vertex/registry/ai-chat/components/ai-chat-message.tsx | Renders TanStack TextPart + tool-call parts and inline display tools. |
| apps/apollo-vertex/registry/ai-chat/components/ai-chat-suggestions.tsx | Updates imports for suggestion option types. |
| apps/apollo-vertex/registry/ai-chat/components/ai-chat-tool-group.tsx | Updates tool call rendering to TanStack ToolCallPart shape. |
| apps/apollo-vertex/registry/ai-chat/components/ai-chat-tool-group-message.tsx | Updates tool grouping message to TanStack tool-call fields. |
| apps/apollo-vertex/registry/ai-chat/adapters/agenthub/types.ts | Defines AgentHub adapter config (vendor/model/tools). |
| apps/apollo-vertex/registry/ai-chat/adapters/agenthub/tools.ts | Builds vendor-specific tool definitions for the AgentHub request payload. |
| apps/apollo-vertex/registry/ai-chat/adapters/agenthub/sse.ts | Adds a simple OpenAI-style SSE data: JSON parser. |
| apps/apollo-vertex/registry/ai-chat/adapters/agenthub/messages.ts | Converts UIMessage[] into AgentHub “normalized” wire messages (including tool calls/results). |
| apps/apollo-vertex/registry/ai-chat/adapters/agenthub/stream.ts | Fetches /chat/completions and maps SSE deltas into AG-UI StreamChunk events. |
| apps/apollo-vertex/registry/ai-chat/adapters/agenthub/adapter.ts | Provides a TanStack-AI-friendly stream factory wrapper around the AgentHub fetcher. |
| apps/apollo-vertex/registry.json | Updates registry entry: new deps + new file list (AgentHub adapter + types), removes legacy provider/hook files. |
| apps/apollo-vertex/app/vertex-components/ai-chat/page.mdx | Updates docs to TanStack AI + AgentHub adapter usage and new display-tool renderer pattern. |
| apps/apollo-vertex/registry/ai-chat/utils/providers/openai/openai-stream.ts | Removes legacy OpenAI SSE stream reader. |
| apps/apollo-vertex/registry/ai-chat/utils/providers/openai/openai-provider.ts | Removes legacy OpenAI provider implementation. |
| apps/apollo-vertex/registry/ai-chat/utils/providers/openai/openai-messages.ts | Removes legacy internal → OpenAI message/tool-definition conversion. |
| apps/apollo-vertex/registry/ai-chat/utils/ai-chat-types.ts | Removes legacy AI chat public type surface tied to the old provider/hook. |
| apps/apollo-vertex/registry/ai-chat/utils/ai-chat-tool-types.ts | Removes legacy tool typing model (execute/display) tied to the removed loop. |
| apps/apollo-vertex/registry/ai-chat/utils/ai-chat-provider.ts | Removes legacy LLMProvider interface. |
| apps/apollo-vertex/registry/ai-chat/utils/ai-chat-message-types.ts | Removes legacy internal message/part types. |
| apps/apollo-vertex/registry/ai-chat/utils/ai-chat-loop.ts | Removes legacy agentic tool-loop implementation. |
| apps/apollo-vertex/registry/ai-chat/utils/ai-chat-api.ts | Removes legacy helpers (token resolve + executeToolCall). |
| apps/apollo-vertex/registry/ai-chat/hooks/use-ai-chat.ts | Removes legacy useAiChat hook in favor of TanStack useChat. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
apps/apollo-vertex/registry/ai-chat/adapters/agenthub/adapter.ts
Outdated
Show resolved
Hide resolved
f67b80f to
5baadbe
Compare
apps/apollo-vertex/registry/ai-chat/adapters/agenthub/adapter.ts
Outdated
Show resolved
Hide resolved
1714898 to
91626b4
Compare
apps/apollo-vertex/registry/ai-chat/adapters/agenthub/adapter.ts
Outdated
Show resolved
Hide resolved
91626b4 to
481ce17
Compare
481ce17 to
0aea5d4
Compare
0aea5d4 to
1540179
Compare
1540179 to
11123e4
Compare
alincadariu
left a comment
There was a problem hiding this comment.
found two things when testing it in IP vertical:
- stop button doesn't actually stop the llm
- if I scroll up while the llm is writing it will auto-scroll to bottom (I'd expect the llm to keep writing and me scrolling up as I wish)
11123e4 to
fe10d6e
Compare
fe10d6e to
8d1290c
Compare
I will address these and a bunch more in the next pr where we integrate this to talk to an actual llm to make things easier to test out |
can be tested e2e here feat/ai-chat-anthropic