Skip to content

Commit 054c16b

Browse files
committed
Change component name and id
1 parent 25c4692 commit 054c16b

File tree

4 files changed

+33
-39
lines changed

4 files changed

+33
-39
lines changed

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
@using System.Linq
22

33
<div id="@Id" class="parameter-tab">
4-
@* Past Messages Slider *@
5-
<ParameterSliderComponent Id="slider-past-messages"
4+
@* Past Messages Range *@
5+
<ParameterRangeComponent Id="range-past-messages"
66
LabelText="Past messages included"
77
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."
88
Min="1" Max="20" Step="1" @bind-Value=@pastMessagesValue />
99

10-
@* Max Response Slider *@
11-
<ParameterSliderComponent Id="slider-max-response"
10+
@* Max Response Range *@
11+
<ParameterRangeComponent Id="range-max-response"
1212
LabelText="Max response"
1313
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."
1414
Min="1" Max="16000" Step="1" @bind-Value=@maxResponseValue />
1515

16-
@* Temperature Slider *@
17-
<ParameterSliderComponent Id="slider-temperature"
16+
@* Temperature Range *@
17+
<ParameterRangeComponent Id="range-temperature"
1818
LabelText="Temperature"
1919
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."
2020
Min="0" Max="1" Step="0.01" @bind-Value=@temperatureValue />
2121

22-
@* Top P Slider *@
23-
<ParameterSliderComponent Id="slider-top-p"
22+
@* Top P Range *@
23+
<ParameterRangeComponent Id="range-top-p"
2424
LabelText="Top P"
2525
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."
2626
Min="0" Max="1" Step="0.01" @bind-Value=@topPValue />
2727

28-
@* Stop Sequence Auto Complete *@
29-
<ParameterMultiselectComponent Id="multiselect-stop-sequence"
28+
@* Stop Sequence Multi Select *@
29+
<ParameterMultiselectComponent Id="select-stop-sequence"
3030
LabelText="Stop sequence"
3131
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."
3232
@ref=stopSequence />
3333

34-
@* Frequency Penalty Slider *@
35-
<ParameterSliderComponent Id="slider-frequency-penalty"
34+
@* Frequency Penalty Range *@
35+
<ParameterRangeComponent Id="range-frequency-penalty"
3636
LabelText="Frequency penalty"
3737
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."
3838
Min="0" Max="2" Step="0.01" @bind-Value=@frequencyPenaltyValue />
3939

40-
@* Presence Penalty Slider *@
41-
<ParameterSliderComponent Id="slider-presence-penalty"
40+
@* Presence Penalty Range *@
41+
<ParameterRangeComponent Id="range-presence-penalty"
4242
LabelText="Presence penalty"
4343
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."
4444
Min="0" Max="2" Step="0.01" @bind-Value=@presencePenaltyValue />

test/AzureOpenAIProxy.PlaygroundApp.Tests/Pages/PlaygroundPageConfigWindowTests.cs

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ string expectedValue
358358
await applyButton.ClickAsync(new() { Delay = 500 });
359359
await resetButton.ClickAsync(new() { Delay = 500 });
360360
await Task.Delay(1000);
361-
361+
362362
var actualValue = await systemMessageTextArea.GetAttributeAsync("value");
363363
var isApplyButtonEnabled = await applyButton.GetAttributeAsync("disabled");
364364
var isResetButtonEnabled = await resetButton.GetAttributeAsync("disabled");
@@ -368,27 +368,24 @@ string expectedValue
368368
isApplyButtonEnabled.Should().NotBeNull();
369369
isResetButtonEnabled.Should().NotBeNull();
370370
}
371-
372-
[TestCase("slider-past-messages", "Past messages included")]
373-
[TestCase("slider-max-response", "Max response")]
374-
[TestCase("slider-temperature", "Temperature")]
375-
[TestCase("slider-top-p", "Top P")]
376-
[TestCase("slider-frequency-penalty", "Frequency penalty")]
377-
[TestCase("slider-presence-penalty", "Presence penalty")]
371+
372+
[TestCase("range-past-messages", "Past messages included")]
373+
[TestCase("range-max-response", "Max response")]
374+
[TestCase("range-temperature", "Temperature")]
375+
[TestCase("range-top-p", "Top P")]
376+
[TestCase("range-frequency-penalty", "Frequency penalty")]
377+
[TestCase("range-presence-penalty", "Presence penalty")]
378378
public async Task Given_ParameterTab_When_Updated_Then_Parameter_Slider_Should_Be_Visible(string id, string label)
379379
{
380380
// Arrange
381-
var parameterTab = Page.Locator("div.config-grid")
382-
.Locator("fluent-tabs#config-tabs")
383-
.Locator("fluent-tab#parameters-tab");
381+
var configTab = Page.Locator("div.config-grid")
382+
.Locator("fluent-tabs#config-tabs");
384383

384+
var parameterTab = configTab.Locator("fluent-tab#parameters-tab");
385385
await parameterTab.ClickAsync();
386386

387-
var component = Page.Locator("div.config-grid")
388-
.Locator("fluent-tabs#config-tabs")
389-
.Locator("fluent-tab-panel#parameters-tab-panel")
390-
.Locator($"div#{id}");
391-
387+
var component = configTab.Locator("fluent-tab-panel#parameters-tab-panel")
388+
.Locator($"div#{id}");
392389
var labelComponent = component.Locator($"label[for='{id}-content']");
393390

394391
// Act
@@ -403,21 +400,18 @@ public async Task Given_ParameterTab_When_Updated_Then_Parameter_Slider_Should_B
403400
}
404401

405402
[Test]
406-
[TestCase("multiselect-stop-sequence", "Stop sequence")]
403+
[TestCase("select-stop-sequence", "Stop sequence")]
407404
public async Task Given_ParameterTab_When_Updated_Then_Parameter_MultiSelect_Should_Be_Visible(string id, string label)
408405
{
409406
// Arrange
410-
var parameterTab = Page.Locator("div.config-grid")
411-
.Locator("fluent-tabs#config-tabs")
412-
.Locator("fluent-tab#parameters-tab");
407+
var configTab = Page.Locator("div.config-grid")
408+
.Locator("fluent-tabs#config-tabs");
413409

410+
var parameterTab = configTab.Locator("fluent-tab#parameters-tab");
414411
await parameterTab.ClickAsync();
415412

416-
var component = Page.Locator("div.config-grid")
417-
.Locator("fluent-tabs#config-tabs")
418-
.Locator("fluent-tab-panel#parameters-tab-panel")
419-
.Locator($"div#{id}");
420-
413+
var component = configTab.Locator("fluent-tab-panel#parameters-tab-panel")
414+
.Locator($"div#{id}");
421415
var labelComponent = component.Locator($"label[for='{id}-content']");
422416

423417
// Act

0 commit comments

Comments
 (0)