SDK Introduction

WARNING

Available for version 3.1.8 and above

Based on JSON-RPC and WebSocket technology, providing a nearly consistent development experience across different programming languages

Official SDK provides technical support for Lua, Python, JavaScript, Rust, C++, with more programming languages being integrated...

TIP

This documentation uses Lua and Python programming as examples to introduce the usage of each interface. Other languages (JavaScript/Rust/C++) SDKs are nearly identical and can be directly referenced.

TIP

Example code blocks in this documentation with "Lua / Python" labels can be switched between the two programming languages' syntax. Selection results will be remembered for your convenience when reading examples in your familiar language.

Lua

The scene code editor on the web frontend has a built-in lebai_sdk and has initialized the local instance to the variable name lebai, which can be used directly.

Python

WARNING

Only supports Python 3.7 and above

  • If using the standard calling method, install lebai-sdk:

    pip uninstall lebai-sdk-asyncio
    pip install lebai-sdk --force-reinstall
    
  • If using the asynchronous coroutine calling method, i.e., AsyncIO and async/await, install lebai-sdk-asyncio:

    pip uninstall lebai-sdk
    pip install lebai-sdk-asyncio --force-reinstall
    

For other language installation methods, see Installing and Using SDK.