[@Powerpages Copilot] Context Improvement for Webpage #1016
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.
This pull request introduces several enhancements to the
PowerPagesChatParticipant
class and related utilities, focusing on managing and fetching related files for a given context. The most important changes include adding support for fetching related files based on the active file's context, updating schemas for file extensions, and modifying API requests to include related files.Enhancements to file management:
src/common/utilities/Utils.ts
: Added functionsgetFileContent
,getFileContentByType
, andfetchRelatedFiles
to manage and fetch related files based on the active file's context.Schema updates:
src/common/constants.ts
: DefinedcomponentTypeSchema
andrelatedFilesSchema
to map file types and their extensions, and added an interfaceIRelatedFiles
for related files.API request modifications:
src/common/copilot/IntelligenceApiService.ts
: UpdatedsendApiRequest
to include an optionalRelatedFiles
parameter and modified the request payload to include related files. [1] [2]Class updates:
src/common/chat-participants/powerpages/PowerPagesChatParticipant.ts
: Integrated thefetchRelatedFiles
function to fetch and include related files in the API request within thePowerPagesChatParticipant
class. [1] [2]Minor updates:
src/common/copilot/constants.ts
: Addedcss
to theFieldTypeMap
.src/common/chat-participants/powerpages/PowerPagesChatParticipantUtils.ts
.