| from flask_restful import fields | from flask_restful import fields | ||||
| from libs.helper import AppIconUrlField | |||||
| parameters__system_parameters = { | parameters__system_parameters = { | ||||
| "image_file_size_limit": fields.Integer, | "image_file_size_limit": fields.Integer, | ||||
| "video_file_size_limit": fields.Integer, | "video_file_size_limit": fields.Integer, | ||||
| "file_upload": fields.Raw, | "file_upload": fields.Raw, | ||||
| "system_parameters": fields.Nested(parameters__system_parameters), | "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, | |||||
| } |
| api = ExternalApi(bp) | api = ExternalApi(bp) | ||||
| from . import index | 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 .dataset import dataset, document, hit_testing, metadata, segment, upload_file | ||||
| from .workspace import models | from .workspace import models |
| 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") |
| </CodeGroup> | </CodeGroup> | ||||
| </Col> | </Col> | ||||
| </Row> | </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> | |||||
| ___ |
| </CodeGroup> | </CodeGroup> | ||||
| </Col> | </Col> | ||||
| </Row> | </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> | |||||
| ___ |
| </CodeGroup> | </CodeGroup> | ||||
| </Col> | </Col> | ||||
| </Row> | </Row> | ||||
| --- | --- | ||||
| <Heading | <Heading | ||||
| </Row> | </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 | <Heading | ||||
| url='/apps/annotations' | url='/apps/annotations' | ||||
| method='GET' | method='GET' |
| </Row> | </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 | <Heading | ||||
| url='/apps/annotations' | url='/apps/annotations' | ||||
| method='GET' | method='GET' |
| </CodeGroup> | </CodeGroup> | ||||
| </Col> | </Col> | ||||
| </Row> | </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> | |||||
| ___ |
| </Row> | </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 | <Heading | ||||
| url='/apps/annotations' | url='/apps/annotations' |
| </Row> | </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 | <Heading | ||||
| url='/apps/annotations' | url='/apps/annotations' | ||||
| method='GET' | method='GET' |
| </CodeGroup> | </CodeGroup> | ||||
| </Col> | </Col> | ||||
| </Row> | </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> | |||||
| ___ |
| </CodeGroup> | </CodeGroup> | ||||
| </Col> | </Col> | ||||
| </Row> | </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> | |||||
| ___ |
| </CodeGroup> | </CodeGroup> | ||||
| </Col> | </Col> | ||||
| </Row> | </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> | |||||
| ___ |
| </CodeGroup> | </CodeGroup> | ||||
| </Col> | </Col> | ||||
| </Row> | </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> | |||||
| ___ | |||||
| </CodeGroup> | </CodeGroup> | ||||
| </Col> | </Col> | ||||
| </Row> | </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> | |||||
| ___ |