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

Add new relative time skills for ' ago' and 'last ' #927

Merged
merged 33 commits into from May 25, 2023

Conversation

tim-gill
Copy link
Member

@tim-gill tim-gill commented May 10, 2023

Motivation and Context

The change enables the planner to make use of time references like "last wednesday" or "three days ago" which currently cause issues. This enables better use of SequentialPlanner when servicing user intent.
Issue: #922

Description

This adds two new functions to the core TimeSkill class in both .net and python.

  1. DaysAgo(str days) - takes an argument representing a number of days and offsets it from the current date to return the resultant date as the answer.
  2. LastMatchingDay(str dayName) - takes the name of a day of the week and works backwards from yesterday to give it the first matching date of that day (e.g. "last wednesday"). Currently it only works with English day names, and this is reflected in the prompt description.

Simple unit tests are added for each function.

Contribution Checklist

@github-actions github-actions bot added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel kernel.core python Pull requests for the Python Semantic Kernel labels May 10, 2023
Copy link
Member

@lemillermicrosoft lemillermicrosoft left a comment

Choose a reason for hiding this comment

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

Great idea! Overall LGTM -- some build warnings in the test file that need to be cleaned up.

@tim-gill
Copy link
Member Author

Updated to remove the warnings in my code - there appears to be one still there from a nuget which I did not add.

@lemillermicrosoft lemillermicrosoft added PR: ready for review All feedback addressed, ready for reviews PR: ready to merge PR has been approved by all reviewers, and is ready to merge. labels May 12, 2023
@dluc dluc requested a review from awharrison-28 May 12, 2023 21:27
@dluc dluc removed the PR: ready to merge PR has been approved by all reviewers, and is ready to merge. label May 12, 2023
Co-authored-by: Devis Lucato <dluc@users.noreply.github.com>
@dluc dluc merged commit d9028ee into microsoft:main May 25, 2023
26 checks passed
@tim-gill tim-gill deleted the timgill/newtimeskills branch May 25, 2023 23:26
shawncal pushed a commit to shawncal/semantic-kernel that referenced this pull request Jul 6, 2023
### Motivation and Context

The change enables the planner to make use of time references like "last
wednesday" or "three days ago" which currently cause issues. This
enables better use of SequentialPlanner when servicing user intent.
Issue: microsoft#922

### Description

This adds two new functions to the core TimeSkill class in both .net and
python.
1. DaysAgo(str days) - takes an argument representing a number of days
and offsets it from the current date to return the resultant date as the
answer.
2. LastMatchingDay(str dayName) - takes the name of a day of the week
and works backwards from yesterday to give it the first matching date of
that day (e.g. "last wednesday"). Currently it only works with English
day names, and this is reflected in the prompt description.

Simple unit tests are added for each function.

Co-authored-by: Devis Lucato <dluc@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code PR: ready for review All feedback addressed, ready for reviews python Pull requests for the Python Semantic Kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants