You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorials/1.developers/4.apps-development/3.enable-app.md
+25-29Lines changed: 25 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,10 +14,11 @@ DIAL-native applications can be categorized as either schema-rich or apps withou
14
14
15
15
##### Schema-rich applications
16
16
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.
18
-
This goes beyond simply adjusting the basic settings of an application container, offering dynamics and flexibility compared to apps without schemas.
17
+
[Schema-rich applications](#enable-schema-rich-applications) enable users to create instances of applications with different properties via [DIAL Core API](https://dialx.ai/dial_api#tag/Applications/operation/saveCustomApplication). Unlike apps without schemas, where business logic properties are embedded in the application code or container environment and are difficult to access, schema-rich applications provide greater flexibility.
19
18
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.
19
+
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.
20
+
21
+
There is a method in [DIAL SDK](https://github.com/epam/ai-dial-sdk) (`application_properties = await request.request_dial_application_properties()`) that returns application properties with a configuration request to DIAL Core.
21
22
22
23
Schema-rich applications are usually associated with a specific **Application Type** - a template for creating applications of that type.
23
24
@@ -56,7 +57,7 @@ Send a [PUT](https://dialx.ai/dial_api#tag/Applications/operation/saveCustomAppl
56
57
- 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.
57
58
- 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.
58
59
59
-
Example:
60
+
Example of a PUT request body:
60
61
61
62
```json
62
63
{
@@ -93,7 +94,7 @@ JSON Schemas of application types can include `applicationTypeEditorUrl` to enab
93
94
94
95
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.
95
96
96
-
Example:
97
+
Example of dynamic settings in DIAL Core:
97
98
98
99
```json
99
100
"applications":
@@ -127,7 +128,7 @@ To enable such an app in DIAL, you can add its representation in JSON format dir
127
128
128
129
Send a [PUT](https://dialx.ai/dial_api#tag/Applications/operation/saveCustomApplication) request to DIAL Core, where in the request body you provide specific endpoints and parameters for your application. You can see them in DIAL Core documentation under the [dynamic setting](https://github.com/epam/ai-dial-core?tab=readme-ov-file#dynamic-settings) for `applications`.
129
130
130
-
Example:
131
+
Example of a PUT request body:
131
132
132
133
```json
133
134
{
@@ -161,7 +162,7 @@ The configuration of an application is saved as a BLOB in the DIAL Core file sys
161
162
162
163
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.
163
164
164
-
Example:
165
+
Example of dynamic settings in DIAL Core:
165
166
166
167
```json
167
168
"applications": {
@@ -193,10 +194,11 @@ If you enable your application by directly modifying the [DIAL Core configuratio
193
194
194
195
##### Example
195
196
196
-
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.
197
+
Applications use language models on behalf of users and within the defined limits, provided both model and application can be accessed by a specific user role.
197
198
198
-
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.
199
+
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.
199
200
201
+
Example of dynamic settings in DIAL Core:
200
202
201
203
```json
202
204
"applications":
@@ -227,35 +229,27 @@ You can use DIAL UI and API to publish and/or share applications with other user
227
229
228
230
Applications can rely on resources like documents and files to operate. When the application is shared or published, it is crucial to ensure that these resources are accessible, if needed, to all involved parties in the operation flow.
229
231
230
-
Access to application files can be necessary in the following scenarios:
231
-
232
-
1. When an application is shared with other users
233
-
2. When an application is published
234
-
3. When files are supplied by a user to an application
235
-
4. When files are shared as part of a request from one application to another
236
-
237
-
Handling of these scenarios differs significantly between schema-rich applications and those without schemas.
232
+
Providing access to application files differs significantly between schema-rich applications and those without schemas.
238
233
239
234
##### For applications without schemas
240
235
241
-
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.
236
+
Developers must incorporate a programming logic into the application 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.
242
237
243
238
##### For schema-rich applications
244
239
245
-
The JSON schema of schema-rich apps can include links to resources (e.g., files or documents).
240
+
In schema-rich applications, **auto-share** principle applies to handle access to files.
246
241
247
-
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:
242
+
JSON schema of schema-rich apps can include links to resources (e.g., files or documents) that are required by the application to operate. Auto-share logic applies to all resources marked as `"dial_file": true`. If the resource is marked as `"dial_file": true`, it will be **automatically** shared when this application is shared with other users, published or as part of a requests chain between applications. **Important**: To prevent specific resources from being shared automatically, avoid using `"dial_file": true` in schema.
248
243
249
-
* Files are automatically shared or published alongside the application (scenarios 1 and 2).
250
-
* Files are automatically included in chat completion requests or when making API calls between applications (scenarios 3 and 4).
244
+
Let's consider the following scenario as an example:
251
245
252
-

253
-
254
-
**Important**: To prevent specific resources from being shared automatically, avoid marking their schema properties with `"dial_file": true`.
246
+
1. A DIAL Chat user initiates a conversation with a schema-rich RAG application (App1).
247
+
2. DIAL Core issues a [per-request API key](/docs/platform/3.core/3.per-request-keys.md#files-sharing) for this request.
248
+
3. DIAL Core checks the schema of the App1 and gives READ access for the per-request API key to all files marked as `"dial_file": true`. This way, the application automatically gets access to necessary files to generate responses.
255
249
256
-
##### Example
250
+

257
251
258
-
A schema for a RAG application might define a field like `rag_files`:
252
+
Schema for such application can include:
259
253
260
254
```json
261
255
"rag_files": {
@@ -267,15 +261,17 @@ A schema for a RAG application might define a field like `rag_files`:
267
261
}
268
262
```
269
263
270
-
In the actual configuration of the application, the referenced files look as follows:
264
+
Configuration of the application in DIAL Core dynamic settings can include a path to a specific file that will be shared:
271
265
272
266
```json
273
267
"applicationProperties": {
274
268
"rag_files": ["files/csdvsdvsd/my_file.docx"]
275
269
}
276
270
```
277
271
278
-
In this example, the files listed in the `rag_files` field will automatically follow the sharing behavior described above.
272
+
Similarly, if App1 was to call App2 to perform a specific action, another per-request API key would be issued with access to App2 files:
Copy file name to clipboardExpand all lines: docs/tutorials/1.developers/4.apps-development/5.quick-app-configuration.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Quick app is one of the [application types](/docs/platform/0.architecture-and-co
6
6
7
7
Quick app application type is [schema-rich](/docs/tutorials/1.developers/4.apps-development/3.enable-app.md#schema-rich-applications) - the structure of custom applications of this type is defined by the JSON schema of Quick apps. This document provides a detailed overview of the Quick app JSON schema, explaining the available configuration options primarily useful if you are creating Quick apps using DIAL API.
8
8
9
-
Quick apps are code-less and conceptually similar to OpenAI's GPTs. They can include tools such as client toolsets, web API toolsets, use apps and models deployed in DIAL as tools and URLs to files to perform specific actions. For example, you can create an app with a toolset allowing it to call an external API to get a real-time weather forecast for a specific location. Another example is a RAG-like application that can generate responses based on predefined sources.
9
+
Quick apps are code-less and conceptually similar to OpenAI's GPTs. They can include tools such as client toolsets, web API toolsets, use apps and models deployed in DIAL as tools and URLs to files for RAG. For example, you can create an app with a toolset allowing it to call an external API to get a real-time weather forecast for a specific location. Another example is a RAG-like application that can generate responses based on predefined sources.
10
10
11
11
> * Watch a [Demo Video](/docs/video%20demos/2.Applications/5.quick-apps.md) with an introduction to Quick Apps.
12
12
> * Refer to [Enable App](/docs/tutorials/1.developers/4.apps-development/3.enable-app.md) to learn how to enable Quick apps that you create in DIAL and make them available for other users.
@@ -27,7 +27,7 @@ The structure of Quick app applications is defined by the schema with ID `https:
27
27
28
28
## Starter Buttons
29
29
30
-
You can enhance user interactions in your application by adding buttons, known as starters, at the beginning of the conversation. These buttons allow users to take specific actions to launch a conversation.
30
+
You can enhance user interactions in your application by adding buttons, known as starters, at the beginning of the conversation. These buttons allow users to select a predefined message to launch a conversation.
31
31
32
32
Use `starters` to enable starter buttons.
33
33
@@ -49,10 +49,10 @@ Use `starters` to enable starter buttons.
49
49
50
50
Use tools to extend the functionality of your Quick App. Applications or models deployed in DIAL, external services and web APIs can serve as tools.
51
51
52
-
### Apps & Models
52
+
### Apps & Models as Tools
53
53
54
54
Your Quick app can be configured to use other applications and models deployed in DIAL as tools to perform specific actions.
55
-
Use`applications_as_tools` property of the Quick app schema to enable this. It can reference
55
+
Set`applications_as_tools` property in your Quick app to enable this. It can reference
56
56
specific applications/models by their IDs or use groups of [conditions](#conditions) to dynamically match applications/models based on specific properties.
57
57
58
58
| Field | Type | Required | Description | Example |
@@ -72,7 +72,7 @@ specific applications/models by their IDs or use groups of [conditions](#conditi
72
72
##### Conditions
73
73
74
74
`applications_as_tools` can accept both direct application/model IDs as `strings` and `conditions` objects that
75
-
define matching criteria for applications/models. If provided both, `conditions` object logically serves as AND in relation to `string`. The objects within the `conditions` array are combined using a logical OR operation.
75
+
define matching criteria for applications/models. If provided both, `conditions` object logically serves as OR in relation to `string`. The objects within the `conditions` array are combined using a logical AND operation.
76
76
77
77
##### Example in which two tools are enabled RAG and Copilot Deck App
78
78
@@ -139,7 +139,7 @@ You can match applications/models based on these properties:
139
139
140
140
Your application can use external tools that can be invoked outside of the Quick app application. Include the `client_toolset` property to enable this.
141
141
142
-
Unlike apps and models as tools, when the LLM decides to call a `client_toolset` tool, the processing chain is stopped, and Quick app responds with a `tool_call` message.
142
+
Unlike apps and models as tools, when the LLM decides to call a `client_toolset` tool, the processing chain is stopped, and Quick app responds with AI message with a `tool_call`.
143
143
The response also includes additional metadata (`intermediate_steps_to_restore`) that needs to be sent back to Quick app along with the `tool_call` result once the tool execution is completed to ensure proper flow restoration.
144
144
145
145
##### Example
@@ -223,7 +223,7 @@ Each `WebApiToolsetInfo` object has the following structure:
|`tool_endpoints`| array of `ToolEndpointInfo`| Yes | Collection of endpoints the tool can call. Refer to [Tool Endpoints Definition](#tool-endpoints-definition)for details. |
226
+
|`tool_endpoints`| array of `ToolEndpointInfo`| Yes | Collection of endpoints the tool can call. Refer to [Tool Endpoints Definition](#tool-endpoints-definition)for details. |
227
227
|`auth_info`|`WebApiToolsetKeyAuthInfo` or null | Yes | Authentication configuration for the endpoints. Refer to [API Key Authentication](#api-key-authentication) for details. |
228
228
229
229
##### Tool Endpoints Definition
@@ -330,7 +330,10 @@ Provide these parameters to configure authentication for the web API endpoints.
330
330
331
331
### RAG Integration
332
332
333
-
Retrieval Augmented Generation (RAG) is integrated into Quick Apps as a tool named `query_document` with the `description`. When writing instructions for applications that use RAG, we recommend following these guidelines:
333
+
Retrieval Augmented Generation (RAG) is integrated into Quick Apps as a tool named `query_document` with the `description: "Ask RAG a question about the documents assuming it will have access to the conversation history."`. When writing instructions for applications using
334
+
RAG, you should explicitly mention the need to query the document first before answering questions.
335
+
336
+
For optimal results, the instructions should:
334
337
335
338
1. Direct application to use the RAG tool to retrieve relevant information.
336
339
2. Explicitly state to use only the information found in the documents.
0 commit comments