Skip to content

Commit 555b6dc

Browse files
chore(blazor): improve prompt and update model in blazor pdf assistant
1 parent 50be4cf commit 555b6dc

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

blazor/TelerikBlazorSmartAIComponents.Client/Pages/PdfViewerSmartAIAssistant.razor

+7-6
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@
9797
PageEmbeddings = chunks.Select(x => KeyValuePair.Create(x, embedder.Embed(x))).ToDictionary(k => k.Key, v => v.Value);
9898
var questionsJson = await CallOpenAIApi(
9999
@"You are a helpful assistant. Your task is to analyze the provided text and generate 3 short diverse questions.
100-
The questions should be returned in form of a string array in a valid JSON format. Return only the JSON and nothing else.",
100+
The questions should be returned in form of a string array in a valid JSON format. Return only the JSON and nothing else without markdown code formatting.
101+
Example output: [""Question 1"", ""Question 2"", ""Question 3""]",
101102
AllTextContent);
102103

103104
PromptSuggestions = System.Text.Json.JsonSerializer.Deserialize<List<string>>(questionsJson);
@@ -127,12 +128,12 @@
127128

128129
var chatCompletionsOptions = new ChatCompletionsOptions()
129130
{
130-
DeploymentName = "DEPLOYMENT_NAME",
131+
DeploymentName = "gpt-4o-mini",
131132
Messages =
132-
{
133-
new ChatRequestSystemMessage(systemPrompt),
134-
new ChatRequestUserMessage(message),
135-
}
133+
{
134+
new ChatRequestSystemMessage(systemPrompt),
135+
new ChatRequestUserMessage(message),
136+
}
136137
};
137138

138139
Response<ChatCompletions> response = await client.GetChatCompletionsAsync(chatCompletionsOptions);

0 commit comments

Comments
 (0)