Skip to content

Commit

Permalink
Merge pull request #33 from ryanleung/ryanleung-address
Browse files Browse the repository at this point in the history
[Feature] Add ability to prompt for address
  • Loading branch information
betterbrand authored Feb 28, 2024
2 parents 64ff9e5 + b5825d7 commit f6ad2fa
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
31 changes: 26 additions & 5 deletions src/backend/services/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
Expand All @@ -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.",
Expand Down
4 changes: 4 additions & 0 deletions src/frontend/views/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down

0 comments on commit f6ad2fa

Please sign in to comment.