Commit Graph
9 Commits
Author SHA1 Message Date
Estefanía TenorioandEstefania Tenorio 3c13912c9d .Net Processes - Refactoring/expanding Process Sample02 (#9811)
### Description

- Updating Sample 02 to expand the usage and show case how to refactor
the same process by using subprocesses as steps.
- Improving README file with more details on this sample
- Add more unit tests for Process testing/improving comments

Fixes #9836 
Fixes #9837 

### 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 😄

---------

Co-authored-by: Estefania Tenorio <[email protected]>
2024-12-04 16:59:45 +00:00
Jose Luis Latorre MillasandChris 983da690be .Net: process framework - Simplest step implementation and simplification of Function event resolution for steps with 1 function. (#9650)
…

### Motivation and Context
**Required:** 
I would like to have a process framework with a simplified process and
steps, showing how simple, easy and straightforward it can be. I want
this example to take away the fear and reduce the cognitive load as a
"first super-easy step".

**Problem solved:**
Excessive cognitive load on the first example. There Should be a
super-easy step that is and feels easy. I believe this gets close to it
:)

**Scenario:**
Learning, taking the fear out. Helping in making it easier.

**Simplification added:**
Also to simplify it even further i added the feature that the Function
event name gets resolved when there is a single function
When declaring the process, instead of:

```
        startStep
            .OnEvent(StartStep.OutputEvents.Executed)
            .SendEventTo(new ProcessFunctionTargetBuilder(doSomeWorkStep));

        doSomeWorkStep
            .OnEvent(DoSomeWorkStep.OutputEvents.Executed)
            .SendEventTo(new ProcessFunctionTargetBuilder(doMoreWorkStep));

        doMoreWorkStep
            .OnEvent(DoMoreWorkStep.OutputEvents.Executed)
            .SendEventTo(new ProcessFunctionTargetBuilder(endStep));

        endStep
            .OnEvent(EndStep.OutputEvents.Executed)
            .StopProcess(); 
```

I would like to do the following:

 ```
       startStep
            .OnFunctionResult()
.SendEventTo(new ProcessFunctionTargetBuilder(doSomeWorkStep));

        doSomeWorkStep
            .OnFunctionResult()
.SendEventTo(new ProcessFunctionTargetBuilder(doMoreWorkStep));

        doMoreWorkStep
            .OnFunctionResult()
            .SendEventTo(new ProcessFunctionTargetBuilder(endStep));

        endStep
            .OnFunctionResult()
            .StopProcess();
```
So that the Function is inferred by the framework, reducing verbosity and cognitive load.

Fixes: https://github.com/microsoft/semantic-kernel/issues/9647
Fixes: https://github.com/microsoft/semantic-kernel/issues/9648



### Description

- Added example Step00 (process, steps )
- Added documentation
- Added the small refactoring on the StepProcessBuilder to support Function resolution when "there is only one"

### 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 😄

---------

Co-authored-by: Chris <[email protected]>
2024-11-15 17:13:09 +00:00
Estefanía TenorioandChris a7a56e5782 .Net: Processes State Management Part 2 (#9481)
### Description

- Moving `ProcessStateMetadata` logic to factory/extension to try to
keep clean existing core components
- Adding check of step name when adding new steps/processes to process -
names must be unique so when applying saved state it propagates
properly. Currently there are issues if multiple steps have the same
name
- State versioning initial support:
- Processes with 1:1 step match previous and new version (step name
change and/or step logic change) - minor changes on process steps and
not in root process itself


Fixing #9358 

#### Out of scope but will be addressed in next PRs
    
- Processes with N:M steps (process flow changed and potentially also
step logic changed)
- New samples showcasing how to make use of N:M mapping

### 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 😄

---------

Co-authored-by: Chris <[email protected]>
2024-11-05 18:38:04 +00:00
Estefanía Tenorio db354ec387 .Net: Processes - Stateful food preparation samples (#9300)
### Description

Adding Stateful Food Preparation Samples

- refactoring existing gatherIngredients step
- adding stateful gatherIngredients step
- adding stateful cutFoodStep with knifeSharpening to showcase state
persistance and use across functions in same step
- adding samples making use of different processes - state resets - and
the same process multiple times - last state gets reused

### 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 😄
2024-10-17 17:33:43 +00:00
Chris b55cb8a0e1 .Net Processes - Agents Sample (#9272)
### 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.
-->

Demonstrate use of agents within process framework.

### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

**Demonstrate patterns for:**

- Direct agent invocation
- Dynamic user interaction
- Group chat delegation (nested)

**Also addressed:**
- Fix case where `ScriptedUserInputStep` throwing exception (silent
failure)
- Updated `BaseTest` to make use of config helper when desire is to
preserve the `IKernelBuilder`
- Fixed indexing boundary condition when using
`ChatHistorySummarizationReducer`
- Fixed sequencing issue with `SequentialSelectionStrategy` when
`InitialAgent` is set

### 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 😄
2024-10-17 15:34:46 +00:00
Estefanía Tenorio 474cc69099 .Net: Fixing Processes food samples diagram links + step name fix (#9262)
### Description

- Fixing Processes Food Samples links to respective diagrams + adding
some steps specific names
- Reorganizing Process Food Samples in 2 files -> allows to build
concepts in more detail later: more samples to be added in another PR in
the near future

### 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 😄
2024-10-16 16:10:01 +00:00
Estefanía Tenorio a4ddbaa0ab .Net: SK Process - Sample 3 Food related samples (#9087)
### Description
Adding more SK Processes samples:

- Creating SK Process Event Builder: helps link process events to Steps
internal events
- Adding samples to showcase:
    - reuse of steps]
    - use of steps specific functions
    - how to make use of step functions that output multiple events
    - use of cycles: FoodRuined -> must prepare the food from scratch

For additional details check the `GettingStartedWithProcesses/README.md`
file

### 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 😄
2024-10-08 22:29:57 +00:00
BobbyTable e183873f6d .Net: Update README.md (#9049)
Fixed url:s in documentation that lead to 404's

### Motivation and Context

Url's were broken in the docs

### Description

Pointed them to the correct location 

### Contribution Checklist

- [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 😄
2024-10-01 14:10:01 +00:00
Estefanía TenorioandBen Thomas bd4d12bcbf .Net: Processes Sample - Account Creation (#8990)
### 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.
-->

### Description

Adding New Processes Feature Sample -  Create Account

This sample helps showcase the capabilities of process showing the use
of:
- cycles
- conditional outputs
- use of multiple outputs/inputs -> fan-in/fan-out behavior
- complex example that showcases a real life scenario

Adding Processes Samples README with diagrams to make it easier to
understand how the sample processes flow works

### 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 😄

---------

Co-authored-by: Ben Thomas <[email protected]>
2024-09-30 14:54:44 +00:00