Search Results for

    ⚙️ PromptStreamService

    PromptStreamService is the central orchestrator in PromptStream.AI.
    It wraps building, validating, analyzing, and model generation into one cohesive workflow.


    Example

    var service = new PromptStreamService(new TokenFlowProvider());
    var template = new PromptTemplate
    {
        Template = "Summarize {{topic}}",
        RequiredVariables = new() { "topic" }
    };
    var vars = new Dictionary<string, string> { ["topic"] = "climate change" };
    
    var response = await service.GenerateAsync(template, vars);
    Console.WriteLine(response.Content);
    

    Responsibilities

    Method Description
    BuildAndValidate Builds and validates a prompt.
    BuildAndValidateAsync Async version for background operations.
    AnalyzePrompt Returns validation summary and token stats.
    GenerateAsync Produces model response via IModelClient.
    • Edit this page
    In this article
    Back to top Generated by DocFX