Elements
Q: Can I add customized elements into workspace?
A: No, customized elements is not supported currently.
Q: How to persist data?
A: You can use following elements to persist data:
-
Database: to save key-value data.
-
Storage: to save objects such as images, music, movies.
You can also use any third party npm packages to save data to external targets.
Q: How to leverage LLMs in my applications?
A: You can use element LLMExecutor to call LLMs. In most cases, it is more convenient than calling by SDK or HTTP. If you don't have OpenAI key, you can use built-in provider of LLMExecutor. Please note the build-in provider is for testing purpose only.
Q: How to backup persisted data?
A: The backup feature of Database, Storage and VectorStore is under construction. Please contact us if you need this feature.
Q: How to use npm packages?
A: Navigate to "Dependencies" in your workspace, add the necessary packages, and then you'll be able to import them into your code.
Q: How to manage configurations such as keys?
A: Click "Config" in your workspace. Add configs you need and then import Config from "#config"
in your code.
Q: How to build a backend API?
A: You need a HTTP element, choose the request method such as POST, GET and input your path such as "/hello", then it's ready for calling.
Q: How to build a scheduled job?
A: Use element Worker as cron job.
Q: How to build a frontend project?
A: You can use client side render(CSR) or server side render(SSR):
-
CSR: Add an Assets element to your babel and name the element as "Public". Put your frontend static files in to the element and these files can be accessed through url directly, such as "mybabel.babel.run/index.html", "mybabel.babel.run/render.js", "mybabel.babel.run/style.css".
-
SSR: The pages are rendered at backend in HTTP elements. You can use ejs or any template engines you like. The urls to the pages are defined by HTTP element path.
Please note that React/Vue is not supported directly. If you are using such technologies, you need to compile your code into html/js/css first and put the compiled files to babel application.