Skip to content

Few shot prompting not working for function calling - getting error #6801

Discussion options

You must be logged in to vote

Hi @EVENFLOW212

thanks for the question.

I put together a sample to try out your scenario, here's the code

public sealed class OpenAI_RepeatedFunctionCalling(ITestOutputHelper output) : BaseTest(output)
{
    /// <summary>
    /// Sample shows how to reuse a function result from the chat history.
    /// </summary>
    [Fact]
    public async Task ReuseFunctionResultExecutionAsync()
    {
        // Create a kernel with OpenAI chat completion and WeatherPlugin
        Kernel kernel = CreateKernelWithPlugin<WeatherPlugin>();
        var service = kernel.GetRequiredService<IChatCompletionService>();

        // Invoke chat prompt with auto invocation of functions enabled
        var chatHis…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by sophialagerkranspandey
Comment options

You must be logged in to vote
1 reply
@EVENFLOW212
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
.NET Issue or Pull requests regarding .NET code
2 participants