Skip to content

.Net: Example with native functions using custom types - #3255

Merged
Dmytro Struk (dmytrostruk) merged 6 commits into
microsoft:mainfrom
dmytrostruk:custom-types-example
Oct 23, 2023
Merged

Dmytro Struk (dmytrostruk) merged 6 commits into
microsoft:mainfrom
dmytrostruk:custom-types-example

Conversation

@dmytrostruk

Copy link
Copy Markdown
Member

Motivation and Context

This PR contains changes to add new examples how to use native functions with custom types.

Examples include:

  1. One native function calls another native function (function chaining).
  2. Two native functions are called sequentially in Kernel (function pipeline).
  3. Auto conversion of context variables to primitive types in native function parameters.

Contribution Checklist

@shawncal Shawn Callegari (shawncal) added the .NET Issue or Pull requests regarding .NET code label Oct 23, 2023
@rogerbarreto

Copy link
Copy Markdown
Member

Dmytro Struk (@dmytrostruk) Do we have UnitTests covering scenarios similar to the examples?

Worth adding if not.

@dmytrostruk
Dmytro Struk (dmytrostruk) added this pull request to the merge queue Oct 23, 2023
Merged via the queue into microsoft:main with commit 078f445 Oct 23, 2023
@dmytrostruk
Dmytro Struk (dmytrostruk) deleted the custom-types-example branch October 23, 2023 17:12
SOE-YoungS pushed a commit to SOE-YoungS/semantic-kernel that referenced this pull request Nov 1, 2023
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

This PR contains changes to add new examples how to use native functions
with custom types.

Examples include:
1. One native function calls another native function (function
chaining).
2. Two native functions are called sequentially in Kernel (function
pipeline).
3. Auto conversion of context variables to primitive types in native
function parameters.

### 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
- [x] I didn't break anyone 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Issue or Pull requests regarding .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants