Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 1.1 KB

readme.md

File metadata and controls

25 lines (16 loc) · 1.1 KB

Use Langchain.js in Unity3D

This demo is based on PuerTS so we can use Node.js in Unity3D.

use langchain.js for fun.

UnityOrUnreal

I asked him Which one is better, Unity3D or Unreal Engine?

Example

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.

Do more in example

  • modify the code in Assets. And Assets/Typescripts is where your TS code is located.If you want to get the ts intellisense for 'langchain', run npm install in Puer-Project.

  • if you want to add more node_modules.

    1. run npm install in Puer-Project first.
    2. add a js in Puer-Project/src-for-puer. It import some modules in node_modules and export it.
    3. add a config in Puer-Project/webpack.config.js just like langchain/llvm
    4. run npx webpack -c webpack.config.js
    5. import it in Assets/Typescripts