Skip to content

Commit c83eb2b

Browse files
committed
Comment and code style update
1 parent e7db750 commit c83eb2b

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

src/AzureOpenAIProxy.PlaygroundApp/Components/UI/LabelWithTooltip.razor

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
<FluentLabel Typo="Typography.Body" Style=@Style>
22
@LabelText
3+
4+
@* Tooltip Image *@
35
<FluentIcon Id=@anchorId Value="@(new Icons.Regular.Size12.Info())" />
46
<FluentTooltip Anchor=@anchorId Position="TooltipPosition.End"
57
UseTooltipService="false"
68
MaxWidth="250px"
79
Style="line-break:anywhere">
810
@TooltipText
911
</FluentTooltip>
12+
1013
</FluentLabel>
1114

1215
@code {

src/AzureOpenAIProxy.PlaygroundApp/Components/UI/ParametersTabComponent.razor

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
11
@using System.Linq
22

33
<FluentLayout Id="@Id">
4+
5+
@* Past Messages Slider *@
46
<LabelWithTooltip Id="slider-past-messages"
57
LabelText="Past messages included"
68
TooltipText="Select the number of past messages to include in each new API request. This helps give the model context for new user queries. Setting this number to 10 will include 5 user queries and 5 system responses."
79
Style="padding-left:10px;font-weight:bold" />
810

911
<SliderWithTextfield Min="1" Max="20" Step="1" @bind-Value=@pastMessagesValue Style="padding-left:5px;padding-right:10px;" />
1012

13+
@* Max Response Slider *@
1114
<LabelWithTooltip Id="slider-max-response"
1215
LabelText="Max response"
1316
TooltipText="Set a limit on the number of tokens per model response. The API supports a maximum of MaxTokensPlaceholderDoNotTranslate tokens shared between the prompt (including system message, examples, message history, and user query) and the model's response. One token is roughly 4 characters for typical English text."
1417
Style="padding-left:10px;font-weight:bold" />
18+
1519
<SliderWithTextfield Min="1" Max="16000" Step="1" @bind-Value=@maxResponseValue Style="padding-left:5px;padding-right:10px;" />
1620

21+
@* Temperature Slider *@
1722
<LabelWithTooltip Id="slider-temperature"
1823
LabelText="Temperature"
1924
TooltipText="Controls randomness. Lowering the temperature means that the model will produce more repetitive and deterministic responses. Increasing the temperature will result in more unexpected or creative responses. Try adjusting temperature or Top P but not both."
2025
Style="padding-left:10px;font-weight:bold" />
26+
2127
<SliderWithTextfield Min="0" Max="1" Step="0.01" @bind-Value=@temperatureValue Style="padding-left:5px;padding-right:10px;" />
2228

29+
@* Top P Slider *@
2330
<LabelWithTooltip Id="slider-top-p"
2431
LabelText="Top P"
2532
TooltipText="Similar to temperature, this controls randomness but uses a different method. Lowering Top P will narrow the model’s token selection to likelier tokens. Increasing Top P will let the model choose from tokens with both high and low likelihood. Try adjusting temperature or Top P but not both."
2633
Style="padding-left:10px;font-weight:bold" />
2734
<SliderWithTextfield Min="0" Max="1" Step="0.01" @bind-Value=@topPValue Style="padding-left:5px;padding-right:10px;" />
2835

36+
@* Stop Sequence Auto Complete *@
2937
<LabelWithTooltip Id="complete-stop-sequence"
3038
LabelText="Stop sequence"
3139
TooltipText="Make the model end its response at a desired point. The model response will end before the specified sequence, so it won't contain the stop sequence text. For ChatGPT, using <|im_end|> ensures that the model response doesn't generate a follow-up user query. You can include as many as four stop sequences."
@@ -43,17 +51,22 @@
4351
</OptionTemplate>
4452
</FluentAutocomplete>
4553

54+
@* Frequency Penalty Slider *@
4655
<LabelWithTooltip Id="slider-frequency-penalty"
4756
LabelText="Frequency penalty"
4857
TooltipText="Reduce the chance of repeating a token proportionally based on how often it has appeared in the text so far. This decreases the likelihood of repeating the exact same text in a response."
4958
Style="padding-left:10px;font-weight:bold" />
59+
5060
<SliderWithTextfield Min="0" Max="2" Step="0.01" @bind-Value=@frequencyPenaltyValue Style="padding-left:5px;padding-right:10px;" />
5161

62+
@* Presence Penalty Slider *@
5263
<LabelWithTooltip Id="slider-presence-penalty"
5364
LabelText="Presence penalty"
5465
TooltipText="Reduce the chance of repeating any token that has appeared in the text at all so far. This increases the likelihood of introducing new topics in a response."
5566
Style="padding-left:10px;font-weight:bold" />
67+
5668
<SliderWithTextfield Min="0" Max="2" Step="0.01" @bind-Value=@presencePenaltyValue Style="padding-left:5px;padding-right:10px;" />
69+
5770
</FluentLayout>
5871

5972
@code {

src/AzureOpenAIProxy.PlaygroundApp/Components/UI/SliderWithTextfield.razor

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
@typeparam TValue where TValue : System.Numerics.INumber<TValue>
22

33
<FluentStack Orientation="Orientation.Horizontal" Style=@Style>
4+
45
<FluentSlider Min="@Min" Max="@Max" Step="@Step"
56
@bind-Value=Value @bind-Value:after=AfterSliderChange
67
Style="width:88%;padding-top:15px;" />
8+
79
<FluentTextField @bind-Value=textFieldValue @bind-Value:after=AfterTextFieldChange
810
Style="width:12%;padding-left:0px" />
11+
912
</FluentStack>
1013

1114
@if (!hasNoError)
1215
{
1316
<FluentCard Style="padding:10px;width:95%;margin:0 auto;border-color:crimson;background-color:lightcoral;color:black">
1417
@errorText
15-
</FluentCard>
18+
</FluentCard>
1619
}
1720

1821
@code {

0 commit comments

Comments
 (0)