Complete output is not visible in Process Framework C# #10564
Replies: 2 comments
-
Sorry, the issue is not that "there is a need to mention publish step at last", I have changed the code as below and it started workingusing Microsoft.SemanticKernel.ChatCompletion; ///Below i have defined the steps that are needed in the process, Next I will define the process flow, how these steps will be executed. //Addig the steps to the process //Orchestrating the steps infogatheringstep generatedocsstep var configuration = new ConfigurationBuilder() // Register Kernel and Agents Kernel kernel = Kernel.CreateBuilder() var process = processBuilder.Build(); //Definig a process to gather information about a product public class GenerateDocumentationStep : KernelProcessStep
} public class PublishDocumentationStep : KernelProcessStep |
Beta Was this translation helpful? Give feedback.
-
Tagging @alliscode for visibility. |
Beta Was this translation helpful? Give feedback.
-
I have tried Process Framework by playing with New Documentation on Process Framework (https://learn.microsoft.com/en-us/semantic-kernel/frameworks/process/examples/example-first-process?pivots=programming-language-csharp), I have noticed that No PublishDocumentationStep has been defined the Process Orchestrate as Shown Below:


But still it was said that whole output is there.
First of all my query is that is there a need to define to PublishDocumentationStep or not?
Below is my code, and I am not getting the result of my last step, How I can improve my code or what point I am missing out?
using Microsoft.SemanticKernel.ChatCompletion;
using Microsoft.SemanticKernel;
using Microsoft.Extensions.Configuration;
using static GenerateDocumentationStep;
///Below i have defined the steps that are needed in the process, Next I will define the process flow, how these steps will be executed.
ProcessBuilder processBuilder = new("DocumentationGeneration");
//Addig the steps to the process
var infogatheringstep = processBuilder.AddStepFromType();
var generatedocsstep = processBuilder.AddStepFromType();
var publishdocstep = processBuilder.AddStepFromType();
//Orchestrating the steps
processBuilder
.OnInputEvent("Start")
.SendEventTo(new(infogatheringstep));
infogatheringstep
.OnFunctionResult()
.SendEventTo(new(generatedocsstep));
generatedocsstep
.OnFunctionResult()
.SendEventTo(new(publishdocstep));
publishdocstep
.OnFunctionResult()
.StopProcess();
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.Build();
// Register Kernel and Agents
string? AZURE_OPEN_AI_ENDPOINT = configuration["LlmModels:AiFoundryEndpoint"];
string? AZURE_OPEN_AI_KEY = configuration["LlmModels:AiFoundryApiKey"];
string? DEPLOYMENT_MODEL = configuration["LlmModels:GPT-4o-2"];
Kernel kernel = Kernel.CreateBuilder()
.AddAzureOpenAIChatCompletion(DEPLOYMENT_MODEL!, AZURE_OPEN_AI_ENDPOINT!, AZURE_OPEN_AI_KEY!)
.Build();
var process = processBuilder.Build();
await process.StartAsync(kernel, new KernelProcessEvent{ Id = "Start", Data = "Tata Tea" });
//Definig a process to gather information about a product
public class GatherProductInfoStep : KernelProcessStep
{
[KernelFunction]
public string GatherProductInfo(string productName)
{
Console.WriteLine($"{nameof(GatherProductInfoStep)}:\n\t Gathering Trial Info About: {productName}");
return
$"""
The Information about the product: {productName}
""";
}
}
public class GenerateDocumentationStep : KernelProcessStep
{
private GenerateDocumentationStepState _state = new();
}
public class PublishDocumentationStep : KernelProcessStep
{
[KernelFunction]
public void PublishDocumentation(string docs)
{
Console.WriteLine($"{nameof(PublishDocumentationStep)}:\n\tPublishing product documentation:\n\n{docs}");
}
}
Beta Was this translation helpful? Give feedback.
All reactions