-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add genAiFunction bundle type W-17750901 (#1499)
* fix: add genAiFunction bundle type * test: add UT * test: add snapshot files
- Loading branch information
1 parent
b88281c
commit fcf6662
Showing
14 changed files
with
317 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
8 changes: 8 additions & 0 deletions
8
...mKnowledgeAction_1738700253695/CustomKnowledgeAction_1738700253695.genAiFunction-meta.xml
This file contains 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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<GenAiFunction xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<description>Answers questions about company policies and procedures, troubleshooting steps, or product information. For example: “What is your return policy?” “How do I fix an issue?” or “What features does a product have?”</description> | ||
<invocationTarget>knowledgeSearch</invocationTarget> | ||
<invocationTargetType>standardInvocableAction</invocationTargetType> | ||
<isConfirmationRequired>false</isConfirmationRequired> | ||
<masterLabel>CustomKnowledgeAction_1738700253695</masterLabel> | ||
</GenAiFunction> |
53 changes: 53 additions & 0 deletions
53
...fy-md-files.expected/genAiFunctions/CustomKnowledgeAction_1738700253695/input/schema.json
This file contains 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,53 @@ | ||
{ | ||
"required": ["query"], | ||
"unevaluatedProperties": false, | ||
"properties": { | ||
"query": { | ||
"title": "Query", | ||
"description": "Required. A string created by generative AI to be used in the knowledge article search.", | ||
"const": "", | ||
"lightning:type": "lightning__textType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": true | ||
}, | ||
"citationsUrl": { | ||
"title": "Citations Url", | ||
"description": "The URL to use for citations for custom Agents.", | ||
"const": "", | ||
"lightning:type": "lightning__textType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": true | ||
}, | ||
"ragFeatureConfigId": { | ||
"title": "RAG Feature Configuration Id", | ||
"description": "The RAG Feature ID to use for grounding this copilot action invocation.", | ||
"const": "", | ||
"lightning:type": "lightning__textType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": true | ||
}, | ||
"citationsEnabled": { | ||
"title": "Citations Enabled", | ||
"description": "Whether or not citations are enabled.", | ||
"const": false, | ||
"lightning:type": "lightning__booleanType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": true | ||
}, | ||
"mode": { | ||
"title": "The mode to run in.", | ||
"description": "The mode to use (Professor/Smart/Basic). Determines which prompt template to use.", | ||
"lightning:type": "lightning__textType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": false | ||
}, | ||
"retrieverMode": { | ||
"title": "The retriever mode to use.", | ||
"description": "The retriever mode to use (Simple/Augmented). Determines whether to do query regeneration", | ||
"lightning:type": "lightning__textType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": false | ||
} | ||
}, | ||
"lightning:type": "lightning__objectType" | ||
} |
14 changes: 14 additions & 0 deletions
14
...y-md-files.expected/genAiFunctions/CustomKnowledgeAction_1738700253695/output/schema.json
This file contains 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,14 @@ | ||
{ | ||
"unevaluatedProperties": false, | ||
"properties": { | ||
"knowledgeSummary": { | ||
"title": "Knowledge Summary", | ||
"description": "A string formatted as rich text that includes a summary of the information retrieved from the knowledge articles and citations to those articles.", | ||
"lightning:type": "lightning__richTextType", | ||
"lightning:isPII": false, | ||
"copilotAction:isDisplayable": true, | ||
"copilotAction:isUsedByPlanner": true | ||
} | ||
}, | ||
"lightning:type": "lightning__objectType" | ||
} |
8 changes: 8 additions & 0 deletions
8
...snapshot/sampleProjects/genAiFunctions/__snapshots__/verify-md-files.expected/package.xml
This file contains 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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Package xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<types> | ||
<members>force-app</members> | ||
<name>GenAiFunction</name> | ||
</types> | ||
<version>59.0</version> | ||
</Package> |
8 changes: 8 additions & 0 deletions
8
...mKnowledgeAction_1738700253695/CustomKnowledgeAction_1738700253695.genAiFunction-meta.xml
This file contains 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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<GenAiFunction xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<description>Answers questions about company policies and procedures, troubleshooting steps, or product information. For example: “What is your return policy?” “How do I fix an issue?” or “What features does a product have?”</description> | ||
<invocationTarget>knowledgeSearch</invocationTarget> | ||
<invocationTargetType>standardInvocableAction</invocationTargetType> | ||
<isConfirmationRequired>false</isConfirmationRequired> | ||
<masterLabel>CustomKnowledgeAction_1738700253695</masterLabel> | ||
</GenAiFunction> |
53 changes: 53 additions & 0 deletions
53
...rce-app/main/default/genAiFunctions/CustomKnowledgeAction_1738700253695/input/schema.json
This file contains 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,53 @@ | ||
{ | ||
"required": ["query"], | ||
"unevaluatedProperties": false, | ||
"properties": { | ||
"query": { | ||
"title": "Query", | ||
"description": "Required. A string created by generative AI to be used in the knowledge article search.", | ||
"const": "", | ||
"lightning:type": "lightning__textType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": true | ||
}, | ||
"citationsUrl": { | ||
"title": "Citations Url", | ||
"description": "The URL to use for citations for custom Agents.", | ||
"const": "", | ||
"lightning:type": "lightning__textType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": true | ||
}, | ||
"ragFeatureConfigId": { | ||
"title": "RAG Feature Configuration Id", | ||
"description": "The RAG Feature ID to use for grounding this copilot action invocation.", | ||
"const": "", | ||
"lightning:type": "lightning__textType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": true | ||
}, | ||
"citationsEnabled": { | ||
"title": "Citations Enabled", | ||
"description": "Whether or not citations are enabled.", | ||
"const": false, | ||
"lightning:type": "lightning__booleanType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": true | ||
}, | ||
"mode": { | ||
"title": "The mode to run in.", | ||
"description": "The mode to use (Professor/Smart/Basic). Determines which prompt template to use.", | ||
"lightning:type": "lightning__textType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": false | ||
}, | ||
"retrieverMode": { | ||
"title": "The retriever mode to use.", | ||
"description": "The retriever mode to use (Simple/Augmented). Determines whether to do query regeneration", | ||
"lightning:type": "lightning__textType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": false | ||
} | ||
}, | ||
"lightning:type": "lightning__objectType" | ||
} |
14 changes: 14 additions & 0 deletions
14
...ce-app/main/default/genAiFunctions/CustomKnowledgeAction_1738700253695/output/schema.json
This file contains 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,14 @@ | ||
{ | ||
"unevaluatedProperties": false, | ||
"properties": { | ||
"knowledgeSummary": { | ||
"title": "Knowledge Summary", | ||
"description": "A string formatted as rich text that includes a summary of the information retrieved from the knowledge articles and citations to those articles.", | ||
"lightning:type": "lightning__richTextType", | ||
"lightning:isPII": false, | ||
"copilotAction:isDisplayable": true, | ||
"copilotAction:isUsedByPlanner": true | ||
} | ||
}, | ||
"lightning:type": "lightning__objectType" | ||
} |
8 changes: 8 additions & 0 deletions
8
...mKnowledgeAction_1738700253695/CustomKnowledgeAction_1738700253695.genAiFunction-meta.xml
This file contains 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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<GenAiFunction xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<description>Answers questions about company policies and procedures, troubleshooting steps, or product information. For example: “What is your return policy?” “How do I fix an issue?” or “What features does a product have?”</description> | ||
<invocationTarget>knowledgeSearch</invocationTarget> | ||
<invocationTargetType>standardInvocableAction</invocationTargetType> | ||
<isConfirmationRequired>false</isConfirmationRequired> | ||
<masterLabel>CustomKnowledgeAction_1738700253695</masterLabel> | ||
</GenAiFunction> |
53 changes: 53 additions & 0 deletions
53
...ctions/originalMdapi/genAiFunctions/CustomKnowledgeAction_1738700253695/input/schema.json
This file contains 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,53 @@ | ||
{ | ||
"required": ["query"], | ||
"unevaluatedProperties": false, | ||
"properties": { | ||
"query": { | ||
"title": "Query", | ||
"description": "Required. A string created by generative AI to be used in the knowledge article search.", | ||
"const": "", | ||
"lightning:type": "lightning__textType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": true | ||
}, | ||
"citationsUrl": { | ||
"title": "Citations Url", | ||
"description": "The URL to use for citations for custom Agents.", | ||
"const": "", | ||
"lightning:type": "lightning__textType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": true | ||
}, | ||
"ragFeatureConfigId": { | ||
"title": "RAG Feature Configuration Id", | ||
"description": "The RAG Feature ID to use for grounding this copilot action invocation.", | ||
"const": "", | ||
"lightning:type": "lightning__textType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": true | ||
}, | ||
"citationsEnabled": { | ||
"title": "Citations Enabled", | ||
"description": "Whether or not citations are enabled.", | ||
"const": false, | ||
"lightning:type": "lightning__booleanType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": true | ||
}, | ||
"mode": { | ||
"title": "The mode to run in.", | ||
"description": "The mode to use (Professor/Smart/Basic). Determines which prompt template to use.", | ||
"lightning:type": "lightning__textType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": false | ||
}, | ||
"retrieverMode": { | ||
"title": "The retriever mode to use.", | ||
"description": "The retriever mode to use (Simple/Augmented). Determines whether to do query regeneration", | ||
"lightning:type": "lightning__textType", | ||
"lightning:isPII": false, | ||
"copilotAction:isUserInput": false | ||
} | ||
}, | ||
"lightning:type": "lightning__objectType" | ||
} |
14 changes: 14 additions & 0 deletions
14
...tions/originalMdapi/genAiFunctions/CustomKnowledgeAction_1738700253695/output/schema.json
This file contains 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,14 @@ | ||
{ | ||
"unevaluatedProperties": false, | ||
"properties": { | ||
"knowledgeSummary": { | ||
"title": "Knowledge Summary", | ||
"description": "A string formatted as rich text that includes a summary of the information retrieved from the knowledge articles and citations to those articles.", | ||
"lightning:type": "lightning__richTextType", | ||
"lightning:isPII": false, | ||
"copilotAction:isDisplayable": true, | ||
"copilotAction:isUsedByPlanner": true | ||
} | ||
}, | ||
"lightning:type": "lightning__objectType" | ||
} |
9 changes: 9 additions & 0 deletions
9
test/snapshot/sampleProjects/genAiFunctions/sfdx-project.json
This file contains 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,9 @@ | ||
{ | ||
"packageDirectories": [ | ||
{ | ||
"default": true, | ||
"path": "force-app" | ||
} | ||
], | ||
"sourceApiVersion": "59.0" | ||
} |
52 changes: 52 additions & 0 deletions
52
test/snapshot/sampleProjects/genAiFunctions/snapshot.test.ts
This file contains 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,52 @@ | ||
/* | ||
* Copyright (c) 2023, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
import * as fs from 'node:fs'; | ||
import * as path from 'node:path'; | ||
import { | ||
FORCE_APP, | ||
dirsAreIdentical, | ||
fileSnap, | ||
mdapiToSource, | ||
sourceToMdapi, | ||
MDAPI_OUT, | ||
} from '../../helper/conversions'; | ||
|
||
// we don't want failing tests outputting over each other | ||
/* eslint-disable no-await-in-loop */ | ||
|
||
describe('genAiFunctions', () => { | ||
const testDir = path.join('test', 'snapshot', 'sampleProjects', 'genAiFunctions'); | ||
let sourceFiles: string[]; | ||
let mdFiles: string[]; | ||
|
||
before(async () => { | ||
await fs.promises.mkdir(path.join(testDir, FORCE_APP), { recursive: true }); | ||
sourceFiles = await mdapiToSource(testDir); | ||
mdFiles = await sourceToMdapi(testDir); | ||
}); | ||
it('verify source files', async () => { | ||
for (const file of sourceFiles) { | ||
await fileSnap(file, testDir); | ||
} | ||
await dirsAreIdentical( | ||
path.join(testDir, FORCE_APP), | ||
path.join(testDir, '__snapshots__', 'verify-source-files.expected', FORCE_APP) | ||
); | ||
}); | ||
it('verify md files', async () => { | ||
for (const file of mdFiles) { | ||
await fileSnap(file, testDir); | ||
} | ||
}); | ||
|
||
after(async () => { | ||
await Promise.all([ | ||
fs.promises.rm(path.join(testDir, FORCE_APP), { recursive: true, force: true }), | ||
fs.promises.rm(path.join(testDir, MDAPI_OUT), { recursive: true, force: true }), | ||
]); | ||
}); | ||
}); |
This file contains 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