Skip to content

.Net: Replacing FunctionsView class with List - #2878

Merged
Shawn Callegari (shawncal) merged 10 commits into
microsoft:mainfrom
shawncal:funcview-sep18
Sep 20, 2023
Merged

Shawn Callegari (shawncal) merged 10 commits into
microsoft:mainfrom
shawncal:funcview-sep18

Conversation

@shawncal

@shawncal Shawn Callegari (shawncal) commented Sep 19, 2023 •

Copy link
Copy Markdown
Contributor

Motivation and Context

The FunctionsView class wraps two inner Dictionaries of FunctionView objects: Native and Semantic. Since we no longer differentiate between these two for any practical purpose, we could merge those into one list, and we no longer need a special class for that.

Description

  • Removing the different collections to store Semantic vs Native functions
  • Removing FunctionsView collection
  • From SkillCollection.GetFunctionsView(), returning an IReadOnlyList<FunctionView>
  • Callers can then easily use LINQ to filter the resulting flat list, or group by skill name.
  • Updating callers, tests

Resolves #604

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the SK Contribution Guidelines and the pre-submission formatting script raises no violations
  • All unit tests pass, and I have added new tests where possible
  • I didn't break anyone 😄
    • BREAKING CHANGE as it modifies the public API. Low impact.

@rogerbarreto

Copy link
Copy Markdown
Member

Resolves #604

@shawncal
Shawn Callegari (shawncal) added this pull request to the merge queue Sep 20, 2023
Merged via the queue into microsoft:main with commit 9d638e5 Sep 20, 2023
@shawncal
Shawn Callegari (shawncal) deleted the funcview-sep18 branch September 20, 2023 06:25
SOE-YoungS pushed a commit to SOE-YoungS/semantic-kernel that referenced this pull request Nov 1, 2023
### Motivation and Context
The `FunctionsView` class wraps two inner Dictionaries of `FunctionView`
objects: Native and Semantic. Since we no longer differentiate between
these two for any practical purpose, we could merge those into one list,
and we no longer need a special class for that.

### Description

- Removing the different collections to store Semantic vs Native
functions
- Removing `FunctionsView` collection
- From `SkillCollection.GetFunctionsView()`, returning an
`IReadOnlyList<FunctionView>`
- Callers can then easily use LINQ to filter the resulting flat list, or
group by skill name.
- Updating callers, tests

Resolves microsoft#604

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
    - BREAKING CHANGE as it modifies the public API. Low impact.

---------

Co-authored-by: Roger Barreto <[email protected]>
Co-authored-by: Lee Miller <[email protected]>
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: breaking change Pull requests that introduce breaking changes

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Potential concurrency bugs in FunctionsView

5 participants