feat: Add current date and time to prompt for researcher #149
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This pull request introduces a new feature to the
researcher
function in theresearcher.tsx
file. The feature adds the current date and time to the system prompt that is passed to the Language Model (LLM). The date and time are fetched programmatically and change based on the system time.Ensures that any web searches related to time sensitive topics have the correct current datetime e.g.
Changes Introduced
researcher
Function: Theresearcher
function in theresearcher.tsx
file has been updated to include the current date and time in the system prompt:currentDate
is declared and assigned the current date and time using the JavaScriptDate
object.The
currentDate
is then converted to a string and included in the system prompt that is passed to thenonexperimental_streamText
function.Usage
No additional steps are required to use this feature. The date and time will be automatically included in the system prompt each time the
researcher
function is called.Testing
The updated
researcher
function has been tested locally to ensure that the current date and time are correctly included in the system prompt and that they change based on the system time.