Add current date to info extraction prompt (#617)

This commit is contained in:
Kerem Yilmaz
2024-07-18 11:36:09 -07:00
committed by GitHub
parent 51816c0f60
commit 69d73bc551
5 changed files with 10 additions and 4 deletions

View File

@@ -975,7 +975,7 @@ class ForgeAgent:
data_extraction_goal=task.data_extraction_goal, data_extraction_goal=task.data_extraction_goal,
action_history=actions_and_results_str, action_history=actions_and_results_str,
error_code_mapping_str=(json.dumps(task.error_code_mapping) if task.error_code_mapping else None), error_code_mapping_str=(json.dumps(task.error_code_mapping) if task.error_code_mapping else None),
utc_datetime=datetime.utcnow(), utc_datetime=datetime.utcnow().strftime("%Y-%m-%d %H:%M"),
) )
await app.ARTIFACT_MANAGER.create_artifact( await app.ARTIFACT_MANAGER.create_artifact(

View File

@@ -74,7 +74,7 @@ Action results from previous steps: (note: even if the action history suggests g
{{ action_history }} {{ action_history }}
{% endif %} {% endif %}
Current datetime in UTC: Current datetime in UTC, YYYY-MM-DD HH:MM format:
``` ```
{{ utc_datetime }} {{ utc_datetime }}
``` ```

View File

@@ -74,7 +74,7 @@ Action results from previous steps: (note: even if the action history suggests g
{{ action_history }} {{ action_history }}
{% endif %} {% endif %}
Current datetime in UTC: Current datetime in UTC, YYYY-MM-DD HH:MM format:
``` ```
{{ utc_datetime }} {{ utc_datetime }}
``` ```

View File

@@ -25,3 +25,8 @@ Current URL: {{ current_url }}
Text extracted from the webpage: {{ extracted_text }} Text extracted from the webpage: {{ extracted_text }}
User Navigation Payload: {{ navigation_payload }} User Navigation Payload: {{ navigation_payload }}
Current datetime in UTC, YYYY-MM-DD HH:MM format:
```
{{ utc_datetime }}
```

View File

@@ -1064,6 +1064,7 @@ async def extract_information_for_navigation_goal(
current_url=scraped_page.url, current_url=scraped_page.url,
extracted_text=scraped_page.extracted_text, extracted_text=scraped_page.extracted_text,
error_code_mapping_str=(json.dumps(task.error_code_mapping) if task.error_code_mapping else None), error_code_mapping_str=(json.dumps(task.error_code_mapping) if task.error_code_mapping else None),
utc_datetime=datetime.utcnow().strftime("%Y-%m-%d %H:%M"),
) )
json_response = await app.LLM_API_HANDLER( json_response = await app.LLM_API_HANDLER(