This demo is based on PuerTS so we can use Node.js in Unity3D.
use langchain.js
for fun.
I asked him
Which one is better, Unity3D or Unreal Engine?
Sample code is in Assets/Scenes/Langchain.cs
, and it Execute Assets/Typescripts/langchain-test.mts
.
Make sure you fill the OpenAI API key in Assets/Typescripts/langchain-test.mts
first.
-
modify the code in
Assets
. AndAssets/Typescripts
is where your TS code is located.If you want to get the ts intellisense for 'langchain', runnpm install
inPuer-Project
. -
if you want to add more node_modules.
- run
npm install
inPuer-Project
first. - add a js in
Puer-Project/src-for-puer
. It import some modules in node_modules and export it. - add a config in
Puer-Project/webpack.config.js
just likelangchain/llvm
- run
npx webpack -c webpack.config.js
- import it in
Assets/Typescripts
- run