Compare commits

..

No commits in common. "76bb1fa40f65e285eaead708d1202e46a8ae8f02" and "134d9399f74d8db4022745a6e87961c3198fa173" have entirely different histories.

17 changed files with 22 additions and 167 deletions

View File

@ -1,4 +0,0 @@
root = true
[*]
charset = utf-8

View File

@ -1,13 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/modules.xml
/.idea.KIKunstKirstenKlöckner.iml
/contentModel.xml
/projectSettingsUpdater.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -1 +0,0 @@
KIKunstKirstenKlöckner

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="Nackenserver" uuid="2da1b5f0-41db-4b4f-adbd-3ec21fc94746">
<driver-ref>sqlserver.jb</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.jetbrains.jdbc.sqlserver.SqlServerDriver</jdbc-driver>
<jdbc-url>Server=127.0.0.1,1433;Database=KiKunst</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
<data-source source="LOCAL" name="KiKunstDatenbank@85.215.58.36" uuid="df248d03-0de1-4e34-86bf-d38047939693">
<driver-ref>sqlserver.jb</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.jetbrains.jdbc.sqlserver.SqlServerDriver</jdbc-driver>
<jdbc-url>Server=85.215.58.36;Database=KiKunstDatenbank</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/KIKunstKirstenKlöckner/Program.cs" charset="windows-1252" />
</component>
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SqlDataSourceStorage">
<option name="dataSources">
<list>
<State>
<option name="id" value="01ff5a47-63ce-4ef8-aed7-c9f2f9f5c726" />
<option name="name" value="KiKunstDatenbank" />
<option name="dbmsName" value="MSSQL" />
<option name="urls">
<array>
<option value="file://$PROJECT_DIR$/KiKunstDatenbank/dpo/Tables/BildInfo.sql" />
<option value="file://$PROJECT_DIR$/KiKunstDatenbank/dpo/Tables/WunschInfo.sql" />
<option value="file://$PROJECT_DIR$/KiKunstDatenbank/dpo/StoredProcedures/spBildInfo_Insert.sql" />
<option value="file://$PROJECT_DIR$/KiKunstDatenbank/dpo/StoredProcedures/spWunschInfo_Insert.sql" />
<option value="file://$PROJECT_DIR$/KiKunstDatenbank/dpo/StoredProcedures/spBildInfo_UpdateFileName.sql" />
<option value="file://$PROJECT_DIR$/KiKunstDatenbank/dpo/StoredProcedures/spBildInfo_GetAll.sql" />
<option value="file://$PROJECT_DIR$/KiKunstDatenbank/dpo/StoredProcedures/spWunschInfo_Get.sql" />
</array>
</option>
<option name="remarks" value="Database Project" />
<option name="outPath" value="$PROJECT_DIR$/KiKunstDatenbank" />
<option name="codeStyleName" value="Visual Studio Database Project" />
<option name="outLayout" value="File per object by schema.groovy" />
<option name="scriptOptions">
<map>
<entry key="ConstraintContext" value="CONSTRAINT_IN_TABLE" />
<entry key="MsVsDdlCompatibility" value="1" />
<entry key="QualifyWithSchema" value="ALWAYS" />
<entry key="Reformat" value="1" />
<entry key="UseSemicolon" value="1" />
</map>
</option>
</State>
</list>
</option>
</component>
</project>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SqlDialectMappings">
<file url="file://$PROJECT_DIR$/KiKunstDatenbank/dpo/StoredProcedures/spBildInfo_GetAll.sql" dialect="TSQL" />
<file url="file://$PROJECT_DIR$/KiKunstDatenbank/dpo/StoredProcedures/spBildInfo_Insert.sql" dialect="TSQL" />
<file url="file://$PROJECT_DIR$/KiKunstDatenbank/dpo/StoredProcedures/spBildInfo_UpdateFileName.sql" dialect="TSQL" />
<file url="file://$PROJECT_DIR$/KiKunstDatenbank/dpo/StoredProcedures/spWunschInfo_Get.sql" dialect="TSQL" />
<file url="file://$PROJECT_DIR$/KiKunstDatenbank/dpo/StoredProcedures/spWunschInfo_Insert.sql" dialect="TSQL" />
<file url="file://$PROJECT_DIR$/KiKunstDatenbank/dpo/Tables/BildInfo.sql" dialect="TSQL" />
<file url="file://$PROJECT_DIR$/KiKunstDatenbank/dpo/Tables/WunschInfo.sql" dialect="TSQL" />
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -7,9 +7,9 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Dapper" Version="2.1.35" /> <PackageReference Include="Dapper" Version="2.1.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" /> <PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -4,6 +4,5 @@ namespace KIKunstKirstenKlöckner.Data;
public class ChatGPT public class ChatGPT
{ {
public static Model GPT4Turbo => new Model("gpt-4-turbo") { OwnedBy = "openai" }; public static Model GPT4Turbo => new Model("gpt-4-1106-preview") { OwnedBy = "openai" };
public static Model GPT4o => new Model("gpt-4o") { OwnedBy = "openai" };
} }

View File

@ -1,7 +1,7 @@
using DataAccess.Data; using DataAccess.Data;
using DataAccess.Models; using DataAccess.Models;
using Radzen;
using System.Diagnostics; using System.Diagnostics;
using SixLabors.ImageSharp;
namespace KIKunstKirstenKlöckner.Data; namespace KIKunstKirstenKlöckner.Data;

View File

@ -6,7 +6,7 @@
{ {
if (list.Count == 0) if (list.Count == 0)
{ {
yield break; throw new ArgumentException("List cannot be emtpy: ", nameof(list));
} }
if (n <= 0) if (n <= 0)
{ {

View File

@ -9,13 +9,14 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" /> <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" />
<PackageReference Include="OpenAI" Version="1.11.0" /> <PackageReference Include="OpenAI" Version="1.7.2" />
<PackageReference Include="Radzen.Blazor" Version="4.33.1" /> <PackageReference Include="Radzen.Blazor" Version="4.14.4" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" /> <Folder Include="wwwroot\NewFolder\" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -39,7 +39,7 @@
} }
</style> </style>
<PageTitle>Wunschbild Generator</PageTitle> <PageTitle>AiArt</PageTitle>
<section class="about_section" style="background-image: url('images/5KeineAngstvorFehlern2014.jpeg'); background-size: cover; background-repeat: no-repeat; background-blend-mode:lighten"> <section class="about_section" style="background-image: url('images/5KeineAngstvorFehlern2014.jpeg'); background-size: cover; background-repeat: no-repeat; background-blend-mode:lighten">
@ -141,28 +141,15 @@
<RadzenNumeric ShowUpDown = "false" TValue = "int?" @bind-Value=@_imageHeight /> <RadzenNumeric ShowUpDown = "false" TValue = "int?" @bind-Value=@_imageHeight />
</RadzenStack> </RadzenStack>
</RadzenStack> </RadzenStack>
<RadzenRadioButtonList @bind-Value=@_usedGptModel TValue="GptModel" class="mb-5"> <RadzenStack Orientation="Orientation.Horizontal"
<Items> AlignItems="AlignItems.Center" Wrap="FlexWrap.Wrap">
<RadzenRadioButtonListItem Text="GPT-3.5 Turbo" Value="GptModel.Gpt3_5_turbo" <RadzenCheckBox @bind-Value=@_useGpt4Turbo Name="UseGPT4"/>
MouseEnter="@(args => ShowTooltip("Schnell aber nicht sonderlich clever.", args))" <RadzenLabel Text="Verwende GPT 4 Turbo" Component="UseGPT4" Style="margin-left: 8px; vertical-align: middle;" />
MouseLeave="TooltipService.Close"> </RadzenStack>
</RadzenRadioButtonListItem>
<RadzenRadioButtonListItem Text="GPT-4 Turbo" Value="GptModel.Gpt4_turbo"
MouseEnter="@(args => ShowTooltip("Etwas langsamer, aber recht klug.", args))"
MouseLeave="TooltipService.Close">
</RadzenRadioButtonListItem>
<RadzenRadioButtonListItem Text="GPT-4o" Value="GptModel.Gpt4o"
MouseEnter="@(args => ShowTooltip("Schnell, gut und günstig. Warum gibt es überhaupt eine Auswahlmöglichkeit?", args))"
MouseLeave="TooltipService.Close">
</RadzenRadioButtonListItem>
</Items>
</RadzenRadioButtonList>
@* <RadzenRadioButtonList Data="@_imageModels" @bind-Value=@_selectedImageModel TValue="ModelInfo" TextProperty="Name" class="mb-5"> *@ @* <RadzenRadioButtonList Data="@_imageModels" @bind-Value=@_selectedImageModel TValue="ModelInfo" TextProperty="Name" class="mb-5"> *@
<RadzenRadioButtonList Data="@_imageModels" @bind-Value=@_selectedImageModel TValue="ModelInfo" TextProperty="Name" ValueProperty="" class="mb-5"> <RadzenRadioButtonList Data="@_imageModels" @bind-Value=@_selectedImageModel TValue="ModelInfo" TextProperty="Name" ValueProperty="" class="mb-5">
<Items> <Items>
<RadzenRadioButtonListItem Text="Zufällig" Value="@null" TValue="ModelInfo" <RadzenRadioButtonListItem Text="Zufällig" Value="@null" TValue="ModelInfo"/>
MouseEnter="@(args => ShowTooltip("Für jedes Bild wird zufällig ein Generator ausgewählt.", args))"
MouseLeave="TooltipService.Close"/>
</Items> </Items>
</RadzenRadioButtonList> </RadzenRadioButtonList>
</RadzenCard> </RadzenCard>
@ -301,17 +288,10 @@
IEnumerable<BildInfoModel>? _allBildInfos; IEnumerable<BildInfoModel>? _allBildInfos;
enum GptModel
{
Gpt3_5_turbo,
Gpt4_turbo,
Gpt4o
}
/// <summary> /// <summary>
/// Das ChatGPT Model, das zur Erzeugung der Idee und Bild-Promts verwendet wird. /// Wenn <see langword="true"/> wird GPT4 verwendet um die Idee zu interpretieren.
/// </summary> /// </summary>
private GptModel _usedGptModel = GptModel.Gpt3_5_turbo; private bool _useGpt4Turbo;
private int maxAddons = 2; private int maxAddons = 2;
private int amountOfAddons = 0; // wird später geändert private int amountOfAddons = 0; // wird später geändert
@ -351,11 +331,6 @@
, ,
new() { Position = TooltipPosition.Bottom, Duration = null}); new() { Position = TooltipPosition.Bottom, Duration = null});
void ShowTooltip(string text, ElementReference elementReference) => TooltipService.Open(elementReference, ds =>
@<div>@text</div>
,
new() { Position = TooltipPosition.Bottom, Duration = null});
private string _imageIdea = ""; private string _imageIdea = "";
private float _temperature = 0.9f; private float _temperature = 0.9f;
@ -433,13 +408,7 @@
ChatRequest chatRequest = new ChatRequest ChatRequest chatRequest = new ChatRequest
{ {
Temperature = _temperature, Temperature = _temperature,
Model = _usedGptModel switch Model = _useGpt4Turbo ? ChatGPT.GPT4Turbo : Model.ChatGPTTurbo
{
GptModel.Gpt3_5_turbo => Model.ChatGPTTurbo,
GptModel.Gpt4_turbo => ChatGPT.GPT4Turbo,
GptModel.Gpt4o => ChatGPT.GPT4o,
_ => throw new ArgumentOutOfRangeException()
}
}; };
_conversation = _openAiApi.Chat.CreateConversation(chatRequest); _conversation = _openAiApi.Chat.CreateConversation(chatRequest);

View File

@ -1,6 +1,6 @@
using DataAccess.Data; using DataAccess.Data;
using DataAccess.DbAccess; using DataAccess.DbAccess;
using KIKunstKirstenKlöckner.Data; using KIKunstKirstenKlöckner.Data;
using Radzen; using Radzen;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);

View File

@ -1,7 +0,0 @@
{
"sdk": {
"version": "8.0.0",
"rollForward": "latestMajor",
"allowPrerelease": true
}
}