Skip to content

Commit

Permalink
Fixed location when ip-api is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
yorevs committed Nov 14, 2024
1 parent 6a1f1f5 commit 01627f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/main/askai/core/component/geo_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class GeoLocation(metaclass=Singleton):
EMPTY_JSON_RESP: str = dedent(
"""
{
"status": "failure", "country": "", "countryCode": "", "region": "", "regionName": "",
"city": "", "zip": "", "lat": 0.0, "lon": 0.0, "timezone": "UTC",
"isp": "", "org": "", "as": "", "query": ""
"status": "failure", "country": "London", "countryCode": "UK", "region": "Greater London",
"regionName": "England", "city": "Greenwich", "zip": "", "lat": 51.4826, "lon": 0.0077,
"timezone": "UTC", "isp": "", "org": "", "as": "", "query": ""
}
"""
).strip()
Expand Down
7 changes: 5 additions & 2 deletions src/main/askai/core/support/shared_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,12 @@ def app_info(self) -> str:
OS: {prompt.os_type}/{prompt.shell}
{'-' * 80}
Microphone: %CYAN%{device_info or '%RED%Undetected'} %GREEN%
Debugging: {'' if configs.is_debug else '%RED%'} %GREEN%
Speaking: {', tempo: ' + speak_info if configs.is_speak else '%RED%'} %GREEN%
Caching: {', TTL: ' + str(configs.ttl) if configs.is_cache else '%RED%'} %GREEN%
{'.' * 80}
Location: {', ' + geo_location.location if configs.ip_api_enabled else '%RED%'} %GREEN%
History: {'' if configs.is_keep_context else '%RED%'} %GREEN%
Debug: {'' if configs.is_debug else '%RED%'} %GREEN%
Cache: {', TTL: ' + str(configs.ttl) if configs.is_cache else '%RED%'} %GREEN%
{'=' * 80}%NC%
"""
Expand Down

0 comments on commit 01627f8

Please sign in to comment.