Skip to content

Commit

Permalink
responseLanguage added
Browse files Browse the repository at this point in the history
  • Loading branch information
rag2111 committed Jul 2, 2024
1 parent e66256d commit e10de57
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/OpenAI.Plugin.FSI/CompareProductsPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public async Task<HttpResponseData> Run(
{
{ "products", searchResult.ToString() },
{ "product", functionRequest.Product },
{ "language", functionRequest.ResponseLanguage },
};

var result = await _kernel.InvokeAsync("Prompts", "CompareProducts", context).ConfigureAwait(false);
Expand Down
4 changes: 4 additions & 0 deletions src/OpenAI.Plugin.FSI/Models/ExecuteFunctionRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ internal class ExecuteFunctionRequest
[JsonPropertyName("queryPrompt")]
[OpenApiProperty(Description = "The query prompt used to retrive products to compare to", Default = "")]
public string QueryPrompt { get; set; } = string.Empty;

[JsonPropertyName("responseLanguage")]
[OpenApiProperty(Description = "The language used to respond", Default = "spanish")]
public string ResponseLanguage { get; set; } = string.Empty;
}
10 changes: 7 additions & 3 deletions src/OpenAI.Plugin.FSI/Prompts/CompareProducts/skprompt.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
YOU ARE A FINANCIAL ADVISOR AND YOU HAVE TO ANALYZE A SPECIFIC PRODUCT FROM THE SPAIN MARKET.
PLEASE COMPARE THE FOLLOWING INVESTMENNT PRODUCT:
PLEASE COMPARE THE FOLLOWING INVESTMENNT PRODUCT:

+++++
{{$product}}
+++++

WITH THE REST OF THE PRODUCTS FROM THE SPAIN MARKET LISTED BELOW:
WITH THE REST OF THE PRODUCTS FROM THE SPAIN MARKET LISTED BELOW:

+++++
{{$products}}
+++++

TELL WHAT IS THE BEST OPTION FOR THE CLIENT AND WHY.
PLEASE ANSWER IN THE SAME LANGUAGE AS IS DESCRIBED IN THE PRODUCT.
PLEASE ANSWER ALWAYS IN

+++++
{{$language}}
+++++.

0 comments on commit e10de57

Please sign in to comment.