.net:in nuget “semantic-kernel”,some types of planner can’t invoke

This is my code

builder.AddOpenAIChatCompletion(modelId: "gpt-4o", apiKey: openAiKey,
    httpClient: new HttpClient(handler));//at this,i add a new httpclient 
_kernel = kernel.KernelBuild();
        var pluginDirectoryPath = Path.Combine(AppContext.BaseDirectory, "AiFun", "plugins", "OfficePlugin");
        _kernel.ImportPluginFromPromptDirectory(Path.Combine(pluginDirectoryPath, "SummarizePlugin"));
        _kernel.ImportPluginFromPromptDirectory(Path.Combine(pluginDirectoryPath, "WriterPlugin"));

        _kernel.ImportPluginFromType<MathPlugin>();
       
        planner = new HandlebarsPlanner(new HandlebarsPlannerOptions() { AllowLoops = true });
   
        var plan = await planner.CreatePlanAsync(_kernel, target);
        var result = (await plan.InvokeAsync(_kernel,new KernelArguments())).Trim();

If target is about “math”. It can be well done, but if I try that target is about WriterPlugin or SummarizePlugin plan can be created, but it can’t be invoked. For a long time, no response. Why?

details:

when target =”5+7+1″ ,can receive plan:

{{!-- Step 0: Extract key values --}}
{{set "value1" 5}}
{{set "value2" 7}}
{{set "value3" 1}}

{{!-- Step 1: Add 5 and 7 --}}
{{set "sum1" (MathPlugin-Add value=value1 amount=value2)}}

{{!-- Step 2: Add the previous sum and 1 --}}
{{set "finalSum" (MathPlugin-Add value=sum1 amount=value3)}}

{{!-- Step 3: Print the final result --}}
{{json finalSum}}

and it can be invoked ,result = 13

when target =”give me a poem”,can receive plan :

{{!-- Step 1: Set the scenario for the poem --}}

{{set "poemScenario" "a peaceful morning by the lake"}}

{{!-- Step 2: Generate the poem using the WriterPlugin-ShortPoem helper --}}

{{set "generatedPoem" (WriterPlugin-ShortPoem input=poemScenario)}}

{{!-- Step 3: Output the generated poem --}}

{{json generatedPoem}}

but it can’t be invoked .because it’s asyn ,app is awaiting for response.no error messages and no exception happen.

i found that ,to the api ,my app send :

{"messages":[{"content":"Generate a short funny poem or limerick to explain the given event. Be creative and be funny. Let your imagination run wild.nEvent:a peaceful morning by the laken","role":"user"}],"max_tokens":60,"temperature":0.5,"top_p":0,"n":1,"presence_penalty":0,"frequency_penalty":0,"model":"gpt-4o"}

and api can receive that :

{"id":"chatcmpl-9axNkvkL1OA9rriIQ5RCbQbwTUTIN","object":"chat.completion","created":1718595100,"model":"gpt-4o","choices":[{"index":0,"message":{"role":"assistant","content":"By the lake on a morning so bright,nA duck tried to take its first flight.nBut it slipped on a log,nFell right into a frog,nWho croaked, "Next time, use a kite!""},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":42,"completion_tokens":44,"total_tokens":86},"system_fingerprint":"fp_f4e629d0a5","code":0,"msg":"ok"}

it’s the same of that invoke plugin,but in plan.invoke,no message.

MathPlugin is from Microsoft.SemanticKernel.Plugins.Core

SummarizePlugin and WriterPlugin is from github “https://github.com/microsoft/semantic-kernel/tree/main/prompt_template_samples”

New contributor

猫猫秋小裤 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật