mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 13:25:11 +00:00
Only add location to image prompt generator when location known
This commit is contained in:
@@ -326,10 +326,13 @@ async def generate_better_image_prompt(
|
|||||||
Generate a better image prompt from the given query
|
Generate a better image prompt from the given query
|
||||||
"""
|
"""
|
||||||
|
|
||||||
location = f"{location_data.city}, {location_data.region}, {location_data.country}" if location_data else "Unknown"
|
|
||||||
today_date = datetime.now(tz=timezone.utc).strftime("%Y-%m-%d")
|
today_date = datetime.now(tz=timezone.utc).strftime("%Y-%m-%d")
|
||||||
|
|
||||||
|
if location_data:
|
||||||
|
location = f"{location_data.city}, {location_data.region}, {location_data.country}"
|
||||||
location_prompt = prompts.user_location.format(location=location)
|
location_prompt = prompts.user_location.format(location=location)
|
||||||
|
else:
|
||||||
|
location_prompt = "Unknown"
|
||||||
|
|
||||||
user_references = "\n\n".join([f"# {item}" for item in note_references])
|
user_references = "\n\n".join([f"# {item}" for item in note_references])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user