Skip to content

Commit

Permalink
Code(Shared::Contract): Add shared contract for AssistantResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
ktutak1337 committed May 7, 2024
1 parent 7731a66 commit dd49c24
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 11 deletions.
16 changes: 8 additions & 8 deletions StellarChat.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,25 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{381F052F-900
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Server", "Server", "{DDE19268-BFEB-408E-A1A3-2CB70CEACFC3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StellarChat.Server.Api", "src\Server\StellarChat.Server.Api\StellarChat.Server.Api.csproj", "{3E504298-D0C4-4258-BF5F-1AF3D17268F9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StellarChat.Server.Api", "src\Server\StellarChat.Server.Api\StellarChat.Server.Api.csproj", "{3E504298-D0C4-4258-BF5F-1AF3D17268F9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{539F8333-E713-4AD1-AA62-91D7D0662D0C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StellarChat.Shared.Abstractions", "src\Shared\StellarChat.Shared.Abstractions\StellarChat.Shared.Abstractions.csproj", "{470A8621-8E42-4A16-9C38-1E5A9BDBB1AD}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StellarChat.Shared.Abstractions", "src\Shared\StellarChat.Shared.Abstractions\StellarChat.Shared.Abstractions.csproj", "{470A8621-8E42-4A16-9C38-1E5A9BDBB1AD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StellarChat.Shared.Infrastructure", "src\Shared\StellarChat.Shared.Infrastructure\StellarChat.Shared.Infrastructure.csproj", "{EA54CE28-3736-457C-B83B-3500F3ED8D4B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StellarChat.Shared.Infrastructure", "src\Shared\StellarChat.Shared.Infrastructure\StellarChat.Shared.Infrastructure.csproj", "{EA54CE28-3736-457C-B83B-3500F3ED8D4B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{637E4293-DBD7-4C92-A1F8-B78E814EB07C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StellarChat.Client.Web", "src\Client\StellarChat.Client.Web\StellarChat.Client.Web.csproj", "{5BE990B7-4BAD-47D0-B845-C7F5A2EAE11D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StellarChat.Client.Web", "src\Client\StellarChat.Client.Web\StellarChat.Client.Web.csproj", "{5BE990B7-4BAD-47D0-B845-C7F5A2EAE11D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StellarChat.Shared.Contracts", "src\Shared\StellarChat.Shared.Contracts\StellarChat.Shared.Contracts.csproj", "{0707D9C8-3E07-4C31-8070-E6A4DFD8B3C7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StellarChat.Shared.Contracts", "src\Shared\StellarChat.Shared.Contracts\StellarChat.Shared.Contracts.csproj", "{0707D9C8-3E07-4C31-8070-E6A4DFD8B3C7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3E504298-D0C4-4258-BF5F-1AF3D17268F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E504298-D0C4-4258-BF5F-1AF3D17268F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
Expand All @@ -51,6 +48,9 @@ Global
{0707D9C8-3E07-4C31-8070-E6A4DFD8B3C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0707D9C8-3E07-4C31-8070-E6A4DFD8B3C7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{DDE19268-BFEB-408E-A1A3-2CB70CEACFC3} = {381F052F-900C-4243-B27A-A2D7788E09C9}
{3E504298-D0C4-4258-BF5F-1AF3D17268F9} = {DDE19268-BFEB-408E-A1A3-2CB70CEACFC3}
Expand Down
16 changes: 16 additions & 0 deletions src/Client/StellarChat.Client.Web/Components/AgentsDrawer.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<MudDrawer @bind-Open="IsAgentsDrawerOpen" Width="600px" Height="100%" Anchor="Anchor.Start" Elevation="1" Variant="@DrawerVariant.Temporary">
<MudDrawerHeader>
<MudText Typo="Typo.h6">My App</MudText>
</MudDrawerHeader>
<MudNavMenu>
<MudNavLink Match="NavLinkMatch.All">Store</MudNavLink>
<MudNavLink Match="NavLinkMatch.All">Library</MudNavLink>
<MudNavLink Match="NavLinkMatch.All">Community</MudNavLink>
</MudNavMenu>
</MudDrawer>

@code
{
[Parameter]
public bool IsAgentsDrawerOpen { get; set; }
}
15 changes: 12 additions & 3 deletions src/Client/StellarChat.Client.Web/Components/Drawer.razor
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<MudFab Size="Size.Medium" Color="Color.Primary" StartIcon="@Icons.Material.Filled.Add" Class="mb-4 ml-2" />
</MudTooltip>
<MudDivider Class="mx-auto" Style="width:70%;" />
<MudTooltip Text="Settings" Arrow="true" Placement="Placement.Right">
<MudIconButton Style="margin-left: 2px;" Size="Size.Large" Icon="@Icons.Material.Filled.Settings" />
</MudTooltip >
@* <MudTooltip Delay="500" Text="Settings" Arrow="true" Placement="Placement.Right"> *@
<MudIconButton Style="margin-left: 2px;" Size="Size.Large" Icon="@Icons.Material.Filled.Settings" OnClick="ToggleDrawer" />
@* </MudTooltip > *@
</div>
</div>
<MudDivider Vertical="true" />
Expand Down Expand Up @@ -46,12 +46,21 @@
</div>
</MudContainer>
</MudDrawer>
<AgentsDrawer IsAgentsDrawerOpen="open" />

@code
{
[Parameter]
public bool IsDrawerOpen { get; set; }
bool open;

private void ToggleDrawer()
{
Console.WriteLine($"before IsAgentsDrawerOpen: {open}");
open = !open;
Console.WriteLine($"after IsAgentsDrawerOpen: {open}");

}
public string SearchText { get; set; } = string.Empty;

public List<ChatSessionResponse> ChatSessions { get; set; } = new();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace StellarChat.Server.Api.Features.Assistants.BrowseAssistants;

internal sealed class BrowseAssistants : PagedQuery<AssistantResponse> { }

Check failure on line 3 in src/Server/StellarChat.Server.Api/Features/Assistants/BrowseAssistants/BrowseAssistants.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'AssistantResponse' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 3 in src/Server/StellarChat.Server.Api/Features/Assistants/BrowseAssistants/BrowseAssistants.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'AssistantResponse' could not be found (are you missing a using directive or an assembly reference?)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace StellarChat.Shared.Contracts.Assistants;

public record AssistantResponse(
Guid Id,
string Name,
string Metaprompt,
string Description,
string AvatarUrl,
string DefaultModel,
string DefaultVoice,
bool IsDefault,
DateTimeOffset CreatedAt,
DateTimeOffset UpdatedAt);

0 comments on commit dd49c24

Please sign in to comment.