Skip to content

MMI-3387 Add AI report summary#2541

Merged
Fosol merged 1 commit intobcgov:devfrom
Fosol:mmi-3387
Jan 14, 2026
Merged

MMI-3387 Add AI report summary#2541
Fosol merged 1 commit intobcgov:devfrom
Fosol:mmi-3387

Conversation

@Fosol
Copy link
Collaborator

@Fosol Fosol commented Jan 13, 2026

We now have a way to include an AI Summary section in reports. This new feature uses Azure AI Foundry API.

Both the Editor and Subscriber applications now have a new AI section that can be added to a report. An administrator can choose the deployed AI model, temperature, system prompt and the user prompt. The content is added to the prompt and a summary can be generated. With this process we can ask AI to do almost anything.

Summary

  • Add DB migration 1.4.1
  • Published tno-core:1.0.31
  • Updated Editor app
  • Updated Subscriber app
  • Updated API
  • Updated Reporting Service

Editor Report Admin

image

Subscriber Report Admin

image

Publish tno-core:1.0.31
Add DB migration 1.4.1
@Fosol Fosol self-assigned this Jan 13, 2026
@Fosol Fosol added enhancement New feature or request DB Migration A DB Migration may require refreshing or simply updating your database. devops DevOps templates, documentation, configuration, tools. subscriber PR contains changes towards the subscriber application, tno-core update Indicates that there have been changes to our tno-core package, which can pose concurrency issues. editor labels Jan 13, 2026
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
<PackageReference Include="Microsoft.AspnetCore.Authentication.jwtBearer" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="5.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Core" Version="2.3.9" />
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes security warnings

@(section.Value.Data)
</div>
}
else if (section.Value.SectionType == ReportSectionType.AI)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now have a new section in the report

<FormikText name={`sections.${index}.settings.label`} label="Section heading:" />
</Col>
<Row>
{userInfo?.roles.includes(Claim.administrator) && (
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only display some of the options to administrators.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to the CustomReport.cshtml file changes to see what has changed.

podsFolderCollection=$(getPods folder-collection-service deployment $env)
podsContent=$(getPods content-service deployment $env)
podsIndexing=$(getPods indexing-service deployment $env)
if [ "$env" != "dev "]; then
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In DEV we don't have a cloud instance of Elasticsearch.

this.Logger.LogError("Failed to fetch data from {url}, {status}", url, response.StatusCode);
}
});
await GenerateReportDataSectionsAsync(report, sectionContent);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to separate function for maintainability.

/// <param name="sectionContent"></param>
/// <param name="pathToFiles"></param>
/// <returns></returns>
private async Task GenerateReportImageSectionsAsync(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change, just moved for clarity

/// <param name="report"></param>
/// <param name="sectionContent"></param>
/// <returns></returns>
private async Task GenerateReportDataSectionsAsync(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change, moved for clarity

/// <param name="sectionContent"></param>
/// <param name=""></param>
/// <returns></returns>
private async Task GenerateReportAISectionsAsync(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the new AI section. Note, we're using the raw API because the latest Nuget packages don't support API Key authentication.

foreach (var section in sectionContent.Where(sc => sc.Value.Content.Any()))
{
allContent.AppendLine($"#### {section.Value.Settings.Label}");
var sectionContentJson = section.Value.Content.Select(c => new
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We serialize only some of the content information to speed up the request processing.

@Fosol Fosol merged commit 4971757 into bcgov:dev Jan 14, 2026
3 checks passed
@Fosol Fosol deleted the mmi-3387 branch January 14, 2026 17:24
Fosol added a commit that referenced this pull request Jan 14, 2026
@Fosol Fosol restored the mmi-3387 branch January 16, 2026 18:33
Fosol added a commit to Fosol/tno that referenced this pull request Jan 23, 2026
Publish tno-core:1.0.31
Add DB migration 1.4.1
Fix linting
Fosol added a commit to Fosol/tno that referenced this pull request Jan 23, 2026
Publish tno-core:1.0.31
Add DB migration 1.4.1
Fix linting
Fosol added a commit to Fosol/tno that referenced this pull request Jan 23, 2026
Publish tno-core:1.0.31
Add DB migration 1.4.1
Fix linting
Fosol added a commit to Fosol/tno that referenced this pull request Jan 23, 2026
Publish tno-core:1.0.31
Add DB migration 1.4.1
Fix linting
Fosol added a commit to Fosol/tno that referenced this pull request Jan 23, 2026
Publish tno-core:1.0.31
Add DB migration 1.4.1
Fix linting
Fosol added a commit to Fosol/tno that referenced this pull request Jan 23, 2026
Publish tno-core:1.0.32
Add DB migration 1.4.1
Fix linting
Fosol added a commit that referenced this pull request Jan 23, 2026
Publish tno-core:1.0.32
Add DB migration 1.4.1
Fix linting
Fosol added a commit to Fosol/tno that referenced this pull request Jan 23, 2026
Publish tno-core:1.0.32
Add DB migration 1.4.1
Fix linting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DB Migration A DB Migration may require refreshing or simply updating your database. devops DevOps templates, documentation, configuration, tools. editor enhancement New feature or request subscriber PR contains changes towards the subscriber application, tno-core update Indicates that there have been changes to our tno-core package, which can pose concurrency issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant