Skip to content

Commit 54d5465

Browse files
committed
Adjust component id and blazor namespace
1 parent 6857d7f commit 54d5465

File tree

4 files changed

+16
-20
lines changed

4 files changed

+16
-20
lines changed

src/AzureOpenAIProxy.PlaygroundApp/Components/UI/ParameterListComponent.razor renamed to src/AzureOpenAIProxy.PlaygroundApp/Components/UI/ParameterMultiselectComponent.razor

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<div id="@Id">
44
<label id=@($"{Id}-label") for=@($"{Id}-content")
5+
class="parameter-child-label"
56
style="display:inline-block;padding-left:5px;">
67
@LabelText
78

@@ -18,7 +19,8 @@
1819
</label>
1920

2021
<div id=@($"{Id}-content")>
21-
<FluentAutocomplete TOption="string" Multiple="true" AutoComplete="false"
22+
<FluentAutocomplete Id=@($"{Id}-textfield")
23+
TOption="string" Multiple="true" AutoComplete="false"
2224
ShowOverlayOnEmptyResults="false"
2325
SelectValueOnTab="true"
2426
MaximumOptionsSearch="1"

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@typeparam TValue where TValue : System.Numerics.INumber<TValue>
33

44
<div id="@Id">
5-
<label id=@($"{Id}-label") class="parameter-label" for=@($"{Id}-content")>
5+
<label id=@($"{Id}-label") class="parameter-component-label" for=@($"{Id}-content")>
66
@LabelText
77

88
@* Tooltip Image *@
@@ -21,18 +21,18 @@
2121
Orientation="Orientation.Horizontal"
2222
Style="column-gap:0px">
2323

24-
<FluentSlider Class="parameter-slider"
24+
<FluentSlider Id=@($"{Id}-slider") Class="parameter-component-slider"
2525
Min="@Min" Max="@Max" Step="@Step"
2626
@bind-Value=Value @bind-Value:after=AfterSliderChange />
2727

28-
<FluentTextField Class="parameter-textfield"
28+
<FluentTextField Id=@($"{Id}-textfield") Class="parameter-component-textfield"
2929
@bind-Value=textFieldValue @bind-Value:after=AfterTextFieldChange />
3030

3131
</FluentStack>
3232

3333
@if (!hasNoError)
3434
{
35-
<FluentCard Class="parameter-error">
35+
<FluentCard Class="parameter-component-error">
3636
@errorText
3737
</FluentCard>
3838
}

src/AzureOpenAIProxy.PlaygroundApp/Components/UI/ParameterSliderComponent.razor.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
::deep .parameter-label {
1+
::deep .parameter-component-label {
22
display: inline-block;
33
padding-left: 5px;
44
}
55

6-
::deep .parameter-slider {
6+
::deep .parameter-component-slider {
77
width: 88%;
88
padding-top: 15px;
99
}
1010

11-
::deep .parameter-textfield {
11+
::deep .parameter-component-textfield {
1212
width: 12%;
1313
font-size: 9px;
1414
padding-right: 5px;
1515
}
1616

17-
::deep .parameter-error {
17+
::deep .parameter-component-error {
1818
padding: 10px;
1919
width: 95%;
2020
margin: 5px auto;

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,42 @@
33
<div id="@Id" class="parameter-tab">
44
@* Past Messages Slider *@
55
<ParameterSliderComponent Id="slider-past-messages"
6-
Class="label-with-tooltip"
76
LabelText="Past messages included"
87
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."
98
Min="1" Max="20" Step="1" @bind-Value=@pastMessagesValue />
109

1110
@* Max Response Slider *@
1211
<ParameterSliderComponent Id="slider-max-response"
13-
Class="label-with-tooltip"
1412
LabelText="Max response"
1513
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."
1614
Min="1" Max="16000" Step="1" @bind-Value=@maxResponseValue />
1715

1816
@* Temperature Slider *@
1917
<ParameterSliderComponent Id="slider-temperature"
20-
Class="label-with-tooltip"
2118
LabelText="Temperature"
2219
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."
2320
Min="0" Max="1" Step="0.01" @bind-Value=@temperatureValue />
2421

2522
@* Top P Slider *@
2623
<ParameterSliderComponent Id="slider-top-p"
27-
Class="label-with-tooltip"
2824
LabelText="Top P"
2925
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."
3026
Min="0" Max="1" Step="0.01" @bind-Value=@topPValue />
3127

3228
@* Stop Sequence Auto Complete *@
33-
<ParameterListComponent Id="complete-stop-sequence"
34-
LabelText="Stop sequence"
35-
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."
36-
@ref=stopSequence />
29+
<ParameterMultiselectComponent Id="multiselect-stop-sequence"
30+
LabelText="Stop sequence"
31+
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."
32+
@ref=stopSequence />
3733

3834
@* Frequency Penalty Slider *@
3935
<ParameterSliderComponent Id="slider-frequency-penalty"
40-
Class="label-with-tooltip"
4136
LabelText="Frequency penalty"
4237
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."
4338
Min="0" Max="2" Step="0.01" @bind-Value=@frequencyPenaltyValue />
4439

4540
@* Presence Penalty Slider *@
4641
<ParameterSliderComponent Id="slider-presence-penalty"
47-
Class="label-with-tooltip"
4842
LabelText="Presence penalty"
4943
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."
5044
Min="0" Max="2" Step="0.01" @bind-Value=@presencePenaltyValue />
@@ -62,5 +56,5 @@
6256
private double frequencyPenaltyValue = 0;
6357
private double presencePenaltyValue = 0;
6458

65-
private ParameterListComponent? stopSequence;
59+
private ParameterMultiselectComponent? stopSequence;
6660
}

0 commit comments

Comments
 (0)