Add /site API (#19631)

This commit is contained in:
lexmin0412 2025-05-14 10:43:36 +08:00 committed by GitHub
parent 3c953cb0ef
commit ff20b56074
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 740 additions and 3 deletions

View File

@ -1,5 +1,7 @@
from flask_restful import fields
from libs.helper import AppIconUrlField
parameters__system_parameters = {
"image_file_size_limit": fields.Integer,
"video_file_size_limit": fields.Integer,
@ -22,3 +24,20 @@ parameters_fields = {
"file_upload": fields.Raw,
"system_parameters": fields.Nested(parameters__system_parameters),
}
site_fields = {
"title": fields.String,
"chat_color_theme": fields.String,
"chat_color_theme_inverted": fields.Boolean,
"icon_type": fields.String,
"icon": fields.String,
"icon_background": fields.String,
"icon_url": AppIconUrlField,
"description": fields.String,
"copyright": fields.String,
"privacy_policy": fields.String,
"custom_disclaimer": fields.String,
"default_language": fields.String,
"show_workflow_steps": fields.Boolean,
"use_icon_as_answer_icon": fields.Boolean,
}

View File

@ -6,6 +6,6 @@ bp = Blueprint("service_api", __name__, url_prefix="/v1")
api = ExternalApi(bp)
from . import index
from .app import annotation, app, audio, completion, conversation, file, message, workflow
from .app import annotation, app, audio, completion, conversation, file, message, site, workflow
from .dataset import dataset, document, hit_testing, metadata, segment, upload_file
from .workspace import models

View File

@ -0,0 +1,30 @@
from flask_restful import Resource, marshal_with
from werkzeug.exceptions import Forbidden
from controllers.common import fields
from controllers.service_api import api
from controllers.service_api.wraps import validate_app_token
from extensions.ext_database import db
from models.account import TenantStatus
from models.model import App, Site
class AppSiteApi(Resource):
"""Resource for app sites."""
@validate_app_token
@marshal_with(fields.site_fields)
def get(self, app_model: App):
"""Retrieve app site info."""
site = db.session.query(Site).filter(Site.app_id == app_model.id).first()
if not site:
raise Forbidden()
if app_model.tenant.status == TenantStatus.ARCHIVE:
raise Forbidden()
return site
api.add_resource(AppSiteApi, "/site")

View File

@ -647,3 +647,62 @@ The text generation application offers non-session support and is ideal for tran
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/site'
method='GET'
title='Get Application WebApp Settings'
name='#site'
/>
<Row>
<Col>
Used to get the WebApp settings of the application.
### Response
- `title` (string) WebApp name
- `chat_color_theme` (string) Chat color theme, in hex format
- `chat_color_theme_inverted` (bool) Whether the chat color theme is inverted
- `icon_type` (string) Icon type, `emoji` - emoji, `image` - picture
- `icon` (string) Icon. If it's `emoji` type, it's an emoji symbol; if it's `image` type, it's an image URL.
- `icon_background` (string) Background color in hex format
- `icon_url` (string) Icon URL
- `description` (string) Description
- `copyright` (string) Copyright information
- `privacy_policy` (string) Privacy policy link
- `custom_disclaimer` (string) Custom disclaimer
- `default_language` (string) Default language
- `show_workflow_steps` (bool) Whether to show workflow details
- `use_icon_as_answer_icon` (bool) Whether to replace 🤖 in chat with the WebApp icon
</Col>
<Col>
<CodeGroup title="Request" tag="POST" label="/meta" targetCode={`curl -X GET '${props.appDetail.api_base_url}/site' \\\n-H 'Authorization: Bearer {api_key}'`}>
```bash {{ title: 'cURL' }}
curl -X GET '${props.appDetail.api_base_url}/site' \
-H 'Authorization: Bearer {api_key}'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"title": "My App",
"chat_color_theme": "#ff4a4a",
"chat_color_theme_inverted": false,
"icon_type": "emoji",
"icon": "😄",
"icon_background": "#FFEAD5",
"icon_url": null,
"description": "This is my app.",
"copyright": "all rights reserved",
"privacy_policy": "",
"custom_disclaimer": "All generated by AI",
"default_language": "en-US",
"show_workflow_steps": false,
"use_icon_as_answer_icon": false,
}
```
</CodeGroup>
</Col>
</Row>
___

View File

@ -645,3 +645,62 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/site'
method='GET'
title='アプリのWebApp設定を取得'
name='#site'
/>
<Row>
<Col>
アプリのWebApp設定を取得するために使用します。
### レスポンス
- `title` (string) WebApp名
- `chat_color_theme` (string) チャットの色テーマ、16進数形式
- `chat_color_theme_inverted` (bool) チャットの色テーマを反転するかどうか
- `icon_type` (string) アイコンタイプ、`emoji`-絵文字、`image`-画像
- `icon` (string) アイコン。`emoji`タイプの場合は絵文字、`image`タイプの場合は画像URL
- `icon_background` (string) 16進数形式の背景色
- `icon_url` (string) アイコンのURL
- `description` (string) 説明
- `copyright` (string) 著作権情報
- `privacy_policy` (string) プライバシーポリシーのリンク
- `custom_disclaimer` (string) カスタム免責事項
- `default_language` (string) デフォルト言語
- `show_workflow_steps` (bool) ワークフローの詳細を表示するかどうか
- `use_icon_as_answer_icon` (bool) WebAppのアイコンをチャット内の🤖に置き換えるかどうか
</Col>
<Col>
<CodeGroup title="Request" tag="POST" label="/meta" targetCode={`curl -X GET '${props.appDetail.api_base_url}/site' \\\n-H 'Authorization: Bearer {api_key}'`}>
```bash {{ title: 'cURL' }}
curl -X GET '${props.appDetail.api_base_url}/site' \
-H 'Authorization: Bearer {api_key}'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"title": "My App",
"chat_color_theme": "#ff4a4a",
"chat_color_theme_inverted": false,
"icon_type": "emoji",
"icon": "😄",
"icon_background": "#FFEAD5",
"icon_url": null,
"description": "This is my app.",
"copyright": "all rights reserved",
"privacy_policy": "",
"custom_disclaimer": "All generated by AI",
"default_language": "en-US",
"show_workflow_steps": false,
"use_icon_as_answer_icon": false,
}
```
</CodeGroup>
</Col>
</Row>
___

View File

@ -507,7 +507,6 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</CodeGroup>
</Col>
</Row>
---
<Heading
@ -612,6 +611,64 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Row>
---
<Heading
url='/site'
method='GET'
title='获取应用 WebApp 设置'
name='#site'
/>
<Row>
<Col>
用于获取应用的 WebApp 设置
### Response
- `title` (string) WebApp 名称
- `chat_color_theme` (string) 聊天颜色主题, hex 格式
- `chat_color_theme_inverted` (bool) 聊天颜色主题是否反转
- `icon_type` (string) 图标类型, `emoji`-表情, `image`-图片
- `icon` (string) 图标, 如果是 `emoji` 类型, 则是 emoji 表情符号, 如果是 `image` 类型, 则是图片 URL
- `icon_background` (string) hex 格式的背景色
- `icon_url` (string) 图标 URL
- `description` (string) 描述
- `copyright` (string) 版权信息
- `privacy_policy` (string) 隐私政策链接
- `custom_disclaimer` (string) 自定义免责声明
- `default_language` (string) 默认语言
- `show_workflow_steps` (bool) 是否显示工作流详情
- `use_icon_as_answer_icon` (bool) 是否使用 WebApp 图标替换聊天中的 🤖
</Col>
<Col>
<CodeGroup title="Request" tag="POST" label="/meta" targetCode={`curl -X GET '${props.appDetail.api_base_url}/site' \\\n-H 'Authorization: Bearer {api_key}'`}>
```bash {{ title: 'cURL' }}
curl -X GET '${props.appDetail.api_base_url}/site' \
-H 'Authorization: Bearer {api_key}'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"title": "My App",
"chat_color_theme": "#ff4a4a",
"chat_color_theme_inverted": false,
"icon_type": "emoji",
"icon": "😄",
"icon_background": "#FFEAD5",
"icon_url": null,
"description": "This is my app.",
"copyright": "all rights reserved",
"privacy_policy": "",
"custom_disclaimer": "All generated by AI",
"default_language": "en-US",
"show_workflow_steps": false,
"use_icon_as_answer_icon": false,
}
```
</CodeGroup>
</Col>
</Row>
___
<Heading
url='/apps/annotations'
method='GET'

View File

@ -1305,6 +1305,64 @@ Chat applications support session persistence, allowing previous chat history to
</Row>
---
<Heading
url='/site'
method='GET'
title='Get Application WebApp Settings'
name='#site'
/>
<Row>
<Col>
Used to get the WebApp settings of the application.
### Response
- `title` (string) WebApp name
- `chat_color_theme` (string) Chat color theme, in hex format
- `chat_color_theme_inverted` (bool) Whether the chat color theme is inverted
- `icon_type` (string) Icon type, `emoji` - emoji, `image` - picture
- `icon` (string) Icon. If it's `emoji` type, it's an emoji symbol; if it's `image` type, it's an image URL
- `icon_background` (string) Background color in hex format
- `icon_url` (string) Icon URL
- `description` (string) Description
- `copyright` (string) Copyright information
- `privacy_policy` (string) Privacy policy link
- `custom_disclaimer` (string) Custom disclaimer
- `default_language` (string) Default language
- `show_workflow_steps` (bool) Whether to show workflow details
- `use_icon_as_answer_icon` (bool) Whether to replace 🤖 in chat with the WebApp icon
</Col>
<Col>
<CodeGroup title="Request" tag="POST" label="/meta" targetCode={`curl -X GET '${props.appDetail.api_base_url}/site' \\\n-H 'Authorization: Bearer {api_key}'`}>
```bash {{ title: 'cURL' }}
curl -X GET '${props.appDetail.api_base_url}/site' \
-H 'Authorization: Bearer {api_key}'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"title": "My App",
"chat_color_theme": "#ff4a4a",
"chat_color_theme_inverted": false,
"icon_type": "emoji",
"icon": "😄",
"icon_background": "#FFEAD5",
"icon_url": null,
"description": "This is my app.",
"copyright": "all rights reserved",
"privacy_policy": "",
"custom_disclaimer": "All generated by AI",
"default_language": "en-US",
"show_workflow_steps": false,
"use_icon_as_answer_icon": false,
}
```
</CodeGroup>
</Col>
</Row>
___
<Heading
url='/apps/annotations'
method='GET'

View File

@ -1303,3 +1303,63 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/site'
method='GET'
title='アプリのWebApp設定を取得'
name='#site'
/>
<Row>
<Col>
アプリのWebApp設定を取得するために使用します。
### 応答
- `title` (string) WebApp名
- `chat_color_theme` (string) チャットの色テーマ、16進数形式
- `chat_color_theme_inverted` (bool) チャットの色テーマを反転するかどうか
- `icon_type` (string) アイコンタイプ、`emoji`-絵文字、`image`-画像
- `icon` (string) アイコン。`emoji`タイプの場合は絵文字、`image`タイプの場合は画像URL
- `icon_background` (string) 16進数形式の背景色
- `icon_url` (string) アイコンのURL
- `description` (string) 説明
- `copyright` (string) 著作権情報
- `privacy_policy` (string) プライバシーポリシーのリンク
- `custom_disclaimer` (string) カスタム免責事項
- `default_language` (string) デフォルト言語
- `show_workflow_steps` (bool) ワークフローの詳細を表示するかどうか
- `use_icon_as_answer_icon` (bool) WebAppのアイコンをチャット内の🤖に置き換えるかどうか
</Col>
<Col>
<CodeGroup title="Request" tag="POST" label="/meta" targetCode={`curl -X GET '${props.appDetail.api_base_url}/site' \\\n-H 'Authorization: Bearer {api_key}'`}>
```bash {{ title: 'cURL' }}
curl -X GET '${props.appDetail.api_base_url}/site' \
-H 'Authorization: Bearer {api_key}'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"title": "My App",
"chat_color_theme": "#ff4a4a",
"chat_color_theme_inverted": false,
"icon_type": "emoji",
"icon": "😄",
"icon_background": "#FFEAD5",
"icon_url": null,
"description": "This is my app.",
"copyright": "all rights reserved",
"privacy_policy": "",
"custom_disclaimer": "All generated by AI",
"default_language": "en-US",
"show_workflow_steps": false,
"use_icon_as_answer_icon": false,
}
```
</CodeGroup>
</Col>
</Row>
___

View File

@ -1329,7 +1329,63 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</Row>
---
---
<Heading
url='/site'
method='GET'
title='获取应用 WebApp 设置'
name='#site'
/>
<Row>
<Col>
用于获取应用的 WebApp 设置
### Response
- `title` (string) WebApp 名称
- `chat_color_theme` (string) 聊天颜色主题, hex 格式
- `chat_color_theme_inverted` (bool) 聊天颜色主题是否反转
- `icon_type` (string) 图标类型, `emoji`-表情, `image`-图片
- `icon` (string) 图标, 如果是 `emoji` 类型, 则是 emoji 表情符号, 如果是 `image` 类型, 则是图片 URL
- `icon_background` (string) hex 格式的背景色
- `icon_url` (string) 图标 URL
- `description` (string) 描述
- `copyright` (string) 版权信息
- `privacy_policy` (string) 隐私政策链接
- `custom_disclaimer` (string) 自定义免责声明
- `default_language` (string) 默认语言
- `show_workflow_steps` (bool) 是否显示工作流详情
- `use_icon_as_answer_icon` (bool) 是否使用 WebApp 图标替换聊天中的 🤖
</Col>
<Col>
<CodeGroup title="Request" tag="POST" label="/meta" targetCode={`curl -X GET '${props.appDetail.api_base_url}/site' \\\n-H 'Authorization: Bearer {api_key}'`}>
```bash {{ title: 'cURL' }}
curl -X GET '${props.appDetail.api_base_url}/site' \
-H 'Authorization: Bearer {api_key}'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"title": "My App",
"chat_color_theme": "#ff4a4a",
"chat_color_theme_inverted": false,
"icon_type": "emoji",
"icon": "😄",
"icon_background": "#FFEAD5",
"icon_url": null,
"description": "This is my app.",
"copyright": "all rights reserved",
"privacy_policy": "",
"custom_disclaimer": "All generated by AI",
"default_language": "en-US",
"show_workflow_steps": false,
"use_icon_as_answer_icon": false,
}
```
</CodeGroup>
</Col>
</Row>
___
<Heading
url='/apps/annotations'

View File

@ -1341,6 +1341,64 @@ Chat applications support session persistence, allowing previous chat history to
</Row>
---
<Heading
url='/site'
method='GET'
title='Get Application WebApp Settings'
name='#site'
/>
<Row>
<Col>
Used to get the WebApp settings of the application.
### Response
- `title` (string) WebApp name
- `chat_color_theme` (string) Chat color theme, in hex format
- `chat_color_theme_inverted` (bool) Whether the chat color theme is inverted
- `icon_type` (string) Icon type, `emoji` - emoji, `image` - picture
- `icon` (string) Icon. If it's `emoji` type, it's an emoji symbol; if it's `image` type, it's an image URL
- `icon_background` (string) Background color in hex format
- `icon_url` (string) Icon URL
- `description` (string) Description
- `copyright` (string) Copyright information
- `privacy_policy` (string) Privacy policy link
- `custom_disclaimer` (string) Custom disclaimer
- `default_language` (string) Default language
- `show_workflow_steps` (bool) Whether to show workflow details
- `use_icon_as_answer_icon` (bool) Whether to replace 🤖 in chat with the WebApp icon
</Col>
<Col>
<CodeGroup title="Request" tag="POST" label="/meta" targetCode={`curl -X GET '${props.appDetail.api_base_url}/site' \\\n-H 'Authorization: Bearer {api_key}'`}>
```bash {{ title: 'cURL' }}
curl -X GET '${props.appDetail.api_base_url}/site' \
-H 'Authorization: Bearer {api_key}'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"title": "My App",
"chat_color_theme": "#ff4a4a",
"chat_color_theme_inverted": false,
"icon_type": "emoji",
"icon": "😄",
"icon_background": "#FFEAD5",
"icon_url": null,
"description": "This is my app.",
"copyright": "all rights reserved",
"privacy_policy": "",
"custom_disclaimer": "All generated by AI",
"default_language": "en-US",
"show_workflow_steps": false,
"use_icon_as_answer_icon": false,
}
```
</CodeGroup>
</Col>
</Row>
___
<Heading
url='/apps/annotations'
method='GET'

View File

@ -1330,3 +1330,63 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/site'
method='GET'
title='アプリのWebApp設定を取得'
name='#site'
/>
<Row>
<Col>
アプリのWebApp設定を取得するために使用します。
### 応答
- `title` (string) WebApp名
- `chat_color_theme` (string) チャットの色テーマ、16進数形式
- `chat_color_theme_inverted` (bool) チャットの色テーマを反転するかどうか
- `icon_type` (string) アイコンタイプ、`emoji`-絵文字、`image`-画像
- `icon` (string) アイコン。`emoji`タイプの場合は絵文字、`image`タイプの場合は画像URL
- `icon_background` (string) 16進数形式の背景色
- `icon_url` (string) アイコンのURL
- `description` (string) 説明
- `copyright` (string) 著作権情報
- `privacy_policy` (string) プライバシーポリシーのリンク
- `custom_disclaimer` (string) カスタム免責事項
- `default_language` (string) デフォルト言語
- `show_workflow_steps` (bool) ワークフローの詳細を表示するかどうか
- `use_icon_as_answer_icon` (bool) WebAppのアイコンをチャット内の🤖に置き換えるかどうか
</Col>
<Col>
<CodeGroup title="Request" tag="POST" label="/meta" targetCode={`curl -X GET '${props.appDetail.api_base_url}/site' \\\n-H 'Authorization: Bearer {api_key}'`}>
```bash {{ title: 'cURL' }}
curl -X GET '${props.appDetail.api_base_url}/site' \
-H 'Authorization: Bearer {api_key}'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"title": "My App",
"chat_color_theme": "#ff4a4a",
"chat_color_theme_inverted": false,
"icon_type": "emoji",
"icon": "😄",
"icon_background": "#FFEAD5",
"icon_url": null,
"description": "This is my app.",
"copyright": "all rights reserved",
"privacy_policy": "",
"custom_disclaimer": "All generated by AI",
"default_language": "en-US",
"show_workflow_steps": false,
"use_icon_as_answer_icon": false,
}
```
</CodeGroup>
</Col>
</Row>
___

View File

@ -1332,3 +1332,63 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/site'
method='GET'
title='获取应用 WebApp 设置'
name='#site'
/>
<Row>
<Col>
用于获取应用的 WebApp 设置
### Response
- `title` (string) WebApp 名称
- `chat_color_theme` (string) 聊天颜色主题, hex 格式
- `chat_color_theme_inverted` (bool) 聊天颜色主题是否反转
- `icon_type` (string) 图标类型, `emoji`-表情, `image`-图片
- `icon` (string) 图标, 如果是 `emoji` 类型, 则是 emoji 表情符号, 如果是 `image` 类型, 则是图片 URL
- `icon_background` (string) hex 格式的背景色
- `icon_url` (string) 图标 URL
- `description` (string) 描述
- `copyright` (string) 版权信息
- `privacy_policy` (string) 隐私政策链接
- `custom_disclaimer` (string) 自定义免责声明
- `default_language` (string) 默认语言
- `show_workflow_steps` (bool) 是否显示工作流详情
- `use_icon_as_answer_icon` (bool) 是否使用 WebApp 图标替换聊天中的 🤖
</Col>
<Col>
<CodeGroup title="Request" tag="POST" label="/meta" targetCode={`curl -X GET '${props.appDetail.api_base_url}/site' \\\n-H 'Authorization: Bearer {api_key}'`}>
```bash {{ title: 'cURL' }}
curl -X GET '${props.appDetail.api_base_url}/site' \
-H 'Authorization: Bearer {api_key}'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"title": "My App",
"chat_color_theme": "#ff4a4a",
"chat_color_theme_inverted": false,
"icon_type": "emoji",
"icon": "😄",
"icon_background": "#FFEAD5",
"icon_url": null,
"description": "This is my app.",
"copyright": "all rights reserved",
"privacy_policy": "",
"custom_disclaimer": "All generated by AI",
"default_language": "en-US",
"show_workflow_steps": false,
"use_icon_as_answer_icon": false,
}
```
</CodeGroup>
</Col>
</Row>
___

View File

@ -737,3 +737,56 @@ Workflow applications offers non-session support and is ideal for translation, a
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/site'
method='GET'
title='Get Application WebApp Settings'
name='#site'
/>
<Row>
<Col>
Used to get the WebApp settings of the application.
### Response
- `title` (string) WebApp name
- `icon_type` (string) Icon type, `emoji` - emoji, `image` - picture
- `icon` (string) Icon. If it's `emoji` type, it's an emoji symbol; if it's `image` type, it's an image URL.
- `icon_background` (string) Background color in hex format
- `icon_url` (string) Icon URL
- `description` (string) Description
- `copyright` (string) Copyright information
- `privacy_policy` (string) Privacy policy link
- `custom_disclaimer` (string) Custom disclaimer
- `default_language` (string) Default language
- `show_workflow_steps` (bool) Whether to show workflow details
</Col>
<Col>
<CodeGroup title="Request" tag="POST" label="/meta" targetCode={`curl -X GET '${props.appDetail.api_base_url}/site' \\\n-H 'Authorization: Bearer {api_key}'`}>
```bash {{ title: 'cURL' }}
curl -X GET '${props.appDetail.api_base_url}/site' \
-H 'Authorization: Bearer {api_key}'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"title": "My App",
"icon_type": "emoji",
"icon": "😄",
"icon_background": "#FFEAD5",
"icon_url": null,
"description": "This is my app.",
"copyright": "all rights reserved",
"privacy_policy": "",
"custom_disclaimer": "All generated by AI",
"default_language": "en-US",
"show_workflow_steps": false,
}
```
</CodeGroup>
</Col>
</Row>
___

View File

@ -740,3 +740,57 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</CodeGroup>
</Col>
</Row>
———
<Heading
url='/site'
method='GET'
title='アプリのWebApp設定を取得'
name='#site'
/>
<Row>
<Col>
アプリのWebApp設定を取得するために使用します。
### 応答
- `title` (string) WebApp名
- `icon_type` (string) アイコンタイプ、`emoji`-絵文字、`image`-画像
- `icon` (string) アイコン。`emoji`タイプの場合は絵文字、`image`タイプの場合は画像URL
- `icon_background` (string) 16進数形式の背景色
- `icon_url` (string) アイコンのURL
- `description` (string) 説明
- `copyright` (string) 著作権情報
- `privacy_policy` (string) プライバシーポリシーのリンク
- `custom_disclaimer` (string) カスタム免責事項
- `default_language` (string) デフォルト言語
- `show_workflow_steps` (bool) ワークフローの詳細を表示するかどうか
</Col>
<Col>
<CodeGroup title="Request" tag="POST" label="/meta" targetCode={`curl -X GET '${props.appDetail.api_base_url}/site' \\\n-H 'Authorization: Bearer {api_key}'`}>
```bash {{ title: 'cURL' }}
curl -X GET '${props.appDetail.api_base_url}/site' \
-H 'Authorization: Bearer {api_key}'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"title": "My App",
"icon_type": "emoji",
"icon": "😄",
"icon_background": "#FFEAD5",
"icon_url": null,
"description": "This is my app.",
"copyright": "all rights reserved",
"privacy_policy": "",
"custom_disclaimer": "All generated by AI",
"default_language": "en-US",
"show_workflow_steps": false,
}
```
</CodeGroup>
</Col>
</Row>
___

View File

@ -727,3 +727,57 @@ Workflow 应用无会话支持,适合用于翻译/文章写作/总结 AI 等
</CodeGroup>
</Col>
</Row>
---
<Heading
url='/site'
method='GET'
title='获取应用 WebApp 设置'
name='#site'
/>
<Row>
<Col>
用于获取应用的 WebApp 设置
### Response
- `title` (string) WebApp 名称
- `icon_type` (string) 图标类型, `emoji`-表情, `image`-图片
- `icon` (string) 图标, 如果是 `emoji` 类型, 则是 emoji 表情符号, 如果是 `image` 类型, 则是图片 URL
- `icon_background` (string) hex 格式的背景色
- `icon_url` (string) 图标 URL
- `description` (string) 描述
- `copyright` (string) 版权信息
- `privacy_policy` (string) 隐私政策链接
- `custom_disclaimer` (string) 自定义免责声明
- `default_language` (string) 默认语言
- `show_workflow_steps` (bool) 是否显示工作流详情
</Col>
<Col>
<CodeGroup title="Request" tag="POST" label="/meta" targetCode={`curl -X GET '${props.appDetail.api_base_url}/site' \\\n-H 'Authorization: Bearer {api_key}'`}>
```bash {{ title: 'cURL' }}
curl -X GET '${props.appDetail.api_base_url}/site' \
-H 'Authorization: Bearer {api_key}'
```
</CodeGroup>
<CodeGroup title="Response">
```json {{ title: 'Response' }}
{
"title": "My App",
"icon_type": "emoji",
"icon": "😄",
"icon_background": "#FFEAD5",
"icon_url": null,
"description": "This is my app.",
"copyright": "all rights reserved",
"privacy_policy": "",
"custom_disclaimer": "All generated by AI",
"default_language": "en-US",
"show_workflow_steps": false,
}
```
</CodeGroup>
</Col>
</Row>
___