Skip to content

Commit 5edc19e

Browse files
committed
enable apps review
1 parent 6828d31 commit 5edc19e

File tree

3 files changed

+76
-35
lines changed

3 files changed

+76
-35
lines changed

docs/tutorials/1.developers/4.apps-development/3.enable-app.md

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,31 @@ DIAL-native applications can be categorized as either schema-rich or apps withou
1414

1515
##### Schema-rich applications
1616

17-
Schema-rich apps, in comparison with apps without schemas, allow users to edit application properties via DIAL Core API that are normally hidden in the app's internal environment and cannot be changed. There is a method in DIAL SDK (`application_properties = await request.request_dial_application_properties()`) that returns application properties with a configuration request to DIAL Core.
17+
Schema-rich apps, in comparison with apps without schemas, allow users to create instances of applications with different properties via DIAL Core API that are normally hidden in the app's internal environment and cannot be changed. There is a method in DIAL SDK (`application_properties = await request.request_dial_application_properties()`) that returns application properties with a configuration request to DIAL Core.
1818
This goes beyond simply adjusting the basic settings of an application container, offering dynamics and flexibility compared to apps without schemas.
1919

20-
[Schema-rich applications](#enable-schema-rich-applications) are defined by a JSON schema that conforms to the main [meta schema](https://github.com/epam/ai-dial-core/blob/development/config/src/main/resources/custom-application-schemas/schema). Meta schema specifies the application type's structure, including properties and endpoints (completion, configuration, and other). Meta schema may also include a URL for an application editor (enabling a wizard in the UI for creating/editing applications), a URL for a custom application UI, [custom buttons](/docs/tutorials/1.developers/4.apps-development/1.custom-buttons.md) used by the application.
20+
[Schema-rich applications](#enable-schema-rich-applications) are defined by a JSON schema that conforms to the main [meta schema](https://github.com/epam/ai-dial-core/blob/development/config/src/main/resources/custom-application-schemas/schema). JSON schema describes the application's structure, including properties and endpoints (completion, configuration, and other), can include URLs for application editor (enabling a wizard in the UI for creating/editing applications) and custom application UI, [custom buttons](/docs/tutorials/1.developers/4.apps-development/1.custom-buttons.md) used by the application.
2121

22-
Schema-rich applications are usually associated with a specific **Application Type** - a template for creating applications of that type.
22+
Schema-rich applications are usually associated with a specific **Application Type** - a template for creating applications of that type.
23+
24+
![](../img/schema-rich-apps.svg)
2325

2426
:cloud: DIAL SaaS edition includes application types such as Quick app, Code app and Mindmap.
2527

2628
:floppy_disk: In self-hosted deployments of DIAL, you can add new application types, featuring custom application UI (`applicationTypeViewerUrl`) and wizards (`applicationTypeEditorUrl`) and enabling end-users to create applications of that type. Refer to [Agentic Platform](/docs/platform/0.architecture-and-concepts/4.agentic-platform.md#application-types) to learn more about available application types.
2729

2830
##### Applications without schemas
2931

30-
[Applications without schemas](#enable-applications-without-schemas) are not tied to any specific application type. When enabling such an app, you must explicitly specify all properties and available endpoints the application offers. All application properties are part of the application code and the container it runs in, meaning they cannot be modified through the DIAL Core API, contrary to schema-rich applications. To enable two apps without schemas, you need to launch two containers, whereas for schema-rich apps, you can make just two API calls.
32+
[Applications without schemas](#enable-applications-without-schemas) are not tied to any specific application type. When enabling such an app, you must explicitly specify (in the [API PUT request](#using-api-1)) standard parameters of the application and available endpoints the application offers. Properties that define the logic and behavior of the application are part of the application code and the container it runs in, meaning they cannot be modified through the DIAL Core API, contrary to schema-rich applications. For example, to enable two apps without schemas, you may need to launch two containers, whereas for schema-rich apps, you can make just two API calls.
3133

3234
## Enable Schema-Rich Applications
3335

34-
You can enable schema-rich apps either by using DIAL API or by a direct modification of the DIAL Core configuration.
36+
You can enable schema-rich apps either by using [DIAL API](#using-api) or by a [direct modification of the DIAL Core configuration](#using-dial-core-config).
3537

3638
**Prerequisites**:
3739

3840
- A schema of the application type must be included in the DIAL Core configuration.
39-
- You must have a running container with your app accessible via the endpoint specified in the meta schema.
41+
- Having a running container for each application type. These containers must be accessible via the endpoints specified in the JSON schema for their respective application types.
4042

4143
### Using API
4244

@@ -50,9 +52,9 @@ Send a [PUT](https://dialx.ai/dial_api#tag/Applications/operation/saveCustomAppl
5052
- `applicationTypeSchemaId`: The identifier of the schema for the application type you want to use as a template. You can retrieve available schemas via the [GET Schemas](https://rail-landing.staging.deltixhub.io/dial_api#tag/Applications/operation/listCustomApplicationSchemas) API call.
5153
- `applicationProperties`: A valid JSON object representing the application's structure, conforming to the specified schema. If the JSON object is invalid, the request will fail.
5254

53-
- If `applicationTypeSchemaId` is absent or `NULL`, `applicationProperties` are not required.
55+
- If `applicationTypeSchemaId` is absent or `NULL`, `applicationProperties` are not required. If `applicationTypeSchemaId` is not provided, then this is not a schema-rich application.
5456
- If `applicationTypeSchemaId` is provided but `applicationProperties` are `NULL`, the application is considered a "stub" and can be updated later, but completion requests will not be possible until then.
55-
- For applications with schemas, all requests are routed **ONLY** to endpoints specified in the schema. If you specify endpoints in the request, such request will fail.
57+
- For applications with schemas, all requests are routed **ONLY** to endpoints specified in the schema. If you specify endpoints in the [PUT](https://dialx.ai/dial_api#tag/Applications/operation/saveCustomApplication) request, such request will fail.
5658

5759
Example:
5860

@@ -64,7 +66,7 @@ Send a [PUT](https://dialx.ai/dial_api#tag/Applications/operation/saveCustomAppl
6466
"applicationTypeSchemaId": "https://mydial.epam.com/custom_application_schemas/quickapps",
6567
"applicationProperties": {
6668
"temperature": 0.8,
67-
"instructions": "You should help explore the document containing the Copilot Deck. You must query the document first to do that. You should answer using only the information in the document. Answer \"I don't know\" if there are any other questions.",
69+
"instructions": "Answer using only the information in the document.",
6870
"model": "gpt-4o-2024-05-13",
6971
"web_api_toolset": [],
7072
"document_relative_url": "files/DpZGXdhaTxt4FYCWNadE2Ln/GPT%20Deck.docx"
@@ -79,7 +81,7 @@ The configuration of the enabled app is saved as a BLOB in the DIAL Core file sy
7981

8082
#### UI Wizard
8183

82-
Schemas of application types can include `applicationTypeEditorUrl` to enable users to create and edit applications using UI wizards.
84+
JSON Schemas of application types can include `applicationTypeEditorUrl` to enable a UI for users to create and edit applications.
8385

8486
:cloud: SaaS DIAL edition includes wizards for Quick app, Code app and Mindmap application types.
8587

@@ -89,7 +91,7 @@ Schemas of application types can include `applicationTypeEditorUrl` to enable us
8991

9092
### Using DIAL Core Config
9193

92-
DIAL admins can create schema-rich applications by including a valid JSON object with the application representation in the [DIAL Core](https://github.com/epam/ai-dial-core?tab=readme-ov-file#dynamic-settings) configuration for the `applications` keyword.
94+
DIAL admins can create schema-rich applications by including a valid JSON object with the application representation in the [DIAL Core](https://github.com/epam/ai-dial-core?tab=readme-ov-file#dynamic-settings) configuration in the `applications` section.
9395

9496
Example:
9597

@@ -101,10 +103,10 @@ Example:
101103
"applicationTypeSchemaId": "https://mydial.epam.com/custom_application_schemas/quickapps",
102104
"applicationProperties": {
103105
"temperature": 0.8,
104-
"instructions": "You should help explore the document containing the Copilot Deck. You must query the document first to do that. You should answer using only the information in the document. Answer \"I don't know\" if there are any other questions.",
106+
"instructions": "Answer using only the information in the document.",
105107
"model": "gpt-4o-2024-05-13",
106108
"web_api_toolset": [],
107-
"document_relative_url": ["files/DpZGXdFYCWNadE2Ln/GPT%20Deck%20text.docx", "files/DpZGXdhaTxtaR67V4FYCWNadE2Ln/GPT%20Deck%20text.docx"]
109+
"document_relative_url": ["files/DpZGXdFYCWNadE2Ln/GPT%20Deck%20text.docx"]
108110
}
109111
}
110112
```
@@ -113,11 +115,11 @@ Example:
113115

114116
## Enable Applications without Schemas
115117

116-
Applications without schemas, in comparison with schema-rich apps, are not associated with any specific application type and do not have properties that are described in a schema. To enable such an app, you provide a JSON object with a complete configuration, including all application endpoints and properties. Refer to [dynamic setting of DIAL Core](https://github.com/epam/ai-dial-core?tab=readme-ov-file#dynamic-settings) to see all the supported parameters for `applications`.
118+
Applications without schemas, unlike schema-rich apps, are not tied to a specific application type and their business logic cannot be defined through properties in a JSON schema.
117119

118-
To enable such applications in DIAL, you can either include a JSON object with apps representation in the DIAL Core configuration or use the DIAL API.
120+
To enable such an app in DIAL, you can add its representation in JSON format directly into the [DIAL Core config](#using-dial-core-config-1) or make an [API request](#using-api-1) where you provide all application endpoints and standard parameters - refer to [dynamic setting of DIAL Core](https://github.com/epam/ai-dial-core?tab=readme-ov-file#dynamic-settings) to see all the supported parameters for `applications`.
119121

120-
**Prerequisite**: You must have a running container with your app accessible via the endpoint you provide in the request.
122+
**Prerequisite**: You must have a running container with your app accessible for DIAL Core via the endpoints you provide in the [PUT request](#using-api-1).
121123

122124
### Using API
123125

@@ -157,7 +159,7 @@ The configuration of an application is saved as a BLOB in the DIAL Core file sys
157159

158160
### Using DIAL Core Config
159161

160-
DIAL admins can create an application by including a valid JSON object with the application representation in the [DIAL Core](https://github.com/epam/ai-dial-core?tab=readme-ov-file#dynamic-settings) configuration for the `applications` keyword.
162+
DIAL admins can create an application by including a valid JSON object with the application representation in the [DIAL Core](https://github.com/epam/ai-dial-core?tab=readme-ov-file#dynamic-settings) configuration for the `applications` section.
161163

162164
Example:
163165

@@ -181,13 +183,16 @@ Example:
181183

182184
> Refer to [Access & Cost Control](/docs/platform/3.core/2.access-control-intro.md) to learn how access control to system resources is implemented in DIAL.
183185
184-
If you want your app to be available to other users and listed on the DIAL Marketplace, you need to:
186+
If you want your app to be available to other users and listed on the DIAL Marketplace, you need to associate your app with a specific role by including `userRoles` in the app's configuration.
185187

186-
- Associate your app with a specific role by including `userRoles` in the app's configuration.
187-
- Add your app to the scope of the selected role. Additionally, you can set limits for user roles, such as restricting the number of tokens that can be sent to your app within a defined time interval.
188+
Applications use language models on behalf of users, provided both model and application can be accessed by a specific user role. In this case, costs of using a model are defined by the limits configured for a specific user role.
188189

189190
Example of roles and limits configuration in [DIAL Core](https://github.com/epam/ai-dial-core?tab=readme-ov-file#dynamic-settings):
190191

192+
You're absolutely right. Thank you for catching that. Here's the corrected version:
193+
194+
In the following example, the `my_app` application is accessible to users with the `app_user` role. For this user role, usage limits are set on the `chat-gpt-35-turbo` model, as specified in the `limits` section. When a user with the `app_user` role uses the application, the app will use the `chat-gpt-35-turbo` model within these prescribed limits.
195+
191196
```json
192197
"applications":
193198
"my_app": {
@@ -196,7 +201,7 @@ Example of roles and limits configuration in [DIAL Core](https://github.com/epam
196201
"roles": {
197202
"app_user": { // the name of the role
198203
"limits": {
199-
"my_app": {
204+
"chat-gpt-35-turbo": {
200205
"minute": "100000", //number of tokens per minute
201206
"day": "10000000", //number of tokens per day
202207
"week": "10000000", //number of tokens per week
@@ -209,27 +214,35 @@ Example of roles and limits configuration in [DIAL Core](https://github.com/epam
209214

210215
## Sharing & Publications
211216

212-
As the author of a schema-rich application, I can enable my colleagues to use it by sharing or publishing the app. Refer to [Collaboration](/docs/platform/7.collaboration-intro.md) to learn more about sharing and publications.
217+
Applications can rely on resources like documents and files to operate. It is crucial to ensure that these resource are accessible, if needed, to all involved parties in the operation flow. This is particularly important when applications are shared or published, as well as when files are supplied by users or shared between applications.
218+
219+
File sharing in DIAL applications can occur in several scenarios:
220+
221+
1. When an application is shared with other users
222+
2. When an application is published
223+
3. When files are supplied by a user to an application
224+
4. When files are shared as part of a request from one application to another
225+
226+
The handling of these scenarios differs significantly between schema-rich applications and those without schemas.
213227

214-
If the application's configuration includes links to resources (e.g., files or documents), these can be marked in the schema using the `"dial_file": true` property. When this property is applied, all referenced files are automatically shared or published alongside the application.
228+
##### For applications without schemas
215229

216-
This behavior applies to all schema-rich applications, regardless of whether they are enabled via configuration or created using the UI or API.
230+
Developers must incorporate custom logic to handle file access when the application is shared or published. It requires careful implementation to ensure all necessary resources are available for authorized users and apps.
217231

218-
### Automatic File Sharing Behavior
232+
##### For schema-rich applications
219233

220-
When a field in the application schema is marked with `"dial_file": true`, the following actions occur:
234+
The JSON schema of schema-rich apps can include links to resources (e.g., files or documents).
221235

222-
- Files referenced by the application are shared automatically when the app is accessed by another application using per-request API keys.
223-
- Files are shared when the app is published or shared by a user or the app's author.
224-
- Files are included in all interactions, such as chat completion or configuration requests made to DIAL Core.
236+
The following logic applies to resources marked with the `"dial_file": true` property, regardless of whether the app was enabled via configuration or created using the UI or API.
225237

226-
For example, if a user submits a request to the app through DIAL Chat, the DIAL Core identifies the `"dial_file": true` fields in the app schema and automatically includes the corresponding files as attachments to the request.
238+
* Files are automatically shared or published alongside the application (scenarios 1 and 2).
239+
* Files are automatically included in chat completion requests or when making API calls between applications (scenarios 3 and 4).
227240

228-
### Preventing Automatic File Sharing
241+
![](../img/files-sharing.svg)
229242

230-
To prevent specific resources from being shared automatically, avoid marking their schema properties with `"dial_file": true`. You can use other types, such as `"string"`, to exclude them from this behavior.
243+
To prevent specific resources from being shared automatically, avoid marking their schema properties with `"dial_file": true`.
231244

232-
### Example
245+
##### Example
233246

234247
A schema for a RAG application might define a field like `rag_files`:
235248

@@ -259,8 +272,8 @@ In this example, the files listed in the `rag_files` field will automatically fo
259272

260273
##### Custom UIs
261274

262-
You can create application types with custom UIs to replace the default DIAL UI, even for non-conversational apps. Additionally, you can implement separate custom wizards as needed. Custom UIs can follow any logic and are defined in the application type schema using `applicationTypeViewerUrl` for UI and `applicationTypeEditorUrl` for wizard.
275+
You can create schema-rich application types with custom UIs to replace the default DIAL UI, even for non-conversational apps. Additionally, you can implement separate custom wizards as needed. Custom UIs can follow any logic and are defined in the application type schema using `applicationTypeViewerUrl` for UI and `applicationTypeEditorUrl` for wizard.
263276

264277
##### Application Endpoint
265278

266-
You can register your application's endpoint in DIAL Core as a `route`. You can apply roles, usage limits, and associate API keys with these routes, enabling seamless integration with DIAL Core features. This allows other applications in DIAL to interact with your app's endpoint. For details on registering routes, refer to [DIAL Core dynamic settings](https://github.com/epam/ai-dial-core?tab=readme-ov-file#dynamic-settings).
279+
To enable DIAL apps to communicate with your application, you can register your application's endpoint in DIAL Core as a `route`. You can apply roles, usage limits, and associate API keys with these routes, enabling seamless integration with DIAL Core features. For details on registering routes, refer to [DIAL Core dynamic settings](https://github.com/epam/ai-dial-core?tab=readme-ov-file#dynamic-settings).

0 commit comments

Comments
 (0)