You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewError("Failed to fetch location details.")
268
+
}
269
+
constdata=awaitresponse.json()
270
+
constaddress=data.address
271
+
// Construct a readable location string
272
+
constlocationString=[
273
+
address.city||address.town||address.village,
274
+
address.state,
275
+
address.country
276
+
]
277
+
.filter(Boolean)// Remove any null/undefined parts
278
+
.join(", ")
279
+
280
+
if(!locationString){
281
+
thrownewError(
282
+
"Could not determine location name from coordinates."
283
+
)
284
+
}
285
+
286
+
// Update state with the text location
287
+
setLocationState({
288
+
loading: false,
289
+
data: locationString,// Store the string
290
+
error: null
291
+
})
292
+
handleAnswer("location",locationString)// Save the string
293
+
}catch(error){
294
+
setLocationState({
295
+
loading: false,
296
+
data: null,
297
+
error: error.message
298
+
})
299
+
toast.error(
300
+
`Could not convert coordinates to location: ${error.message}`
301
+
)
302
+
}
223
303
},
224
304
(error)=>{
305
+
letuserMessage=
306
+
"An unknown error occurred while detecting your location."
307
+
switch(error.code){
308
+
caseerror.PERMISSION_DENIED:
309
+
userMessage=
310
+
"Location permission denied. Please enable location access for this site in your browser settings and try again."
311
+
break
312
+
caseerror.POSITION_UNAVAILABLE:
313
+
userMessage=
314
+
"Location information is unavailable. This can happen if location services are turned off in your operating system (e.g., Windows or macOS). Please check your system settings and network connection."
315
+
break
316
+
caseerror.TIMEOUT:
317
+
userMessage=
318
+
"The request to get your location timed out. Please try again."
319
+
break
320
+
}
225
321
setLocationState({
226
322
loading: false,
227
323
data: null,
228
-
error: error.message
324
+
error: userMessage
229
325
})
230
-
toast.error(`Could not get location: ${error.message}`)
Copy file name to clipboardExpand all lines: src/server/main/memories/prompts.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@
97
97
Key Instructions:
98
98
1. Deconstruct Compound Sentences into ATOMIC FACTS: Vigorously split sentences containing conjunctions like 'and', 'but', or 'while' into separate, self-contained facts. Each fact must stand on its own.
99
99
2. Isolate Each Idea: Ensure every item in the output list represents one distinct, meaningful idea. EACH ATOMIC FACT MUST BE A COMPLETE THOUGHT.
100
-
3. Handle Pronouns and Possessives: If the input contains "I", "me", or "my", correctly convert them to refer to the provided USERNAME. For example, "My sister" becomes "{{USERNAME}}'s sister".
100
+
3. Personalize Facts: If the input contains pronouns like "I", "me", or "my", or generic references like "the user", you MUST replace them with the provided USERNAME to create a personalized fact. For example, if USERNAME is 'Alex', "My sister" becomes "Alex's sister", and "The user's favorite color is blue" becomes "Alex's favorite color is blue".
101
101
4. Strict JSON Output: Your entire response MUST be a single, valid JSON ARRAY of strings that strictly adheres to the given schema. Do not add any commentary before or after the JSON.
Copy file name to clipboardExpand all lines: src/server/mcp_hub/memory/prompts.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@
93
93
Key Instructions:
94
94
1. Deconstruct Compound Sentences into ATOMIC FACTS: Vigorously split sentences containing conjunctions like 'and', 'but', or 'while' into separate, self-contained facts. Each fact must stand on its own.
95
95
2. Isolate Each Idea: Ensure every item in the output list represents one distinct, meaningful idea. EACH ATOMIC FACT MUST BE A COMPLETE THOUGHT.
96
-
3. Handle Pronouns and Possessives: If the input contains "I", "me", or "my", correctly convert them to refer to the provided USERNAME. For example, "My sister" becomes "{{USERNAME}}'s sister".
96
+
3. Personalize Facts: If the input contains pronouns like "I", "me", or "my", or generic references like "the user", you MUST replace them with the provided USERNAME to create a personalized fact. For example, if USERNAME is 'Alex', "My sister" becomes "Alex's sister", and "The user's favorite color is blue" becomes "Alex's favorite color is blue".
97
97
4. Strict JSON Output: Your entire response MUST be a single, valid JSON ARRAY of strings that strictly adheres to the given schema. Do not add any commentary before or after the JSON.
0 commit comments