Skip to content

Commit

Permalink
Merge branch 'main' into ap/docs-and-iaac
Browse files Browse the repository at this point in the history
  • Loading branch information
thegovind committed Oct 30, 2023
2 parents 51a90d6 + 24a8c69 commit 002c6d8
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 17 deletions.
Binary file modified assets/images/copilot-stack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/wip-azure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This is a chat between systems that respond in valid JSON. You are a financial a
Provide advice based on the given portfolio allocation and user information such as a age, income, and risk.
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.
Return well-formed JSON with a "gptRecommendation" property containing {{$voice}}'s' recommendation in a creative and funny tone.
Example: {"portfolio":[{"symbol":"MSFT","gptRecommendation":"Booyah! Hold on, steady growth! Diversify, though!"},{"symbol":"PEP","gptRecommendation":"Buy, buy, buy! Solid dividends, sweet stability!"}]}
Example: {"portfolio":[{"symbol":"META","gptRecommendation":"Booyah! Hold on, steady growth! Diversify, though!"},{"symbol":"BRK","gptRecommendation":"Buy, buy, buy! Solid dividends, sweet stability!"}]}

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

Expand Down
7 changes: 7 additions & 0 deletions services/recommendation-service/dotnet/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sdk": {
"version": "7.0.0",
"rollForward": "latestMajor",
"allowPrerelease": true
}
}
19 changes: 10 additions & 9 deletions ui/typescript/src/components/chat/chat-message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,39 @@ import {ChatProps} from "@/types";

export default function ChatMessage({ chat }: { chat: ChatProps }) {
const {
userName,
authorRole,
content
} = chat ?? {};

return (
<div className="chat-content">
<div className={cn('flex items-end ', {
'justify-end':
userName !== Chats[0].userName,
authorRole !== Chats[0].authorRole,
})}>
<div className={cn('flex flex-col space-y-2 text-xs max-w-xs mx-2 order-2 ', {
'items-end':
userName !== Chats[0].userName,
authorRole !== Chats[0].authorRole,
'items-start':
userName == Chats[0].userName,
authorRole === Chats[0].authorRole,
})}>
<div><span
className={cn('px-4 py-2 rounded-lg inline-block ', {
'rounded-br-none bg-blue-600 text-white':
userName !== Chats[0].userName,
authorRole !== Chats[0].authorRole,
'rounded-bl-none bg-gray-300 text-gray-600':
userName == Chats[0].userName,
authorRole === Chats[0].authorRole,
})}>{content}</span>
</div>
</div>
<Image
width={10} height={10}
src={(userName == Chats[0].userName) ? miyagilogo : usericon}
src={(authorRole == Chats[0].authorRole) ? miyagilogo : usericon}
alt="Actor" className={cn('w-6 h-6 rounded-full ', {
'order-2':
userName !== Chats[0].userName,
authorRole !== Chats[0].authorRole,
'order-1':
userName == Chats[0].userName,
authorRole === Chats[0].authorRole,
})} />
</div>
</div>
Expand Down
15 changes: 11 additions & 4 deletions ui/typescript/src/components/personalize/personalize-drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
assetsDataAtom,
investmentsDataAtom,
loadingPersonalizeAtom,
selectedAdvisorAtom,
selectedAdvisorAtom, selectedRiskLevelAtom,
userInfoAtom
} from "@/data/personalize/store";
import {formatRequestData} from "@/data/utils/format-request-data";
Expand Down Expand Up @@ -53,18 +53,25 @@ export default function PersonalizeDrawer() {
const [loadingPersonalize, setLoadingPersonalizeAtom] = useAtom(loadingPersonalizeAtom);

const [userInfo] = useAtom(userInfoAtom);
const [currentRiskLevel] = useAtom(selectedRiskLevelAtom);
const [currentFavoriteAdvisor] = useAtom(selectedAdvisorAtom);
const [investmentsInfo, setInvestmentsDataAtom] = useAtom(investmentsDataAtom);
const [assetsInfo, setAssetsDataAtom] = useAtom(assetsDataAtom);

const handlePersonalize = async () => {
setLoadingPersonalizeAtom(true);
try {
// Format data from assetsInfo and investmentsInfo
const { portfolio, stocks } = formatRequestData(assetsInfo, investmentsInfo);

// Fetch data from atoms
const updatedUserInfo = {
...userInfo,
riskLevel: currentRiskLevel.name,
favoriteAdvisor: currentFavoriteAdvisor.name,
};

// Create the requestData object
const requestData = {
userInfo,
userInfo: updatedUserInfo,
portfolio,
stocks,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export function FinancialAdvisorList({
className?: string;
}) {
const [selectedItem, setSelectedAdvisorAtom] = useAtom(selectedAdvisorAtom);

return (
<div className="relative w-full lg:w-auto">
<Listbox value={selectedItem} onChange={setSelectedAdvisorAtom}>
Expand Down
2 changes: 1 addition & 1 deletion ui/typescript/src/data/static/personalize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ export const AdvisorsList = [
export const ReasoningEngineListData = [
{id: 1, name: 'GPT-35-turbo'},
{id: 2, name: 'Fine-tuned Llama-2-7B'},
{id: 3, name: 'Llama-2-13B'},
{id: 3, name: 'GPT-4'},
];
1 change: 1 addition & 0 deletions ui/typescript/src/data/static/user-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const UserInfo = {
"firstName": "Govind",
"lastName": "Kamtamneni",
"age": 50,
"authorRole": 0,
"riskLevel": "aggressive",
"annualHouseholdIncome": 80000,
"favoriteBook": "intelligent-investor",
Expand Down
3 changes: 1 addition & 2 deletions ui/typescript/src/layouts/sidebar/chat-blade.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ export default function Sidebar({ className, setSelectedSession, setUserInfoAtom
body: JSON.stringify({
input: userInput,
variables: [
{ key: 'userId', value: userInfo.userId },
{ key: 'userName', value: userInfo.userName },
{ key: 'messageType', value: userInfo.authorRole.toString() },
{ key: 'chatId', value: userInfo.chatId },
],
}),
Expand Down

0 comments on commit 002c6d8

Please sign in to comment.