Files
semantic-kernel/python/semantic_kernel
JoowonandAbby Harrison 67dfb4c1f5 Python: add invoke_stream_async for SKFunction (#2200)
### 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.
-->
while implementing #1691, there was an idea that adding
`invoke_stream_async` on `SKFunction` is reasonable.

<img width="870" alt="image"
src="https://github.com/microsoft/semantic-kernel/assets/69464062/44278d30-66b2-41d2-8c9f-c1daea50b331">



### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
moved temporal streaming logic from `Kernel` to `SKFunction`
I didn't want to add new `DelegateTypes` like `InStringOutStreaming` for
minimal changes.

in most cases, `SKFunction` is initiated from `from_semantic_config` or
`from_native_method`.
Now, both functions will handle the 'delegate_stream_function' argument,
which will be used in `invoke_stream_async`



### Contribution Checklist

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

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄

---------

Co-authored-by: Abby Harrison <[email protected]>
2023-08-04 19:06:27 +00:00
..