Skip to content

Commit

Permalink
Change Item and Marketplace Config
Browse files Browse the repository at this point in the history
  • Loading branch information
BoPeng committed Jan 31, 2025
1 parent 4be91dd commit fe23411
Show file tree
Hide file tree
Showing 12 changed files with 553 additions and 419 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ an example with many of the options.
- One or more sections of `[region.region_name]`, which defines regions to search. Multiple searches will be performed for multiple cities to cover entire regions.

- `search_city`: (required), one or more cities with naned used by facebook
- `name`: (optional) a display name for the region.
- `full_name`: (optional) a display name for the region.
- `radius`: (optional), recommend 805 for regions using miles, and 500 using kms, default to `805`
- `city_name`: (optional), corresponding city names for bookkeeping purpose only.

Expand Down
4 changes: 2 additions & 2 deletions src/ai_marketplace_monitor/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def get_prompt(
if "description" in item_config:
prompt += f""" He also added description "{item_config["description"]}" to describe the item he is interested in."""
#
max_price = item_config.get("max_price", 0)
min_price = item_config.get("min_price", 0)
max_price = item_config.max_price or 0
min_price = item_config.min_price or 0
if max_price and min_price:
prompt += f""" He also set a price range from {min_price} to {max_price}."""
elif max_price:
Expand Down
3 changes: 2 additions & 1 deletion src/ai_marketplace_monitor/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def main(
sys.exit(0)
except Exception as e:
logger.error(f"Error: {e}")
sys.exit(1)

raise
finally:
monitor.stop_monitor()

Expand Down
276 changes: 121 additions & 155 deletions src/ai_marketplace_monitor/config.py

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions src/ai_marketplace_monitor/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[region.usa]
name = "USA (without AK or HI)"
full_name = "USA (without AK or HI)"
radius = 500
city_name = [
"Portland, OR",
Expand All @@ -24,7 +24,7 @@ search_city = [


[region.usa_full]
name = "USA"
full_name = "USA"
radius = 500
city_name = [
"Portland, OR",
Expand Down Expand Up @@ -59,7 +59,7 @@ search_city = [


[region.can]
name = "Canada"
full_name = "Canada"
radius = 805
city_name = [
"Saint Quentin, NB",
Expand All @@ -86,7 +86,7 @@ search_city = [


[region.mex]
name = "Mexico"
full_name = "Mexico"
radius = 805
city_name = [
"Irapuato,Guanajuato ",
Expand All @@ -109,7 +109,7 @@ search_city = [


[region.bra]
name = "Brazil"
full_name = "Brazil"
radius = 805
city_name = [
"Betim, Minas Gerais",
Expand Down Expand Up @@ -154,7 +154,7 @@ search_city = [


[region.arg]
name = "Argentina"
full_name = "Argentina"
radius = 805
city_name = [
"Pehuajó, Buenos Aires",
Expand All @@ -177,7 +177,7 @@ search_city = [


[region.aus]
name = "Australia"
full_name = "Australia"
radius = 805
city_name = [
"Tamworth, NSW",
Expand Down Expand Up @@ -212,7 +212,7 @@ search_city = [


[region.aus_miles]
name = "Australia"
full_name = "Australia"
radius = 500
city_name = [
"Warburton, Western Australia",
Expand All @@ -236,14 +236,14 @@ search_city = [
]

[region.nzl]
name = "New Zealand"
full_name = "New Zealand"
radius = 805
city_name = ["Hamilton", "Lake Tekapo"]
search_city = ["104080336295923", "106528236047934"]


[region.ind]
name = "India"
full_name = "India"
radius = 805
city_name = [
"Sanquelim, Goa",
Expand All @@ -266,21 +266,21 @@ search_city = [


[region.gbr]
name = "United Kingdom"
full_name = "United Kingdom"
radius = 805
city_name = ["Manchester", "Kirkwall"]
search_city = ["114629675219759", "107972512564724"]


[region.fra]
name = "France"
full_name = "France"
radius = 805
city_name = ["Chartres", "Montpellier"]
search_city = ["115700691777803", "115100621840245"]


[region.spa]
name = "Spain"
full_name = "Spain"
radius = 805
city_name = ["Plasencia", "Valencia"]
search_city = ["108336475863182", "2404588816444858"]
Loading

0 comments on commit fe23411

Please sign in to comment.