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: content/en/docs/appstore/use-content/platform-supported-content/modules/genai/genai-commons.md
+48-7Lines changed: 48 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ Developers who want to connect to another LLM provider or their own service are
18
18
19
19
### Limitations {#limitations}
20
20
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.
22
22
23
23
### Dependencies {#dependencies}
24
24
@@ -28,13 +28,13 @@ You must also download the [Community Commons](/appstore/modules/community-commo
28
28
29
29
## Installation {#installation}
30
30
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.
32
32
33
33
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.
34
34
35
35
## Implementation {#implementation}
36
36
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.
38
38
39
39
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.
40
40
@@ -50,21 +50,60 @@ Lasty, the [Conversational UI module](/appstore/modules/genai/conversational-ui/
50
50
51
51
## Technical Reference {#technical-reference}
52
52
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.
54
54
55
55
### Domain Model {#domain-model}
56
56
57
57
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.
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.
62
64
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.
64
66
65
67
| Attribute | Description |
66
68
| --- | --- |
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.
68
107
69
108
#### `Request` {#request}
70
109
@@ -148,7 +187,9 @@ The response returned by the model contains usage metrics as well as a response
148
187
|`RequestTokens`| Number of tokens in the request. |
149
188
|`ResponseTokens`| Number of tokens in the generated response. |
150
189
|`TotalTokens`| Total number of tokens (request + response). |
190
+
|`DurationMilliseconds`| Duration in milliseconds for the call to the LLM to be finished. |
151
191
|`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. |
0 commit comments