.Net: How to get Rendered prompt alone without invoking the model
Hi Team,
We have few plugins defined with each prompt provides data + instructions to analyze this data. We are using function.InvokeAsync() to invoke this plugin.
This function call is invoking the model after getting the data + instructions. But we don't want to invoke the model. Instead wants to get the rendered prompt alone. Is there any function/approach to get rendered prompt alone without invoking the model?
Thank you.
@ddramireddy Here is a unit test which shows how to do this: https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/SemanticKernel.UnitTests/PromptTemplate/KernelPromptTemplateTests.cs#L105-L128
Hi @markwallace-microsoft ,
We were overriding the method: "GetChatCompletionsAsync()" method. When I call, RenderAsync() method, We can see that it's internally calling the GetChatCompletionsAsync() method and which in turn is calling the model.
Hi @ddramireddy if your prompt contains a function call, then rendering the prompt will invoke the function as the rendered prompt includes the return value from the function. Can you provide a reproducible scenario and more details on what you are trying to achieve?
@ddramireddy please create a new issue if you need further assistance