Skip to content

Conversation

@wobsoriano
Copy link
Contributor

@wobsoriano wobsoriano commented Dec 5, 2025

🎯 Changes

This PR adds useChat() for Vue! The UI components will come in a separate PR.

βœ… Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

πŸš€ Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

@wobsoriano wobsoriano marked this pull request as ready for review December 5, 2025 01:23
export function useChat<TTools extends ReadonlyArray<AnyClientTool> = any>(
options: UseChatOptions<TTools> = {} as UseChatOptions<TTools>,
): UseChatReturn<TTools> {
const hookId = useId() // Available in Vue 3.5+
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we want to support Vue <3.5, we can use a random ID generator instead

Choose a reason for hiding this comment

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

I guess this should be fine unless someone explicitly asks. Upgrading 3.3 to 3.5 should not be a problem though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep! no problems here

@wobsoriano wobsoriano changed the title Add Vue support feat: Add Vue support Dec 5, 2025
@wobsoriano wobsoriano changed the title feat: Add Vue support feat: Add Vue useChat() support Dec 5, 2025
@nx-cloud
Copy link

nx-cloud bot commented Dec 5, 2025

View your CI Pipeline Execution β†— for commit b6ce347

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... βœ… Succeeded 1m 52s View β†—
nx run-many --targets=build --exclude=examples/** βœ… Succeeded 31s View β†—

☁️ Nx Cloud last updated this comment at 2025-12-05 18:03:24 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 5, 2025

Open in StackBlitz

@tanstack/ai

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai@84

@tanstack/ai-anthropic

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-anthropic@84

@tanstack/ai-client

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-client@84

@tanstack/ai-devtools-core

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-devtools-core@84

@tanstack/ai-gemini

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-gemini@84

@tanstack/ai-ollama

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-ollama@84

@tanstack/ai-openai

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-openai@84

@tanstack/ai-react

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-react@84

@tanstack/ai-react-ui

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-react-ui@84

@tanstack/ai-solid

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-solid@84

@tanstack/ai-solid-ui

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-solid-ui@84

@tanstack/ai-vue

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-vue@84

@tanstack/react-ai-devtools

npm i https://pkg.pr.new/TanStack/ai/@tanstack/react-ai-devtools@84

@tanstack/solid-ai-devtools

npm i https://pkg.pr.new/TanStack/ai/@tanstack/solid-ai-devtools@84

commit: b6ce347

@AlemTuzlak
Copy link
Contributor

@wobsoriano for the provenance issues I suggest copying the lock from main over to your branch and running pnpm install

export function useChat<TTools extends ReadonlyArray<AnyClientTool> = any>(
options: UseChatOptions<TTools> = {} as UseChatOptions<TTools>,
): UseChatReturn<TTools> {
const hookId = useId() // Available in Vue 3.5+

Choose a reason for hiding this comment

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

I guess this should be fine unless someone explicitly asks. Upgrading 3.3 to 3.5 should not be a problem though?

Copy link
Contributor

@AlemTuzlak AlemTuzlak left a comment

Choose a reason for hiding this comment

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

update provinence, package version and the getter and we're good to go!! thank you

@wobsoriano wobsoriano requested a review from AlemTuzlak December 5, 2025 16:08
@wobsoriano
Copy link
Contributor Author

update provinence, package version and the getter and we're good to go!! thank you

the provenance action is still failing after plenty of attempts checking out lockfile from main and reinstalling

@AlemTuzlak
Copy link
Contributor

Maybe it indeed loses provencence when installing some of the deps from vue? @lachlancollins mind checking it out?

@DamianOsipiuk
Copy link

Maybe it indeed loses provencence when installing some of the deps from vue? @lachlancollins mind checking it out?

Its due to:

abbrev: 3.0.1 -> 2.0.0 [provenance]

And it's transitive dep of vue test utils.
We might want to override it's version to v3 in pnpm

@AlemTuzlak AlemTuzlak merged commit 0bebb64 into TanStack:main Dec 5, 2025
5 checks passed
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.

3 participants