Skip to content

Commit 0a6e62d

Browse files
committed
SAS-1050: added documentation for new entities and attributes; update domain model image
1 parent 1c421eb commit 0a6e62d

2 files changed

Lines changed: 48 additions & 7 deletions

File tree

content/en/docs/appstore/use-content/platform-supported-content/modules/genai/genai-commons.md

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Developers who want to connect to another LLM provider or their own service are
1818

1919
### Limitations {#limitations}
2020

21-
The current scope of the module is focused on text and image generation, as well as embeddings and knowledgebase use cases.
21+
The current scope of the module is focused on text and image generation, as well as embeddings and knowledge base use cases.
2222

2323
### Dependencies {#dependencies}
2424

@@ -28,13 +28,13 @@ You must also download the [Community Commons](/appstore/modules/community-commo
2828

2929
## Installation {#installation}
3030

31-
If you are starting from the [Blank GenAI app](https://marketplace.mendix.com/link/component/227934), or the [AI Bot Starter App](https://marketplace.mendix.com/link/component/227926), the GenAI Commons module is included and does not need to be downloaded manually.
31+
If you are starting from the [Blank GenAI app](https://marketplace.mendix.com/link/component/227934), or the [AI Bot Starter App](https://marketplace.mendix.com/link/component/227926), the GenAI Commons module is already included and does not need to be downloaded manually.
3232

3333
If you start from a blank app, or have an existing project where you want to include a connector for which the GenAI Commons module is a required module, you must install GenAI Commons manually. First, install the [Community commons](/appstore/modules/community-commons-function-library/) module, and then follow the instructions in [How to Use Marketplace Content](/appstore/use-content/) to import the GenAI Commons module into your app.
3434

3535
## Implementation {#implementation}
3636

37-
GenAI Commons is the foundation of chat completion implementations within the [OpenAI connector](/appstore/modules/genai/openai/) and the [Amazon Bedrock connector](/appstore/modules/genai/bedrock/), but may also be used to build other GenAI service implementations on top of it by reusing the provided domain model and exposed microflows.
37+
GenAI Commons is the foundation of large language model implementations within the [Mx GenAI connector](/appstore/modules/genai/MxGenAI/), [OpenAI connector](/appstore/modules/genai/openai/) and the [Amazon Bedrock connector](/appstore/modules/genai/bedrock/), but may also be used to build other GenAI service implementations on top of it by reusing the provided domain model and exposed actions.
3838

3939
Although GenAI Commons technically defines additional capabilities typically found in chat completion APIs, such as image processing (vision) and tools (function calling), it depends on the connector module of choice for whether these are actually implemented and supported by the LLM. To learn which additional capabilities a connector supports and for which models these can be used, refer to the documentation of that connector.
4040

@@ -50,21 +50,60 @@ Lasty, the [Conversational UI module](/appstore/modules/genai/conversational-ui/
5050

5151
## Technical Reference {#technical-reference}
5252

53-
The technical purpose of GenAI Commons module is to define a common domain model for generative AI use cases in Mendix applications. To help you work with the **GenAI Commons** module, the following sections list the available [entities](#domain-model), [enumerations](#enumerations), and [microflows](#microflows) that you can use in your application.
53+
The technical purpose of the GenAI Commons module is to define a common domain model for generative AI use cases in Mendix applications. To help you work with the **GenAI Commons** module, the following sections list the available [entities](#domain-model), [enumerations](#enumerations), and [microflows](#microflows) that you can use in your application.
5454

5555
### Domain Model {#domain-model}
5656

5757
The domain model in Mendix is a data model that describes the information in your application domain in an abstract way. For more general information, see the [Domain Model](/refguide/domain-model/) documentation. To learn about where the entities from the domain model are used and relevant during implementation, see the [Microflows](#microflows) section below.
5858

5959
{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/genaicommons/genai-commons-domain-model.png" alt="" >}}
6060

61-
#### `Connection` {#connection}
61+
#### `DeployedModel` {#deployed-model}
62+
63+
The `DeployedModel` represents a GenAI model that can be invoked by the Mendix app. It contains a display name and a technical name/identifier. It also contains the name of the microflow to be executed for the specified model and other information relevant to connect to a model.
6264

63-
The `Connection` entity contains specifications to interact with an AI provider.
65+
The `DeployedModel` entity replaces the capabilities that were coverd by the `Connection` entity in earlier versions of GenAI Commons.
6466

6567
| Attribute | Description |
6668
| --- | --- |
67-
| `Model` | The name of the model to be used for an operation. |
69+
| `DisplayName` | The display name of the deployed model. |
70+
| `Architecture` | The architecture of the deployed model; e.g. OpenAI or Amazon Bedrock. |
71+
| `Model` | The model identifier of the LLM provider. |
72+
| `OutputModality` | The type of information the model returns. |
73+
| `SupportsSystemPrompt` | An enum to specify if the model supports system prompts. |
74+
| `SupportsConversationsWithHistory` | An enum to specify if the model supports conversation with history. |
75+
| `SupportsFunctionCalling` | An enum to specify if the model supports function calling. |
76+
| `IsActive` | A boolean to specify if the model is active/usable with the current authentication settings and user preference. |
77+
78+
#### `InputModality` {#Usage}
79+
80+
Accepted input modality of the associated deployed model.
81+
82+
| Attribute | Description |
83+
| --- | --- |
84+
| `ModelModality` | The type of information the model accepts as input. |
85+
86+
#### `Usage` {#Usage}
87+
88+
This entity represents usage statistics of a call to an LLM. It refers to a complete LLM interaction; in case there are several iterations (e.g. recursive procesisng of function calls), everything should be aggregated into one Usage record.
89+
90+
Following the principles of GenAI Commons it must be stored based on the response for every successful call to a system of an LLM provider. This is only applicable for text & files operations and embeddings operations. It is the responsibility of connector developers implementing the GenAI principles in their GenAI operations to include the right microflows to ensure storage of Usage details after successful calls.
91+
92+
The data stored in this entity is to be used later on for monitoring purposes.
93+
94+
| Attribute | Description |
95+
| --- | --- |
96+
| `Architecture` | The architecture of the used deployed model; e.g. OpenAI or Amazon Bedrock. |
97+
| `DeployedModelDisplayName` | DisplayName of the DeployedModel. |
98+
| `InputTokens` | The amount of tokens consumed by an LLM call that is related to the input. |
99+
| `OutputTokens` | The amount of tokens consumed by an LLM call that is related to the output. |
100+
| `TotalTokens` | The total amount of tokens consumed by an LLM call. |
101+
| `DurationMilliseconds` | The duration in milliseconds of the technical part of the call to the system of the LLM provider. This excludes custom pre and postprocessing but corresponds to a complete LLM interaction. |
102+
| `_DeploymentIdentifier` | Internal object used to identify the DeployedModel used. |
103+
104+
#### `Connection` {#connection}
105+
106+
The Connection entity used to be an input parameter for Chat completions, Embeddings and Image Generation operations but got replaced by DeployedModel. It is currently only used as a general connection entity for KnowledgeBase interactions.
68107

69108
#### `Request` {#request}
70109

@@ -148,7 +187,9 @@ The response returned by the model contains usage metrics as well as a response
148187
| `RequestTokens` | Number of tokens in the request. |
149188
| `ResponseTokens` | Number of tokens in the generated response. |
150189
| `TotalTokens` | Total number of tokens (request + response). |
190+
| `DurationMilliseconds` | Duration in milliseconds for the call to the LLM to be finished. |
151191
| `StopReason` | The reason why the model stopped to generate further content. See AI provider documentation for possible values. |
192+
| `ResponseText` | The text content of the response message. |
152193

153194
#### `ToolCall` {#toolcall}
154195

34.1 KB
Loading

0 commit comments

Comments
 (0)