-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from marcominerva/develop
Add parameters to callbacks
- Loading branch information
Showing
9 changed files
with
64 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
using System.Data; | ||
using DatabaseGpt.Models; | ||
|
||
namespace DatabaseGpt; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace DatabaseGpt.Models; | ||
|
||
public abstract class CallbackArguments | ||
{ | ||
public Guid SessionId { get; } | ||
|
||
public string Question { get; } | ||
|
||
public CallbackArguments(Guid sessionId, string question) | ||
{ | ||
SessionId = sessionId; | ||
Question = question; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace DatabaseGpt.Models; | ||
|
||
public class NaturalLanguageQueryOptions | ||
{ | ||
public Func<IServiceProvider, ValueTask>? OnStarting { get; set; } | ||
|
||
public Func<OnCandidateTablesFoundArguments, IServiceProvider, ValueTask>? OnCandidateTablesFound { get; set; } | ||
|
||
public Func<OnQueryGeneratedArguments, IServiceProvider, ValueTask>? OnQueryGenerated { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace DatabaseGpt.Models; | ||
|
||
public class OnCandidateTablesFoundArguments : CallbackArguments | ||
{ | ||
public IEnumerable<string> Tables { get; } | ||
|
||
public OnCandidateTablesFoundArguments(Guid sessionId, string question, IEnumerable<string> tables) | ||
: base(sessionId, question) | ||
{ | ||
Tables = tables; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace DatabaseGpt.Models; | ||
|
||
public class OnQueryGeneratedArguments : OnCandidateTablesFoundArguments | ||
{ | ||
public string Sql { get; } | ||
|
||
public OnQueryGeneratedArguments(Guid sessionId, string question, IEnumerable<string> tables, string sql) | ||
: base(sessionId, question, tables) | ||
{ | ||
Sql = sql; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters