-
Notifications
You must be signed in to change notification settings - Fork 22
MMI-3387 Add AI report summary #2541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+9,713
−218
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+2.03 MB
...core-npm-1.0.29-b0ccc3fe82-277dacbb50.zip → ...core-npm-1.0.31-a8a0b59ae3-57f0f47bb6.zip
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -364,6 +364,14 @@ | |
| @(section.Value.Data) | ||
| </div> | ||
| } | ||
| else if (section.Value.SectionType == ReportSectionType.AI) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We now have a new section in the report |
||
| { | ||
| @* AI SECTION *@ | ||
| var alt = section.Value.Settings.Label; | ||
| <div> | ||
| @(section.Value.Data) | ||
| </div> | ||
| } | ||
|
|
||
| @if (!horizontalCharts && !endChartGroup) | ||
| { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
app/editor/src/features/admin/reports/components/ReportSectionAI.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| import { useFormikContext } from 'formik'; | ||
| import { Checkbox, Col, FieldSize, FormikText, FormikTextArea, IReportModel, Row } from 'tno-core'; | ||
|
|
||
| export interface IReportSectionAIProps { | ||
| index: number; | ||
| } | ||
|
|
||
| export const ReportSectionAI = ({ index }: IReportSectionAIProps) => { | ||
| const { values, setFieldValue } = useFormikContext<IReportModel>(); | ||
|
|
||
| return ( | ||
| <Col gap="1rem" className="section"> | ||
| <FormikText | ||
| name={`sections.${index}.settings.label`} | ||
| label="Heading" | ||
| tooltip="A heading label to display at the beginning of the section" | ||
| maxLength={100} | ||
| /> | ||
| <FormikTextArea | ||
| name={`sections.${index}.description`} | ||
| label="Description" | ||
| tooltip="Describe the purpose of this section" | ||
| placeholder="An AI summary of the report" | ||
| /> | ||
| <Row> | ||
| <FormikText | ||
| name={`sections.${index}.settings.deploymentName`} | ||
| label="Model Deployment Name" | ||
| tooltip="The name of the model deployment" | ||
| maxLength={100} | ||
| placeholder="gpt-5.1-chat" | ||
| /> | ||
| <FormikText | ||
| name={`sections.${index}.settings.temperature`} | ||
| label="Temperature" | ||
| tooltip="Apply randomness to responses. Depending on the model it may support values 0 - 2. Lower is more deterministic. Higher is creative." | ||
| type="number" | ||
| width={FieldSize.Tiny} | ||
| placeholder="0" | ||
| onChange={(e: React.ChangeEvent<HTMLInputElement>) => { | ||
| let value = e.target.value; | ||
| setFieldValue( | ||
| `sections.${index}.settings.temperature`, | ||
| value.trim() === '' ? undefined : +value, | ||
| ); | ||
| console.debug(value); | ||
| }} | ||
| /> | ||
| <FormikText | ||
| name={`sections.${index}.settings.choiceQty`} | ||
| label="Choices" | ||
| tooltip="Number of responses you want provided to compare. Some models do not have this feature." | ||
| type="number" | ||
| width={FieldSize.Tiny} | ||
| placeholder="1" | ||
| onChange={(e: React.ChangeEvent<HTMLInputElement>) => { | ||
| let value = e.target.value; | ||
| setFieldValue( | ||
| `sections.${index}.settings.choiceQty`, | ||
| value.trim() === '' ? undefined : +value, | ||
| ); | ||
| console.debug(value); | ||
| }} | ||
| /> | ||
| </Row> | ||
| <FormikTextArea | ||
| name={`sections.${index}.settings.systemPrompt`} | ||
| label="System Prompt" | ||
| tooltip="Sets the global instructions and behavior for the model." | ||
| placeholder="You are a report writer. Review the report data and generate summaries and analysis. The report data is JSON, each section groups related content and contains an array of story records. The `content.text` property contains the story information. The output generated must be in simple HTML that works within Outlook email client. Place all the output in a <div>\{output\}</div>." | ||
| /> | ||
| <FormikTextArea | ||
| name={`sections.${index}.settings.userPrompt`} | ||
| label="User Prompt" | ||
| tooltip="Represents end-user input — questions, instructions, data, or prompts." | ||
| placeholder="Create an executive summary of the report data." | ||
| /> | ||
| <Checkbox | ||
| name={`sections.${index}.settings.inTableOfContents`} | ||
| label="Include in Table of Contents" | ||
| checked={ | ||
| values.sections[index].settings.inTableOfContents === undefined | ||
| ? true | ||
| : values.sections[index].settings.inTableOfContents | ||
| } | ||
| onChange={(e) => { | ||
| setFieldValue(`sections.${index}.settings.inTableOfContents`, e.target.checked); | ||
| }} | ||
| /> | ||
| </Col> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+2.03 MB
...core-npm-1.0.29-b0ccc3fe82-277dacbb50.zip → ...core-npm-1.0.31-a8a0b59ae3-57f0f47bb6.zip
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes security warnings