-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<Window | ||
x:Class="msbuild_gui.APISettings" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:app="clr-namespace:msbuild_gui" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:msbuild_gui" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:properties="clr-namespace:msbuild_gui.Properties" | ||
xmlns:sys="clr-namespace:System;assembly=netstandard" | ||
xmlns:ui="http://schemas.modernwpf.com/2019" | ||
Title="{Binding Resources.OpenAIAPISetting, Source={x:Static app:ResourceService.Current}, Mode=OneWay}" | ||
Width="350" | ||
Height="400" | ||
ui:WindowHelper.UseModernWindowStyle="True" | ||
Closing="Window_Closing" | ||
KeyDown="Window_KeyDown" | ||
ResizeMode="NoResize" | ||
ShowInTaskbar="False" | ||
WindowStartupLocation="CenterScreen" | ||
WindowStyle="ToolWindow" | ||
mc:Ignorable="d"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="5*" /> | ||
<RowDefinition /> | ||
</Grid.RowDefinitions> | ||
<StackPanel Margin="10,0,10,0"> | ||
<Label HorizontalAlignment="Left" Content="Provider" /> | ||
<ComboBox | ||
x:Name="ProviderComboBox" | ||
Width="120" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" | ||
SelectionChanged="ProviderComboBox_SelectionChanged"> | ||
<ComboBoxItem Content="OpenAI" /> | ||
<ComboBoxItem Content="Azure" /> | ||
</ComboBox> | ||
<Label HorizontalAlignment="Left" Content="API Key" /> | ||
<PasswordBox | ||
x:Name="APIKeyPasswordbox" | ||
MinWidth="200" | ||
VerticalAlignment="Top" | ||
PasswordChar="*"> | ||
<PasswordBox.Background> | ||
<SolidColorBrush Opacity="0.5" Color="{DynamicResource SystemChromeLowColor}" /> | ||
</PasswordBox.Background> | ||
</PasswordBox> | ||
<Label HorizontalAlignment="Left" Content="Model" /> | ||
<ComboBox | ||
x:Name="ModelComboBox" | ||
MinWidth="140" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Top" /> | ||
<Label HorizontalAlignment="Left" Content="Deployment-ID" /> | ||
<TextBox | ||
x:Name="DeploymentIdTextbox" | ||
MinWidth="200" | ||
VerticalAlignment="Top"> | ||
<TextBox.Background> | ||
<SolidColorBrush Opacity="0.5" Color="{DynamicResource SystemChromeLowColor}" /> | ||
</TextBox.Background> | ||
</TextBox> | ||
<Label HorizontalAlignment="Left" Content="BaseDomain" /> | ||
<TextBox | ||
x:Name="BaseDomainTextbox" | ||
MinWidth="200" | ||
VerticalAlignment="Top" | ||
ui:ControlHelper.PlaceholderText=""> | ||
<TextBox.Background> | ||
<SolidColorBrush Opacity="0.5" Color="{DynamicResource SystemChromeLowColor}" /> | ||
</TextBox.Background> | ||
</TextBox> | ||
</StackPanel> | ||
<Button | ||
x:Name="OkButton" | ||
Grid.Row="2" | ||
Width="120" | ||
Height="30" | ||
MinWidth="60" | ||
Margin="0,0,10,10" | ||
Padding="0,0,0,0" | ||
HorizontalAlignment="Right" | ||
VerticalAlignment="Bottom" | ||
Click="OkButton_Click" | ||
Content="_OK" | ||
IsDefault="True" | ||
Style="{StaticResource AccentButtonStyle}" /> | ||
</Grid> | ||
</Window> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
using ModernWpf; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
|
||
namespace msbuild_gui | ||
{ | ||
/// <summary> | ||
/// ColorSettings.xaml の相互作用ロジック | ||
/// </summary> | ||
public partial class APISettings : Window | ||
{ | ||
public static bool OkFlg { get; set; } | ||
|
||
public APISettings() | ||
{ | ||
InitializeComponent(); | ||
this.WindowStartupLocation = WindowStartupLocation.CenterOwner; | ||
OkFlg = false; | ||
|
||
ProviderComboBox.Text = Properties.Settings.Default.Provider; | ||
Check failure on line 26 in msbuild-gui/APISettings.xaml.cs GitHub Actions / build
|
||
APIKeyPasswordbox.Password = Properties.Settings.Default.APIKey; | ||
Check failure on line 27 in msbuild-gui/APISettings.xaml.cs GitHub Actions / build
|
||
DeploymentIdTextbox.Text = Properties.Settings.Default.AzDeploymentId; | ||
Check failure on line 28 in msbuild-gui/APISettings.xaml.cs GitHub Actions / build
|
||
BaseDomainTextbox.Text = Properties.Settings.Default.AzBaseDomain; | ||
Check failure on line 29 in msbuild-gui/APISettings.xaml.cs GitHub Actions / build
|
||
string[] modelList = Properties.Settings.Default.ModelList.Split(','); | ||
Check failure on line 30 in msbuild-gui/APISettings.xaml.cs GitHub Actions / build
|
||
foreach(string model in modelList) | ||
{ | ||
ModelComboBox.Items.Add(model); | ||
} | ||
ModelComboBox.Text = Properties.Settings.Default.Model; | ||
Check failure on line 35 in msbuild-gui/APISettings.xaml.cs GitHub Actions / build
|
||
} | ||
/// <summary> | ||
/// 閉じるボタン押下時 | ||
/// </summary> | ||
protected virtual void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) | ||
{ | ||
if (OkFlg == false) | ||
{ | ||
} | ||
} | ||
|
||
private void OkButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
OkFlg = true; | ||
|
||
Properties.Settings.Default.Provider = ProviderComboBox.Text; | ||
Check failure on line 51 in msbuild-gui/APISettings.xaml.cs GitHub Actions / build
|
||
Properties.Settings.Default.APIKey = APIKeyPasswordbox.Password; | ||
Check failure on line 52 in msbuild-gui/APISettings.xaml.cs GitHub Actions / build
|
||
Properties.Settings.Default.Model = ModelComboBox.Text; | ||
Check failure on line 53 in msbuild-gui/APISettings.xaml.cs GitHub Actions / build
|
||
Properties.Settings.Default.AzDeploymentId = DeploymentIdTextbox.Text; | ||
Check failure on line 54 in msbuild-gui/APISettings.xaml.cs GitHub Actions / build
|
||
Properties.Settings.Default.AzBaseDomain = BaseDomainTextbox.Text; | ||
Properties.Settings.Default.Save(); | ||
this.Close(); | ||
} | ||
private void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) | ||
{ | ||
if (e.Key == Key.Escape) | ||
{ | ||
this.Close(); | ||
} | ||
} | ||
|
||
private void ProviderComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | ||
{ | ||
if (ProviderComboBox.SelectedItem == null) return; | ||
if (ProviderComboBox.SelectedItem.ToString() == "System.Windows.Controls.ComboBoxItem: OpenAI") | ||
{ | ||
ModelComboBox.IsEnabled = true; | ||
DeploymentIdTextbox.IsEnabled = false; | ||
BaseDomainTextbox.IsEnabled = false; | ||
} | ||
else | ||
{ | ||
ModelComboBox.IsEnabled = false; | ||
DeploymentIdTextbox.IsEnabled = true; | ||
BaseDomainTextbox.IsEnabled = true; | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"schema": 1, | ||
"type": "completion", | ||
"description": "Analyze the cause of C# error messages received", | ||
"completion": { | ||
"temperature": 0.0, | ||
"top_p": 0.0, | ||
"presence_penalty": 0.0, | ||
"frequency_penalty": 0.0 | ||
}, | ||
"input": { | ||
"parameters": [ | ||
{ | ||
"name": "errorMessage", | ||
"description": "error message", | ||
"defaultValue": "" | ||
} | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# System | ||
Your role involves addressing all types of C# errors with a focus on providing complex and detailed explanations suitable for experienced programmers. | ||
Accuracy is paramount in your responses. When analyzing error messages, offer in-depth technical insights and suggest advanced debugging techniques. | ||
Your advice should be precise, catering to users with a strong understanding of programming concepts. | ||
Ensure that your responses delve into the nuances of C# programming, providing high-level guidance and expert advice. | ||
This approach will help experienced programmers gain a deeper understanding of the issues they are facing and how to resolve them effectively. | ||
If the error message occurs in more than one .csproj, please explain each one separately. | ||
Please answer in {{$language}}. | ||
|
||
# Error message | ||
{{$errorMessage}} |