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/marketplace/genai/reference-guide/genai-commons.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,27 +41,27 @@ Although GenAI Commons technically defines additional capabilities typically fou
41
41
42
42
### Token Usage
43
43
44
-
GenAI Commons can help store usage data which allows admins to understand the token usage. Usage data is only persisted if the constant `StoreUsageMetrics` is set to `true` (exception: if [StoreTraces](#traceability) is set to `true`, Usages data is stored as well). In general, this is only supported for chat completions and embedding operations.
44
+
GenAI Commons can help store usage data which allows admins to understand the token usage. Usage data is persisted only if the constant `StoreUsageMetrics` is set to *true* (exception: if [StoreTraces](#traceability) is set to *true*, Usages data is stored as well). In general, this is only supported for chat completions and embedding operations.
45
45
46
46
To clean up usage data in a deployed app, you can enable the daily scheduled event `ScE_Usage_Cleanup` in the Mendix Cloud Portal. Use the `Usage_CleanUpAfterDays` constant to control for how long token usage data should be persisted.
47
47
48
48
Lastly, the [Conversational UI module](/appstore/modules/genai/conversational-ui/) provides pages, snippets, and logic to display and export token usage information. For this to work, the module roles `UsageMonitoring` from both Conversational UI as well as GenAI Commons need to be assigned to the applicable project roles.
49
49
50
50
### Traceability {#traceability}
51
51
52
-
The chat completions operations of GenAI Commons store data for traceability reasons in your application's database by default. This helps to understand the usage of GenAI in your app and why the model behaved in certain ways, for example by reviewing the usage of tools. Trace data is only persisted if the constant `StoreTraces` is set to `true`.
52
+
By default, the chat completions operations of GenAI Commons store data in your application's database for traceability reasons. This makes it easier understand the usage of GenAI in your app and why the model behaved in certain way, for example, by reviewing tool usage. Trace data is only persisted if the constant `StoreTraces` is set to *true*.
53
53
54
-
As traces may contain sensitive and personally-identifiable information, it should be decided per use case whether it is compliant to store such data.
54
+
As traces may contain sensitive and personallyidentifiable information, you should decide per use case whether storing this data is compliant.
55
55
56
-
To clean up traces data in a deployed app, you can enable the daily scheduled event `ScE_Trace_Cleanup` in the Mendix Cloud Portal. Use the `Trace_CleanUpAfterDays` constant to control for how long trace data should be persisted.
56
+
To clean up trace data in a deployed app, you can enable the daily scheduled event `ScE_Trace_Cleanup` in the [Mendix Cloud Portal](https://genai.home.mendix.com/). Use the `Trace_CleanUpAfterDays` constant to control the retention period of the trace data.
57
57
58
-
There are currently no out of the box UI snippets or building blocks available. In a future release those will be covered. For now, you can just add a data grid to a page of your choice to display them. To enable read-access to a user (typically an admin user), the module role `TraceMonitoring` needs to be granted to the applicable project roles.
58
+
Currently, there are no out of the box UI snippets or building blocks available to view the traces. A future release will include them. For now, you can just add a data grid to any page to display the data. To enable read-access to a user (typically an admin user), grant the module role `TraceMonitoring` to the applicable project roles.
59
59
60
60
## Technical Reference {#technical-reference}
61
61
62
62
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) to use in your application.
63
63
64
-
### Domain Model {#domain-model}
64
+
### Domain Model {#domain-model}
65
65
66
66
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 [Data in 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.
67
67
@@ -111,7 +111,7 @@ Accepted input modality of the associated deployed model.
111
111
112
112
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 processing of function calls), everything should be aggregated into one Usage record.
113
113
114
-
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 to text & file operations and embedding operations.
114
+
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 to text and file operations and embedding operations.
115
115
116
116
The data stored in this entity is to be used later on for token consumption monitoring.
117
117
@@ -143,7 +143,7 @@ The data stored in this entity is to be used later on for traceability use cases
143
143
144
144
#### `Span` {#span}
145
145
146
-
A span is created for each interaction between Mendix and the LLM (chat completions, tool calling, ...). The generalized object is usually not used, but only it's specializations.
146
+
A span is created for each interaction between Mendix and the LLM (such as chat completions, tool calling, etc.). The generalized object is typically not used instead, its specializations are used.
147
147
148
148
| Attribute | Description |
149
149
| --- | --- |
@@ -155,13 +155,13 @@ A span is created for each interaction between Mendix and the LLM (chat completi
155
155
156
156
#### `ModelSpan` {#model-span}
157
157
158
-
A model span is created for each interaction between Mendix and the LLM where content is generated (sent as the assistant's message). Typically, this is requests for text generation. In addition to the [Span's](#span) attributes, it also contains the following:
158
+
A model span is created for each interaction between Mendix and the LLM where content is generated (sent as the assistant's message). Typically, this is request for text generation. In addition to the [Span's](#span) attributes, it also contains the following:
159
159
160
160
| Attribute | Description |
161
161
| --- | --- |
162
162
|`InputTokens`| Number of tokens in the request. |
163
163
|`OutputTokens`| Number of tokens in the generated response. |
164
-
|`_DeploymentIdentifier`| Internal object used to identify the DeployedModel that was used. |
164
+
|`_DeploymentIdentifier`| Internal object used to identify the `DeployedModel` that was used. |
165
165
166
166
#### `ToolSpan` {#tool-span}
167
167
@@ -170,7 +170,7 @@ A tool span is created for each tool call requested by the LLM. The tool call is
170
170
| Attribute | Description |
171
171
| --- | --- |
172
172
|`ToolName`| The name of the tool that was called. |
173
-
|`_ToolCallId`| The id of the tool call used by the model to map an assistant message containing a tool call with the output of the tool call (tool message). |
173
+
|`_ToolCallId`| The ID of the tool call used by the model to map an assistant message containing a tool call with the output of the tool call (tool message). |
174
174
|`Input`| The input of the tool call as passed by the LLM. |
175
175
|`IsError`| Indicates if the tool call failed. If so, the span's output will contain the error message that was also logged and sent to the LLM as tool result. |
176
176
@@ -197,7 +197,7 @@ The `Request` is an input object for the chat completions operations defined in
197
197
|`Temperature`|`Temperature` controls the randomness of the model response. Low values generate a more predictable output, while higher values allow creativity and diversity. It is recommended to steer either the temperature or `TopP`, but not both. |
198
198
|`TopP`|`TopP` is an alternative to temperature for controlling the randomness of the model response. `TopP` defines a probability threshold so that only words with probabilities greater than or equal to the threshold will be included in the response. It is recommended to steer either the temperature or `TopP`, but not both. |
199
199
|`ToolChoice`| Controls which (if any) tool is called by the model. For more information, see the [ENUM_ToolChoice](#enum-toolchoice) section containing a description of the possible values. |
200
-
|`_AgentVersionId`| The AgentVersionId is set if the execution of the request was called from an Agent. |
200
+
|`_AgentVersionId`| The `AgentVersionId` is set if the execution of the request was called from an Agent. |
0 commit comments