Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs(ai-vue): add docs for ai-vue#126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
wan-kong wants to merge2 commits intoTanStack:main
base:main
Choose a base branch
Loading
fromwan-kong:doc/vue-example

Conversation

@wan-kong
Copy link

🎯 Changes

✅ Checklist

  • I have followed the steps in theContributing guide.
  • I have tested this code locally withpnpm run test:pr.

🚀 Release Impact

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

add docs for@tanstack/ai-vue

<div v-for="part in message.parts" :key="part.id">
<span v-if="part.type === 'text'">{{ part.content }}</span>
<div v-else-if="part.type === 'thinking'">
<div class="text-sm text-gray-500 italic">💭 Thinking: {{ part.content }}</div>

Choose a reason for hiding this comment

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

This could potentially be merged with wrapper div

const handleSubmit = (e: Event) => {
const val = input.value.trim()
if (((val ?? '') !== '') && !isLoading) {
sendMessage(input.value);

Choose a reason for hiding this comment

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

I guess we would neede.target.reset() as well to clear the form on submit.

const notification = ref<string | null>(null);

// Create client tool implementations,
const updateUI = updateUIDef.client((input) => {

Choose a reason for hiding this comment

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

Not sure what is the purpose of this tool. Maybe it makes sense inReact to set state causing are-render, but inVue it would do nothing asnotification ref is not used anywhere.

@AlemTuzlak Was originalReact intention just to cause a re-render?

createChatClientOptions,
type InferChatMessages
} from "@tanstack/ai-client";
import { updateUIDef } from "@/tools/definitions";

Choose a reason for hiding this comment

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

This tool def seems to be buried in one of the other pages, maybe in-lining it would be wise?
Or at least a link to this tool definition?
@AlemTuzlak


```typescript
interface UseChatReturn {
messages: UIMessage[];

Choose a reason for hiding this comment

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

This is actually aDeepReadonly<ShallowRef<Array<UIMessage>>>

}) => Promise<void>;
reload: () => Promise<void>;
stop: () => void;
isLoading: boolean;

Choose a reason for hiding this comment

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

isLoading: DeepReadonly<ShallowRef<boolean>>

reload: () => Promise<void>;
stop: () => void;
isLoading: boolean;
error: Error | undefined;

Choose a reason for hiding this comment

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

error: DeepReadonly<ShallowRef<Error | undefined>>

} from "@tanstack/ai-client";
import { updateUIDef, saveToStorageDef } from "@/tools/definitions";

const notification = ref<{message: string; type: 'success' | 'error'}>(null);

Choose a reason for hiding this comment

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

Not sure what fornotification is used in this example

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

Reviewers

1 more reviewer

@DamianOsipiukDamianOsipiukDamianOsipiuk left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@wan-kong@DamianOsipiuk

[8]ページ先頭

©2009-2025 Movatter.jp