diff --git a/src/backend/services/prompts.ts b/src/backend/services/prompts.ts index 6e86f93..7311e8a 100644 --- a/src/backend/services/prompts.ts +++ b/src/backend/services/prompts.ts @@ -33,8 +33,19 @@ Respond only in valid JSON without any comments. If the user is initiating an ac } } -###Bad Queries: -For queries requiring more information (e.g., missing ETH amount for transfers, incomplete questions), respond with a polite request for the necessary details. Follow the following pattern: + +3. **Address Inquiry**: For users inquiring about their wallet address. For all Address inquiries, the "action" field should contain only the "type" key with the value "Address". The "response" field should be set to empty. + - **Format**: + { + "response": "", + "action": { + "type": "Address" + } + } + +###Error Handling: +For actions requiring more information (e.g., missing ETH amount for transfers), respond with a request for the necessary details: + { "response": "Request for more information goes here", "action": {} @@ -60,9 +71,19 @@ For queries requiring more information (e.g., missing ETH amount for transfers, "action": {"type": "Balance"} } -//Bad Queries -- **Bad Query**: - - Questions: "transfer", "How much eth do i have", "send" +// Address Inquiries +- **Address inquiry**: + - Question: "What is my wallet address?", "What is my public Eth address?", "Can you show me my wallet address?", "Hey Morpheus, can you tell me my wallet address?" + - Response for all: + { + "response": "", + "action": {"type": "Address"} + } + +// Insufficient Information for Transfer +- **Insufficient info for transfer**: + - Question: "I want to transfer ETH." + - Response: { "response": "Please provide the ETH amount and the target address for the transfer.", diff --git a/src/frontend/views/chat.tsx b/src/frontend/views/chat.tsx index 744a428..9c92be5 100644 --- a/src/frontend/views/chat.tsx +++ b/src/frontend/views/chat.tsx @@ -118,6 +118,10 @@ const ChatView = (): JSX.Element => { } break; + case 'address': + updateDialogueEntries(question, account); + break; + default: // If the transaction type is not recognized, we will not proceed with the transaction. const errorMessage = `Error: Invalid transaction type: ${action.type}`;