mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-30 04:15:45 +08:00
doc: add file-typed config field get data api
This commit is contained in:
@@ -297,4 +297,16 @@ async def delete_workspace_storage(self, key: str) -> None:
|
||||
|
||||
# Usage example
|
||||
await self.plugin.delete_workspace_storage("key")
|
||||
```
|
||||
```
|
||||
|
||||
### Get Plugin File-typed Config Field Data
|
||||
|
||||
```python
|
||||
async def get_config_file(self, file_key: str) -> bytes:
|
||||
"""Get a config file value"""
|
||||
|
||||
# Usage example
|
||||
file_bytes = await self.plugin.get_config_file("key")
|
||||
```
|
||||
|
||||
Use this in conjunction with configuration fields of type [`file` or `array[file`](/en/plugin/dev/basic-info.html#type-file).
|
||||
|
||||
@@ -297,4 +297,16 @@ async def delete_workspace_storage(self, key: str) -> None:
|
||||
|
||||
# 调用示例
|
||||
await self.plugin.delete_workspace_storage("key")
|
||||
```
|
||||
```
|
||||
|
||||
### 获取插件配置项文件数据
|
||||
|
||||
```python
|
||||
async def get_config_file(self, file_key: str) -> bytes:
|
||||
"""Get a config file value"""
|
||||
|
||||
# 调用示例
|
||||
file_bytes = await self.plugin.get_config_file("key")
|
||||
```
|
||||
|
||||
请结合 [`file` 或 `array[file]` 类型配置项](/zh/plugin/dev/basic-info.html#type-file)使用。
|
||||
Reference in New Issue
Block a user