Skip to content

Commit 41d1eff

Browse files
committed
review
1 parent 81b775e commit 41d1eff

File tree

5 files changed

+73
-52
lines changed

5 files changed

+73
-52
lines changed

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

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ 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 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.
1918

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.
2122

2223
Schema-rich applications are usually associated with a specific **Application Type** - a template for creating applications of that type.
2324

@@ -56,7 +57,7 @@ Send a [PUT](https://dialx.ai/dial_api#tag/Applications/operation/saveCustomAppl
5657
- 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.
5758
- 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.
5859

59-
Example:
60+
Example of a PUT request body:
6061

6162
```json
6263
{
@@ -93,7 +94,7 @@ JSON Schemas of application types can include `applicationTypeEditorUrl` to enab
9394

9495
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.
9596

96-
Example:
97+
Example of dynamic settings in DIAL Core:
9798

9899
```json
99100
"applications":
@@ -127,7 +128,7 @@ To enable such an app in DIAL, you can add its representation in JSON format dir
127128

128129
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`.
129130

130-
Example:
131+
Example of a PUT request body:
131132

132133
```json
133134
{
@@ -161,7 +162,7 @@ The configuration of an application is saved as a BLOB in the DIAL Core file sys
161162

162163
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.
163164

164-
Example:
165+
Example of dynamic settings in DIAL Core:
165166

166167
```json
167168
"applications": {
@@ -193,10 +194,11 @@ If you enable your application by directly modifying the [DIAL Core configuratio
193194

194195
##### Example
195196

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.
197198

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.
199200

201+
Example of dynamic settings in DIAL Core:
200202

201203
```json
202204
"applications":
@@ -227,35 +229,27 @@ You can use DIAL UI and API to publish and/or share applications with other user
227229

228230
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.
229231

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.
238233

239234
##### For applications without schemas
240235

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.
242237

243238
##### For schema-rich applications
244239

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.
246241

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.
248243

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:
251245

252-
![](../img/files-sharing.svg)
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.
255249

256-
##### Example
250+
![](../img/files-sharing2.svg)
257251

258-
A schema for a RAG application might define a field like `rag_files`:
252+
Schema for such application can include:
259253

260254
```json
261255
"rag_files": {
@@ -267,15 +261,17 @@ A schema for a RAG application might define a field like `rag_files`:
267261
}
268262
```
269263

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:
271265

272266
```json
273267
"applicationProperties": {
274268
"rag_files": ["files/csdvsdvsd/my_file.docx"]
275269
}
276270
```
277271

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:
273+
274+
![](../img/files-sharing.svg)
279275

280276
## Enable NOT DIAL-Native Apps
281277

docs/tutorials/1.developers/4.apps-development/5.quick-app-configuration.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Quick app is one of the [application types](/docs/platform/0.architecture-and-co
66

77
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.
88

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.
1010

1111
> * Watch a [Demo Video](/docs/video%20demos/2.Applications/5.quick-apps.md) with an introduction to Quick Apps.
1212
> * 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:
2727

2828
## Starter Buttons
2929

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.
3131

3232
Use `starters` to enable starter buttons.
3333

@@ -49,10 +49,10 @@ Use `starters` to enable starter buttons.
4949

5050
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.
5151

52-
### Apps & Models
52+
### Apps & Models as Tools
5353

5454
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
5656
specific applications/models by their IDs or use groups of [conditions](#conditions) to dynamically match applications/models based on specific properties.
5757

5858
| Field | Type | Required | Description | Example |
@@ -72,7 +72,7 @@ specific applications/models by their IDs or use groups of [conditions](#conditi
7272
##### Conditions
7373

7474
`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.
7676

7777
##### Example in which two tools are enabled RAG and Copilot Deck App
7878

@@ -139,7 +139,7 @@ You can match applications/models based on these properties:
139139

140140
Your application can use external tools that can be invoked outside of the Quick app application. Include the `client_toolset` property to enable this.
141141

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`.
143143
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.
144144

145145
##### Example
@@ -223,7 +223,7 @@ Each `WebApiToolsetInfo` object has the following structure:
223223

224224
| Field | Type | Required | Description |
225225
|------------------|--------------------------------------------------------------|:----------:|------------------------------------------------|
226-
| `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. |
227227
| `auth_info` | `WebApiToolsetKeyAuthInfo` or null | Yes | Authentication configuration for the endpoints. Refer to [API Key Authentication](#api-key-authentication) for details. |
228228

229229
##### Tool Endpoints Definition
@@ -330,7 +330,10 @@ Provide these parameters to configure authentication for the web API endpoints.
330330

331331
### RAG Integration
332332

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:
334337

335338
1. Direct application to use the RAG tool to retrieve relevant information.
336339
2. Explicitly state to use only the information found in the documents.

0 commit comments

Comments
 (0)