mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-17 08:04:21 +00:00
Only add location to image prompt generator when location known
This commit is contained in:
parent
15ed208996
commit
0a7392f6ec
1 changed files with 5 additions and 2 deletions
|
@ -326,10 +326,13 @@ async def generate_better_image_prompt(
|
|||
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")
|
||||
|
||||
location_prompt = prompts.user_location.format(location=location)
|
||||
if location_data:
|
||||
location = f"{location_data.city}, {location_data.region}, {location_data.country}"
|
||||
location_prompt = prompts.user_location.format(location=location)
|
||||
else:
|
||||
location_prompt = "Unknown"
|
||||
|
||||
user_references = "\n\n".join([f"# {item}" for item in note_references])
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue