Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2880,6 +2880,7 @@ ${amount} für ${merchant} – ${date}`,
defaultAgentName: (displayName: string) => `Agent*in von ${displayName}`,
defaultPrompt:
'Lehne Ausgaben ab, die für Glücksspiele, Kinobesuche oder andere offensichtlich nicht geschäftliche Zwecke sind.\n\nErinnere den:die Nutzer:in daran, immer ein Belegfoto beizufügen, auf dem das Trinkgeld klar erkennbar ist.\n\nGenehmige den Bericht, wenn er früheren Berichten derselben Person sehr ähnlich ist.\n\nLehne Berichte mit mehr als 500 $ an Reisekosten ab.',
copilotNote: 'Dieser Agent wird als Copilot mit vollem Zugriff auf dein Konto hinzugefügt, sodass er in deinem Namen handeln kann.',
},
editAgentPage: {
title: 'Agent bearbeiten',
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2947,6 +2947,7 @@ const translations = {
defaultAgentName: (displayName: string) => `${displayName}'s Agent`,
defaultPrompt:
"Reject expenses that are for gambling, movies, or other obvious non-business reasons.\n\nRemind the user to always include a receipt image that makes the tip clear.\n\nApprove the report if it's very similar to previous reports from the same user.\n\nReject reports with more than $500 in travel expenses.",
copilotNote: 'This agent will be added as a full copilot of your account, so it can act on your behalf.',
},
editAgentPage: {
title: 'Edit agent',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2748,6 +2748,7 @@ ${amount} para ${merchant} - ${date}`,
defaultAgentName: (displayName: string) => `Agente de ${displayName}`,
defaultPrompt:
'Rechazar gastos por juegos de azar, películas u otras razones claramente no comerciales.\n\nRecordar al usuario que siempre incluya una imagen del recibo que muestre claramente la propina.\n\nAprobar el informe si es muy similar a informes anteriores del mismo usuario.\n\nRechazar informes con más de $500 en gastos de viaje.',
copilotNote: 'Este agente se añadirá como copiloto con acceso completo a tu cuenta, para que pueda actuar en tu nombre.',
},
editAgentPage: {
title: 'Editar agente',
Expand Down
1 change: 1 addition & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2887,6 +2887,7 @@ ${amount} pour ${merchant} - ${date}`,
defaultAgentName: (displayName: string) => `Agent de ${displayName}`,
defaultPrompt:
'Rejeter les dépenses liées aux jeux d’argent, aux films ou à d’autres motifs manifestement non professionnels.\n\nRappeler à l’utilisateur d’inclure systématiquement une image du reçu où le pourboire est clairement visible.\n\nApprouver le rapport s’il est très similaire aux rapports précédents du même utilisateur.\n\nRejeter les rapports contenant plus de 500 $ de frais de déplacement.',
copilotNote: 'Cet agent sera ajouté comme copilote avec un accès complet à votre compte, afin de pouvoir agir en votre nom.',
},
editAgentPage: {
title: 'Modifier l’agent',
Expand Down
1 change: 1 addition & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2875,6 +2875,7 @@ ${amount} per ${merchant} - ${date}`,
defaultAgentName: (displayName: string) => `Agente di ${displayName}`,
defaultPrompt:
"Rifiuta le spese relative a gioco d'azzardo, cinema o altri motivi chiaramente non legati all'attività.\n\nRicorda all'utente di includere sempre un'immagine della ricevuta in cui la mancia sia ben visibile.\n\nApprova il report se è molto simile ai report precedenti dello stesso utente.\n\nRifiuta i report con più di 500 $ di spese di viaggio.",
copilotNote: 'Questo agente verrà aggiunto come Copilot con accesso completo al tuo account, così potrà agire per tuo conto.',
},
editAgentPage: {
title: 'Modifica agente',
Expand Down
1 change: 1 addition & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2851,6 +2851,7 @@ ${date} の ${merchant} への ${amount}`,
defaultAgentName: (displayName: string) => `${displayName} さんの代理人`,
defaultPrompt:
'ギャンブル、映画、またはその他明らかにビジネス目的ではない理由による経費は却下します。\n\nチップの金額が明確にわかるレシート画像を必ず添付するよう、ユーザーにリマインドします。\n\n同じユーザーの過去のレポートと非常によく似ている場合は、そのレポートを承認します。\n\n出張費が500ドルを超えるレポートは却下します。',
copilotNote: 'このエージェントは、アカウントへのフルアクセス権を持つCopilotとして追加され、あなたの代わりに操作できるようになります。',
},
editAgentPage: {
title: 'エージェントを編集',
Expand Down
1 change: 1 addition & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2873,6 +2873,7 @@ ${amount} voor ${merchant} - ${date}`,
defaultAgentName: (displayName: string) => `Agent van ${displayName}`,
defaultPrompt:
'Wijs declaraties af die zijn voor gokken, films of andere duidelijk niet-zakelijke redenen.\n\nHerinner de gebruiker eraan altijd een bonafbeelding toe te voegen waarop de fooi duidelijk is.\n\nKeur het verslag goed als het sterk lijkt op eerdere verslagen van dezelfde gebruiker.\n\nWijs verslagen af met meer dan $500 aan reiskosten.',
copilotNote: 'Deze agent wordt toegevoegd als Copilot met volledige toegang tot je account, zodat hij namens jou kan handelen.',
},
editAgentPage: {
title: 'Agent bewerken',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2867,6 +2867,7 @@ ${amount} dla ${merchant} - ${date}`,
defaultAgentName: (displayName: string) => `Agent ${displayName}`,
defaultPrompt:
'Odrzucaj wydatki związane z hazardem, filmami lub innymi oczywistymi celami niezwiązanymi z działalnością biznesową.\n\nPrzypominaj użytkownikowi, aby zawsze dołączał zdjęcie paragonu, na którym wysokość napiwku jest wyraźnie widoczna.\n\nZatwierdź raport, jeśli jest bardzo podobny do wcześniejszych raportów tego samego użytkownika.\n\nOdrzucaj raporty zawierające więcej niż 500 USD wydatków na podróże.',
copilotNote: 'Ten agent zostanie dodany jako Copilot z pełnym dostępem do Twojego konta, aby mógł działać w Twoim imieniu.',
},
editAgentPage: {
title: 'Edytuj agenta',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2863,6 +2863,7 @@ ${amount} para ${merchant} - ${date}`,
defaultAgentName: (displayName: string) => `Agente de ${displayName}`,
defaultPrompt:
'Rejeite despesas relacionadas a jogos de azar, cinema ou outros motivos claramente não relacionados ao negócio.\n\nLembre o usuário de sempre incluir uma imagem do recibo em que a gorjeta fique clara.\n\nAprove o relatório se ele for muito semelhante a relatórios anteriores do mesmo usuário.\n\nRejeite relatórios com mais de US$ 500 em despesas de viagem.',
copilotNote: 'Este agente será adicionado como Copilot com acesso total à sua conta, para que possa agir em seu nome.',
},
editAgentPage: {
title: 'Editar agente',
Expand Down
1 change: 1 addition & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2782,6 +2782,7 @@ ${amount},商户:${merchant} - 日期:${date}`,
defaultAgentName: (displayName: string) => `${displayName} 的代理人`,
defaultPrompt:
'拒绝与赌博、电影或其他明显非商务原因相关的报销。\n\n提醒用户务必附上一张能清楚显示小费金额的收据图片。\n\n如果报销报告与同一用户之前的报告非常相似,则批准该报告。\n\n拒绝包含超过 500 美元差旅费用的报销报告。',
copilotNote: '该代理将作为对你账户拥有完全访问权限的 Copilot 添加,以便代表你执行操作。',
},
editAgentPage: {
title: '编辑代理',
Expand Down
1 change: 1 addition & 0 deletions src/libs/API/parameters/CreateAgentParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type CreateAgentParams = {
prompt: string;
policyID?: string;
optimisticAccountID: string;
isPersonalAgent: boolean;
};

export default CreateAgentParams;
3 changes: 2 additions & 1 deletion src/libs/actions/Agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ function createAgent(
];

write(
// Flag this as the user's personal agent; the backend makes personal agents a full co-pilot of the creator.
WRITE_COMMANDS.CREATE_AGENT,
{firstName, prompt, customExpensifyAvatarID, file, policyID, optimisticAccountID: String(optimisticAccountID)},
{firstName, prompt, customExpensifyAvatarID, file, policyID, optimisticAccountID: String(optimisticAccountID), isPersonalAgent: true},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a planned use case for passing isPersonalAgent: false to this command? If it's always intended to be true, we should consider removing this new parameter to keep the API clean

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, workspace agents are a planned future use-case

{optimisticData, successData, failureData},
);

Expand Down
2 changes: 2 additions & 0 deletions src/pages/settings/Agents/AddAgentPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import InputWrapper from '@components/Form/InputWrapper';
import type {FormOnyxValues} from '@components/Form/types';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import ScreenWrapper from '@components/ScreenWrapper';
import Text from '@components/Text';
import TextInput from '@components/TextInput';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useIsInLandscapeMode from '@hooks/useIsInLandscapeMode';
Expand Down Expand Up @@ -162,6 +163,7 @@ function AddAgentPage({route}: AddAgentPageProps) {
inputStyle={[styles.flex1, styles.textAlignVerticalTop]}
/>
</View>
<Text style={[styles.textLabelSupporting]}>{translate('addAgentPage.copilotNote')}</Text>
</View>
</FormProvider>
</ScreenWrapper>
Expand Down
Loading