Skip to content
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
73 changes: 0 additions & 73 deletions .github/workflows/codeql.yml

This file was deleted.

18 changes: 9 additions & 9 deletions samples/DatabaseGpt.Web/DatabaseGpt.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<SourceRevisionId>build$([System.DateTime]::UtcNow.ToString("yyyyMMddHHmmss"))</SourceRevisionId>
<Company>Marco Minerva</Company>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LigerShark.WebOptimizer.Core" Version="3.0.426" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.10" />
<PackageReference Include="MinimalHelpers.OpenApi" Version="2.0.16" />
<PackageReference Include="MinimalHelpers.Routing.Analyzers" Version="1.0.13" />
<PackageReference Include="OperationResultTools.AspNetCore.Http" Version="1.0.25" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
<PackageReference Include="TinyHelpers" Version="3.1.18" />
<PackageReference Include="TinyHelpers.AspNetCore" Version="3.1.19" />
<PackageReference Include="LigerShark.WebOptimizer.Core" Version="3.0.436" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.5" />
<PackageReference Include="MinimalHelpers.OpenApi" Version="2.1.7" />
<PackageReference Include="MinimalHelpers.Routing.Analyzers" Version="1.1.3" />
<PackageReference Include="OperationResultTools.AspNetCore.Http" Version="1.0.28" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.2" />
<PackageReference Include="TinyHelpers" Version="3.2.25" />
<PackageReference Include="TinyHelpers.AspNetCore" Version="4.0.26" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 6 additions & 3 deletions samples/DatabaseGptConsole/DatabaseGptConsole.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<FileVersion>1.4</FileVersion>
<AssemblyVersion>1.4</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Spectre.Console" Version="0.49.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageReference Include="Azure.AI.OpenAI" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.AI" Version="9.5.0" />
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="9.5.0-preview.1.25265.7" />
<PackageReference Include="Spectre.Console" Version="0.50.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.5" />
</ItemGroup>

<ItemGroup>
Expand Down
19 changes: 14 additions & 5 deletions samples/DatabaseGptConsole/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using ChatGptNet;
using Azure;
using Azure.AI.OpenAI;
using DatabaseGpt;
using DatabaseGptConsole;
using Microsoft.Extensions.AI;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
Expand Down Expand Up @@ -29,6 +31,17 @@ static void ConfigureServices(HostBuilderContext context, IServiceCollection ser
{
services.AddSingleton<Application>();

services.AddHybridCache();

var apiKey = context.Configuration.GetValue<string>("ChatGPT:ApiKey")!;
var deploymentName = context.Configuration.GetValue<string>("ChatGPT:DeploymentName")!;
var endpoint = context.Configuration.GetValue<string>("ChatGpt:Endpoint")!;

var azureOpenAIClient = new AzureOpenAIClient(new(endpoint), new AzureKeyCredential(apiKey));
var chatClient = azureOpenAIClient.GetChatClient(deploymentName).AsIChatClient();

services.AddChatClient(chatClient);

services.AddDatabaseGpt(database =>
{
// For SQL Server.
Expand All @@ -42,9 +55,5 @@ static void ConfigureServices(HostBuilderContext context, IServiceCollection ser
// For SQLite.
//database.UseConfiguration(context.Configuration)
// .UseSqlite(context.Configuration.GetConnectionString("SqliteConnection"));
},
chatGpt =>
{
chatGpt.UseConfiguration(context.Configuration);
});
}
7 changes: 2 additions & 5 deletions samples/DatabaseGptConsole/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
"SqlConnection": ""
},
"ChatGPT": {
"Provider": "OpenAI",
"ApiKey": "",
"Organization": "",
"ResourceName": "",
"AuthenticationType": "ApiKey",
"DefaultModel": "gpt-3.5-turbo-16k",
"Endpoint": "",
"DeploymentName": "",
"MessageLimit": 20,
"MessageExpiration": "00:30:00"
},
Expand Down
4 changes: 2 additions & 2 deletions src/DatabaseGpt.Abstractions/DatabaseGpt.Abstractions.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.5" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions src/DatabaseGpt.Npgsql/DatabaseGpt.Npgsql.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="Npgsql" Version="8.0.5" />
<PackageReference Include="Dapper" Version="2.1.66" />
<PackageReference Include="Npgsql" Version="9.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/DatabaseGpt.SqlServer/DatabaseGpt.SqlServer.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.0.2" />
<PackageReference Include="Dapper" Version="2.1.66" />
</ItemGroup>

<ItemGroup>
Expand Down
12 changes: 0 additions & 12 deletions src/DatabaseGpt.SqlServer/Models/ColumnEntity.cs

This file was deleted.

3 changes: 1 addition & 2 deletions src/DatabaseGpt.SqlServer/SqlServerDatabaseGptProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Dapper;
using DatabaseGpt.Abstractions;
using DatabaseGpt.Abstractions.Exceptions;
using DatabaseGpt.SqlServer.Models;
using Microsoft.Data.SqlClient;

namespace DatabaseGpt.SqlServer;
Expand Down Expand Up @@ -68,7 +67,7 @@ FROM INFORMATION_SCHEMA.COLUMNS
AND TABLE_SCHEMA + '.' + TABLE_NAME + '.' + COLUMN_NAME NOT IN @{nameof(excludedColumns)};
""";

var columns = await connection.QueryAsync<ColumnEntity>(query, new { schema = table.Schema, table = table.Name, excludedColumns });
var columns = await connection.QueryAsync<string>(query, new { schema = table.Schema, table = table.Name, excludedColumns });

result.AppendLine($"CREATE TABLE [{table.Schema}].[{table.Name}] ({string.Join(',', columns)});");
}
Expand Down
6 changes: 3 additions & 3 deletions src/DatabaseGpt.Sqlite/DatabaseGpt.Sqlite.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.10" />
<PackageReference Include="Dapper" Version="2.1.66" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.5" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 4 additions & 3 deletions src/DatabaseGpt/DatabaseGpt.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -11,8 +11,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="ChatGptNet" Version="3.3.5" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.10.0" />
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.5.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Hybrid" Version="9.5.0" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading
Loading