Skip to content

Commit

Permalink
feat: ✨ add warmup markers for llm usage (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsinlun99 authored Jun 19, 2024
1 parent ccf0e69 commit 2214093
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/api/gpt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import env from "../../constants/env";
import referenceData from "../../assets/data/gpt/reference.json";
import markersPosition from "../../assets/data/gpt/markers-position.json";
import multiFloorMarkersPosition from "../../assets/data/gpt/multi-floor-markers-position.json";
import warmUpMarkersPosition from "../../assets/data/gpt/warmup-markers-position.json";
import { PoisForGpt } from "../../models/poi";
import { changeStatusToEnglish } from "../../constants/gpt";

Expand Down Expand Up @@ -196,6 +197,7 @@ function find_closest_facility(
floor: string,
location: string,
item: string,
clusterId: string,
) {
const locationPosition = (
referenceData as {
Expand All @@ -206,8 +208,13 @@ function find_closest_facility(

const floorNumber = transFloorFromChineseToNumber(floor);

const candidateMarkersPosition =
const warmUpRegex = /TEST/;

const markersPositionToUse =
id === "m" ? multiFloorMarkersPosition : markersPosition;
const candidateMarkersPosition = warmUpRegex.test(clusterId)
? warmUpMarkersPosition
: markersPositionToUse;

const itemPositions = Object.entries(candidateMarkersPosition).find(([key]) =>
key.startsWith(item),
Expand Down
144 changes: 144 additions & 0 deletions src/assets/data/gpt/warmup-markers-position.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
{
"一般座位區": {
"一般座位區1-4": {
"位址": [
24.787581626232452,
120.9974750397691
]
},
"一般座位區1-1": {
"位址": [
24.787617765827697,
120.99782313402345
]
},
"一般座位區1-2": {
"位址": [
24.787557376622196,
120.99770362831647
]
},
"一般座位區1-3": {
"位址": [
24.787513544936825,
120.99757488228376
]
}
},
"公用電腦": {
"公用電腦1-5": {
"位址": [
24.78776321383609,
120.99767703600573
]
},
"公用電腦1-1": {
"位址": [
24.78776321383609,
120.99793044297562
]
},
"公用電腦1-6": {
"位址": [
24.78771572958834,
120.99792977242336
]
},
"公用電腦1-10": {
"位址": [
24.78771572958834,
120.99767703600573
]
},
"公用電腦1-4": {
"位址": [
24.78776321383609,
120.99774738673945
]
},
"公用電腦1-9": {
"位址": [
24.78771572958834,
120.99774738673945
]
},
"公用電腦1-3": {
"位址": [
24.78776321383609,
120.9978077374732
]
},
"公用電腦1-8": {
"位址": [
24.78771572958834,
120.9978077374732
]
},
"公用電腦1-2": {
"位址": [
24.78776321383609,
120.997868088207
]
},
"公用電腦1-7": {
"位址": [
24.78771572958834,
120.997868088207
]
}
},
"飲水機": {
"飲水機1-1": {
"位址": [
24.787781678119718,
120.99799272070766
]
},
"飲水機1-2": {
"位址": [
24.78804354948574,
120.99759087157781
]
}
},
"路邊一般停車位": {
"路邊一般停車位1-1": {
"位址": [
24.78789220637148,
120.99736439864724
]
},
"路邊一般停車位1-2": {
"位址": [
24.78779293166175,
120.99736573975174
]
},
"路邊一般停車位1-3": {
"位址": [
24.787717746153564,
120.99736573975174
]
},
"路邊一般停車位1-4": {
"位址": [
24.787606150485715,
120.99736976306527
]
},
"路邊一般停車位1-5": {
"位址": [
24.78753275093158,
120.99736258827416
]
}
},
"路邊無障礙停車位": {
"路邊無障礙停車位1-1": {
"位址": [
24.787979942973173,
120.99735553852841
]
}
}
}
1 change: 1 addition & 0 deletions src/components/modal/LlmInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const LlmInput: React.FC = () => {
floor,
location_input[0],
item_input,
id ?? "",
);

targetMarker = tmpTargetMarker;
Expand Down

0 comments on commit 2214093

Please sign in to comment.