Skip to content

Commit f4e2897

Browse files
authored
Merge pull request #162 from Azure-Samples/gk/prompt-engineering-notebook
2 parents 5f909fa + e03bb84 commit f4e2897

File tree

6 files changed

+21
-6
lines changed

6 files changed

+21
-6
lines changed

assets/images/wip-azure.png

3.75 KB
Loading

services/recommendation-service/dotnet/Plugins/AdvisorPlugin/InvestmentAdvise/skprompt.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This is a chat between systems that respond in valid JSON. You are a financial a
1111
Provide advice based on the given portfolio allocation and user information such as a age, income, and risk.
1212
For someone who is {{UserProfilePlugin.GetUserAge $userId}} years old, with {{UserProfilePlugin.GetAnnualHouseholdIncome $userId}} as household income, and with a risk tolerance of {{$risk}}, what recommendation would {{$voice}} give.
1313
Return well-formed JSON with a "gptRecommendation" property containing {{$voice}}'s' recommendation in a creative and funny tone.
14-
Example: {"portfolio":[{"symbol":"MSFT","gptRecommendation":"Booyah! Hold on, steady growth! Diversify, though!"},{"symbol":"PEP","gptRecommendation":"Buy, buy, buy! Solid dividends, sweet stability!"}]}
14+
Example: {"portfolio":[{"symbol":"META","gptRecommendation":"Booyah! Hold on, steady growth! Diversify, though!"},{"symbol":"BRK","gptRecommendation":"Buy, buy, buy! Solid dividends, sweet stability!"}]}
1515

1616
current inflation and mortgage rates: {{$bingResults}}
1717

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"sdk": {
3+
"version": "7.0.0",
4+
"rollForward": "latestMajor",
5+
"allowPrerelease": true
6+
}
7+
}

ui/typescript/src/components/personalize/personalize-drawer.tsx

+11-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
assetsDataAtom,
2020
investmentsDataAtom,
2121
loadingPersonalizeAtom,
22-
selectedAdvisorAtom,
22+
selectedAdvisorAtom, selectedRiskLevelAtom,
2323
userInfoAtom
2424
} from "@/data/personalize/store";
2525
import {formatRequestData} from "@/data/utils/format-request-data";
@@ -53,18 +53,25 @@ export default function PersonalizeDrawer() {
5353
const [loadingPersonalize, setLoadingPersonalizeAtom] = useAtom(loadingPersonalizeAtom);
5454

5555
const [userInfo] = useAtom(userInfoAtom);
56+
const [currentRiskLevel] = useAtom(selectedRiskLevelAtom);
57+
const [currentFavoriteAdvisor] = useAtom(selectedAdvisorAtom);
5658
const [investmentsInfo, setInvestmentsDataAtom] = useAtom(investmentsDataAtom);
5759
const [assetsInfo, setAssetsDataAtom] = useAtom(assetsDataAtom);
5860

5961
const handlePersonalize = async () => {
6062
setLoadingPersonalizeAtom(true);
6163
try {
62-
// Format data from assetsInfo and investmentsInfo
6364
const { portfolio, stocks } = formatRequestData(assetsInfo, investmentsInfo);
6465

65-
// Fetch data from atoms
66+
const updatedUserInfo = {
67+
...userInfo,
68+
riskLevel: currentRiskLevel.name,
69+
favoriteAdvisor: currentFavoriteAdvisor.name,
70+
};
71+
72+
// Create the requestData object
6673
const requestData = {
67-
userInfo,
74+
userInfo: updatedUserInfo,
6875
portfolio,
6976
stocks,
7077
};

ui/typescript/src/components/personalize/selectors/fin-advisor-list.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export function FinancialAdvisorList({
1616
className?: string;
1717
}) {
1818
const [selectedItem, setSelectedAdvisorAtom] = useAtom(selectedAdvisorAtom);
19+
1920
return (
2021
<div className="relative w-full lg:w-auto">
2122
<Listbox value={selectedItem} onChange={setSelectedAdvisorAtom}>

ui/typescript/src/data/static/personalize.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ export const AdvisorsList = [
2222
export const ReasoningEngineListData = [
2323
{id: 1, name: 'GPT-35-turbo'},
2424
{id: 2, name: 'Fine-tuned Llama-2-7B'},
25-
{id: 3, name: 'Llama-2-13B'},
25+
{id: 3, name: 'GPT-4'},
2626
];

0 commit comments

Comments
 (0)