Using vercel AI package

So, I was trying put the vercel npm ai package and I built the basic example chat app and so I would like to take that chat and put it inside a needle/unity object. I don’t know how to approach this since the chat app comes with its own server.ts file and at the end idk if I could export everything for it to be able to be imported in needle through the unity gui.

Original Post on Discord

by user 483253293477265409

Changed the channel name: Using vercel AI package

Please give posts a more descriptive name :slightly_smiling_face:

We have a basic sample for sveltekit + needle engine on a branch right now:

Let me know if that helps you getting started

I just tried that samples branch and the sveltekit one told me to generate project unlike the svelte one that told me to just install. Once I opened the workspace of the skit one it was like a brand new needle project, no files were on the src folder. I tried the svelte one and there was a bunch of .svelte files inside the src folder

by user 483253293477265409

I get this log error

by user 483253293477265409

I think the Unity path didnt point to the sveltekit project. The file I sent you has a sample for how to embed the web component. With that you can just set the src attribute <needle-engine src="..." to point to your glb exported from Unity.

cc @herbst🌵

Sorry for that, can fix when I’m back

I got that sorted out, now what I’m seeing in the sample is that there is another app (my-app) built on top of the needle base project, is that correct?

by user 483253293477265409

by user 483253293477265409

That’s why it’s still on a branch, it’s not cleaned up as usable sample right now - the my-app project is an independent standalone sveltekit test, you can delete that

but if I delete that then the sample is just an empty needle project, or am I missing something?

by user 483253293477265409

I’ll double check once back at a machine

Any updates on this?

by user 483253293477265409

Hey :wave: H is on vacation, it might take a week or so.

He’ll specify if i’m wrong, but that would be my guess (roughly a week) :slight_smile:

Oh ok, didn’t know that sorry

by user 483253293477265409

Don’t worry, hope it doesn’t stall you :cactus: