Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added links to pages where possible to obtain API key and Organization ID during configuration of OpenAI settings #9

Merged
merged 1 commit into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Gpt.Labs/Controls/Dialogs/EditOpenAISettingsDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,21 @@
<TextBox x:Name="OpenAIOrganizationTextBox" x:Uid="OpenAIOrganizationTextBox"
Text="{x:Bind ViewModel.Organization, Mode=TwoWay}"
PlaceholderText="Enter OpenAI organization ID..."></TextBox>

<TextBlock Style="{StaticResource DescriptionStyle}">
<Run x:Uid="OpenAIOrganizationDescription1"/><Hyperlink NavigateUri="https://platform.openai.com/account/org-settings"><Run x:Uid="OpenAIOrganizationDescription2"/></Hyperlink><Run x:Uid="OpenAIOrganizationDescription3"/>
</TextBlock>

<TextBlock x:Name="OpenAIApiKeyLabel" x:Uid="OpenAIApiKeyLabel" Text="Secret key"
Style="{StaticResource LabelStyle}"/>

<TextBox x:Name="OpenAIApiKeyTextBox" x:Uid="OpenAIApiKeyTextBox"
Text="{x:Bind ViewModel.ApiKey, Mode=TwoWay}"
PlaceholderText="Enter OpenAI secret key..."></TextBox>

<TextBlock Style="{StaticResource DescriptionStyle}">
<Run x:Uid="OpenAIApiKeyDescription1"/><Hyperlink NavigateUri="https://platform.openai.com/account/api-keys"><Run x:Uid="OpenAIApiKeyDescription2"/></Hyperlink><Run x:Uid="OpenAIApiKeyDescription3"/>
</TextBlock>

<controls:ErrorsListPanel Margin="0 24 0 0"
ViewModel="{x:Bind ViewModel.Errors, Mode=OneWay}"
Expand Down
39 changes: 21 additions & 18 deletions src/Gpt.Labs/Controls/Wizards/Activation/OpenAISettingsControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,32 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<StackPanel Margin="16 0" Spacing="4">

<TextBlock x:Uid="OpenAISettingsLabel" Text="OpenAI settings" Style="{StaticResource SubtitleTextBlockStyle}" Margin="0 0 0 6" />

<TextBlock x:Name="OpenAIOrganizationLabel" x:Uid="OpenAIOrganizationLabel" Text="Organization ID"
Style="{StaticResource LabelStyle}"/>

<Grid Margin="16 0">

<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<TextBlock Grid.Row="0" x:Uid="OpenAISettingsLabel" Text="OpenAI settings" Style="{StaticResource SubtitleTextBlockStyle}" Margin="0 0 0 16" />

<TextBlock Grid.Row="1" x:Name="OpenAIOrganizationLabel" x:Uid="OpenAIOrganizationLabel" Margin="0 0 0 6" Text="Organization ID" TextWrapping="Wrap" Style="{StaticResource CaptionTextBlockStyle}"/>

<TextBox Grid.Row="2" x:Name="OpenAIOrganizationTextBox" x:Uid="OpenAIOrganizationTextBox"
<TextBox x:Name="OpenAIOrganizationTextBox" x:Uid="OpenAIOrganizationTextBox"
Text="{x:Bind ViewModel.Organization, Mode=TwoWay}"
PlaceholderText="Enter OpenAI organization ID..."></TextBox>

<TextBlock Grid.Row="3" x:Name="OpenAIApiKeyLabel" x:Uid="OpenAIApiKeyLabel" Margin="0 16 0 6" Text="Secret key" TextWrapping="Wrap" Style="{StaticResource CaptionTextBlockStyle}"/>
<TextBlock Style="{StaticResource DescriptionStyle}">
<Run x:Uid="OpenAIOrganizationDescription1"/><Hyperlink NavigateUri="https://platform.openai.com/account/org-settings"><Run x:Uid="OpenAIOrganizationDescription2"/></Hyperlink><Run x:Uid="OpenAIOrganizationDescription3"/>
</TextBlock>

<TextBlock x:Name="OpenAIApiKeyLabel" x:Uid="OpenAIApiKeyLabel" Text="Secret key"
Style="{StaticResource LabelStyle}"/>

<TextBox Grid.Row="4" x:Name="OpenAIApiKeyTextBox" x:Uid="OpenAIApiKeyTextBox"
<TextBox x:Name="OpenAIApiKeyTextBox" x:Uid="OpenAIApiKeyTextBox"
Text="{x:Bind ViewModel.ApiKey, Mode=TwoWay}"
PlaceholderText="Enter OpenAI secret key..."></TextBox>
</Grid>

<TextBlock Style="{StaticResource DescriptionStyle}">
<Run x:Uid="OpenAIApiKeyDescription1"/><Hyperlink NavigateUri="https://platform.openai.com/account/api-keys"><Run x:Uid="OpenAIApiKeyDescription2"/></Hyperlink><Run x:Uid="OpenAIApiKeyDescription3"/>
</TextBlock>

</StackPanel>
</UserControl>
18 changes: 18 additions & 0 deletions src/Gpt.Labs/Strings/en/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -531,4 +531,22 @@ Accepts a json object that maps tokens (specified by their token ID in the token
<data name="SendImageToolTip.Content" xml:space="preserve">
<value>Create image variation</value>
</data>
<data name="OpenAIApiKeyDescription1.Text" xml:space="preserve">
<value>Get your API key from </value>
</data>
<data name="OpenAIApiKeyDescription2.Text" xml:space="preserve">
<value>API keys</value>
</data>
<data name="OpenAIApiKeyDescription3.Text" xml:space="preserve">
<value> page</value>
</data>
<data name="OpenAIOrganizationDescription1.Text" xml:space="preserve">
<value>Get your Organization ID from </value>
</data>
<data name="OpenAIOrganizationDescription2.Text" xml:space="preserve">
<value>Organization settings</value>
</data>
<data name="OpenAIOrganizationDescription3.Text" xml:space="preserve">
<value> page</value>
</data>
</root>