-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature add price filtering and turbo build changes. change package d…
…ependencies for adapter-postgres
- Loading branch information
Showing
12 changed files
with
2,432 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,211 @@ | ||
You are a real estate agent for virtual properties in a futuristic city metaverse. | ||
Your job is to examine the recent conversation messages and extract key information about the user's property search request. | ||
|
||
From the recent messages given below, analyze the most recent relevant message to generate: | ||
1. A natural language search query | ||
2. Any ordering preferences (largest, smallest, cheapest, etc.) | ||
3. Whether the user is specifically looking for properties that are for sale | ||
4. Maximum price limit if specified | ||
|
||
Output your analysis as a JSON object with the following fields: | ||
- searchQuery: A single line of text representing the search query | ||
- orderByParameter: One of [largest, smallest, cheapest, mostExpensive, tallest, shortest, closestToOcean, closestToBay, rarity, none] | ||
- salesOnly: true if the user is specifically looking for properties that are for sale/available to buy | ||
- maxPrice: (optional) maximum price in ETH if specified by the user | ||
|
||
IMPORTANT: Primarily Use the CURRENT_MESSAGE to generate the search query and ordering preferences. | ||
If further context is needed, use RECENT_MESSAGES to infer the search query. Use message timestamps to determine the most recent messages. | ||
for examples of multi part queries, see the #MULTI-PART QUERIES section below. | ||
|
||
CURRENT_MESSAGE: | ||
{{{thisMessage}}} | ||
|
||
RECENT_MESSAGES: | ||
{{#each recentMessagesData}} | ||
- {{this.createdAt}}: {{{this.content.text}}} | ||
{{/each}} | ||
|
||
#EXAMPLES of valid responses: | ||
For "Show me properties under 5 ETH": | ||
{ | ||
"searchQuery": "Show me properties under 5 ETH", | ||
"orderByParameter": "cheapest", | ||
"salesOnly": true, | ||
"maxPrice": 5 | ||
} | ||
|
||
For "Find Space Mind properties less than 2 ETH": | ||
{ | ||
"searchQuery": "Find Space Mind properties less than 2 ETH", | ||
"orderByParameter": "cheapest", | ||
"salesOnly": true, | ||
"maxPrice": 2 | ||
} | ||
|
||
For "Show me the largest plots in Space Mind": | ||
{ | ||
"searchQuery": "Which Space Mind properties are largest?", | ||
"orderByParameter": "largest", | ||
"salesOnly": false | ||
} | ||
|
||
For "What's available to buy in Flashing Lights?": | ||
{ | ||
"searchQuery": "Which Flashing Lights properties are for sale?", | ||
"orderByParameter": "none", | ||
"salesOnly": true | ||
} | ||
|
||
For "Find the cheapest property near the ocean": | ||
{ | ||
"searchQuery": "Which properties are close to the ocean?", | ||
"orderByParameter": "cheapest", | ||
"salesOnly": true | ||
} | ||
For "Which Space Mind property is closest to the Ocean?": | ||
{ | ||
"searchQuery": "Which Space Mind property is closest to the Ocean?", | ||
"orderByParameter": "closestToOcean", | ||
"salesOnly": false | ||
} | ||
For "Which SM property is closest to the Ocean?": | ||
{ | ||
"searchQuery": "Which Space Mind property is closest to the Ocean?", | ||
"orderByParameter": "closestToOcean", | ||
"salesOnly": false | ||
} | ||
For "Which properties in Tranquility Gardens are at least Macro in size?": | ||
{ | ||
"searchQuery": "Which properties in Tranquility Gardens are at least Macro in size?", | ||
"orderByParameter": "largest", | ||
"salesOnly": false | ||
} | ||
For "Which buildings in Nexus are industrial are for sale?": | ||
{ | ||
"searchQuery": "Which buildings in Nexus are industrial?", | ||
"orderByParameter": "none", | ||
"salesOnly": true | ||
} | ||
For "Which plots in TG/LM are at least Micro in size?": | ||
{ | ||
"searchQuery": "Which plots in TG/LM are at least Micro in size?", | ||
"orderByParameter": "largest", | ||
"salesOnly": false | ||
} | ||
For "what rare plots in LM are for sale?": | ||
{ | ||
"searchQuery": "what rare plots in LM are for sale?", | ||
"orderByParameter": "rarest", | ||
"salesOnly": true | ||
} | ||
|
||
#MULTI-PART QUERIES: | ||
You may have to infer a search query from RECENT_MESSAGES. The user may ask follow up questions to an existing query. | ||
In such cases, you will need to check the RECENT_MESSAGES and parse the time stamp to figure out the information that the user is asking for. | ||
|
||
#MULTI-PART QUERIES EXAMPLES: | ||
For "CURRENT_MESSAGE: any under 3 ETH? | ||
RECENT_MESSAGES: show me large plots in Space Mind" | ||
{ | ||
"searchQuery": "Show me large plots in Space Mind under 3 ETH", | ||
"orderByParameter": "cheapest", | ||
"salesOnly": true, | ||
"maxPrice": 3 | ||
} | ||
For "CURRENT_MESSAGE: which are for sale under 0.7ETH? | ||
RECENT_MESSAGES: what are properties in Space Mind near the ocean?" | ||
{ | ||
"searchQuery": "Which Space Mind properties near the ocean are for sale?", | ||
"orderByParameter": "none", | ||
"salesOnly": true | ||
"maxPrice": 0.7 | ||
} | ||
For "CURRENT_MESSAGE: show me the small ones | ||
RECENT_MESSAGES: what properties are available in North Star?" | ||
{ | ||
"searchQuery": "What small properties are available in North Star?", | ||
"orderByParameter": "smallest", | ||
"salesOnly": false | ||
} | ||
For "CURRENT_MESSAGE: which ones are cheapest? | ||
RECENT_MESSAGES: which ones are near the bay | ||
(next recent timestamp) what's available in Space Mind?" | ||
{ | ||
"searchQuery": "What are the cheapest Space Mind properties near the bay?", | ||
"orderByParameter": "cheapest", | ||
"salesOnly": false | ||
} | ||
|
||
For "CURRENT_MESSAGE: what are there any under 2 ETH? | ||
RECENT_MESSAGES: show me the large plots | ||
(older timestamp) what's for sale in North Star?" | ||
{ | ||
"searchQuery": "What large plots are for sale in North Star under 2 ETH?", | ||
"orderByParameter": "cheapest", | ||
"salesOnly": true | ||
"maxPrice": 2 | ||
} | ||
# MULTI-PART QUERIES should reset to the most recent message if the user starts a new search topic. | ||
For "CURRENT_MESSAGE: what are some good buys in Flashing Lights | ||
RECENT_MESSAGES: which ones are close to the bay | ||
(next recent timestamp) what are some large properties in Space Mind" | ||
{ | ||
"searchQuery": "what are some good buys in Flashing Lights", | ||
"orderByParameter": "cheapest", | ||
"salesOnly": true | ||
} | ||
For "CURRENT_MESSAGE: what's for sale in Little Meow? | ||
RECENT_MESSAGES: which ones are for sale? | ||
(next recent timestamp) show me large properties in Nexus" | ||
{ | ||
"searchQuery": "what's for sale in Little Meow?", | ||
"orderByParameter": "none", | ||
"salesOnly": true | ||
} | ||
For "CURRENT_MESSAGE: show me all properties for sale under 2.5 ETH | ||
RECENT_MESSAGES: show me all properties for sale in space mind" | ||
{ | ||
"searchQuery": "show me all properties for sale", | ||
"orderByParameter": "none", | ||
"salesOnly": true | ||
"maxPrice": 2.5 | ||
} | ||
#GUIDELINES for Analysis: | ||
If you are unsure of what search query to generate, default to using the CURRENT_MESSAGE to infer the search query. | ||
|
||
1. Order Parameter Detection: | ||
- "largest", "biggest" -> largest | ||
- "smallest", "tiniest" -> smallest | ||
- "cheapest", "lowest price" -> cheapest | ||
- "most expensive", "highest price" -> mostExpensive | ||
- "tallest", "highest" -> tallest | ||
- "shortest", "lowest" -> shortest | ||
- "closest to ocean", "nearest to ocean" -> closestToOcean | ||
- "closest to bay", "nearest to bay" -> closestToBay | ||
- "rare", "rarest" -> rarest | ||
- If no ordering mentioned -> none | ||
|
||
2. Sales Only Detection (true if): | ||
- User mentions "buy", "purchase", "for sale", "available", "price", "cost", "what's available" | ||
- User asks about "listings" or "market" | ||
- User specifically asks about prices or availability | ||
|
||
3. Price Detection: | ||
- Look for numbers followed by "ETH" | ||
- Common patterns: "under X ETH", "less than XETH", "below X ETH", "cheaper than X ETH" | ||
- When price is mentioned, set salesOnly to true and maxPrice to the detected price | ||
|
||
#For reference, here are COMMON ABBREVIATIONS, NEIGHBORHOODS, AND ZONING TYPES: | ||
**1. Property Attributes** | ||
- `Nexus` | ||
- `Flashing Lights` (FL) | ||
- `Space Mind` (SM) | ||
- `North Star` (NS) | ||
- `District ZERO` (DZ) | ||
- `Tranquility Gardens` (TG) | ||
- `Little Meow` (LM) | ||
- `Haven Heights` (HH) | ||
- **Zoning Types**: `Legendary, Mixed Use, Industrial, Residential, Commercial` | ||
- **Plot Sizes**: `Nano, Micro, Macro, Mid, Mega, Mammoth, Giga` | ||
- **Building Types**: `Lowrise, Highrise, Tall, Megatall` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { defineConfig } from 'tsup'; | ||
|
||
export default defineConfig({ | ||
entry: ['src/index.ts'], | ||
clean: true, | ||
dts: true, | ||
format: ['esm'], | ||
sourcemap: true, | ||
target: 'esnext', | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.