Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add current date and time to prompt for researcher #149

Merged
merged 1 commit into from
May 15, 2024

Conversation

andrewginns
Copy link
Contributor

Overview

This pull request introduces a new feature to the researcher function in the researcher.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.
image

Changes Introduced

researcher Function: The researcher function in the researcher.tsx file has been updated to include the current date and time in the system prompt:

  • A new constant currentDate is declared and assigned the current date and time using the JavaScript Date object.
    The currentDate is then converted to a string and included in the system prompt that is passed to the nonexperimental_streamText function.
  • I think this is the correct place to put the datetime but if the researcher is not called for any reason then we won't get this current datetime info.

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.

Copy link

vercel bot commented May 14, 2024

@andrewginns is attempting to deploy a commit to the morphic Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented May 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
morphic ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2024 1:07am

Copy link
Owner

@miurla miurla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thank you for the PR.

@miurla miurla merged commit 85fab39 into miurla:main May 15, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants