Skip to content

Commit

Permalink
new sdk for chat style
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophia Chen committed Sep 28, 2024
1 parent c0936f9 commit df9dc0f
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,17 @@ namespace Microsoft.Windows.DevHome.SDK
};
}

// Used by the extension to provide information on the chat style generation
[experimental]
[contract(Microsoft.Windows.DevHome.SDK.DevHomeContract, 6)]
runtimeclass QuickStartChatStyleResult
{
QuickStartChatStyleResult(String chatResponse);

// Allows extensions to provide intermediary status for the operation e.g "Generating project".
String ChatResponse { get; };
}

// Passed back to Dev Home to provide the progress in generating a quick start project.
// This is used by Dev Home to show progress to the user while the project is being generated.
[experimental]
Expand Down Expand Up @@ -1590,6 +1601,20 @@ namespace Microsoft.Windows.DevHome.SDK
Windows.Foundation.IAsyncOperationWithProgress<QuickStartProjectResult, QuickStartProjectProgress> GenerateAsync();
}

// Extensions implement this and is provided to Dev Home when CreateChatStyleGenerationOperation is called.
// This allows to have an async operation can be started but also additional context reported back to Dev Home
// as progress is being made such as a detailed log out output through the adaptive card session.
[experimental]
[contract(Microsoft.Windows.DevHome.SDK.DevHomeContract, 6)]
interface IQuickStartChatStyleGenerationOperation
{
// Starts the operation which generates a project based on a given prompt by the user in the
// given output folder. The generated content in the output folder can be anything that is needed
// for the project based on the technology it uses. Dev Home just displays the generated content
// in a file viewer.
Windows.Foundation.IAsyncOperation<QuickStartChatStyleResult> GenerateChatStyleResponse();
}

// Extensions can implement this provider to provide a way to
// create a project based on a prompt as part of the Dev Home
// quick start project feature.
Expand Down Expand Up @@ -1643,5 +1668,16 @@ namespace Microsoft.Windows.DevHome.SDK
IQuickStartProjectGenerationOperation CreateProjectGenerationOperation(String prompt, Windows.Storage.StorageFolder outputFolder);
}

// Extensions can implement this provider to provide a way to
// create a project based on a prompt as part of the Dev Home
// quick start project feature.
[experimental]
[contract(Microsoft.Windows.DevHome.SDK.DevHomeContract, 6)]
interface IQuickStartProjectProvider2 requires IQuickStartProjectProvider
{
// Pass additional flag to allow the ability to ignore prompt guidance / errors
IQuickStartChatStyleGenerationOperation CreateChatStyleGenerationOperation(String prompt);
}

// End of QuickStartProject APIs
}
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@
<ClInclude Include="OpenConfigurationSetResult.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="ProviderOperationResult.h" />
<ClCompile Include="QuickStartChatStyleResult.h" />
<ClInclude Include="QuickStartProjectAdaptiveCardResult.h" />
<ClInclude Include="QuickStartProjectResult.h" />
<ClInclude Include="RepositoriesResult.h" />
Expand Down Expand Up @@ -266,6 +267,7 @@
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="ProviderOperationResult.cpp" />
<ClCompile Include="QuickStartChatStyleResult.cpp" />
<ClCompile Include="QuickStartProjectAdaptiveCardResult.cpp" />
<ClCompile Include="QuickStartProjectResult.cpp" />
<ClCompile Include="RepositoriesResult.cpp" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include "pch.h"
#include "QuickStartChatStyleResult.h"
#include "QuickStartChatStyleResult.g.cpp"

namespace winrt::Microsoft::Windows::DevHome::SDK::implementation
{
QuickStartChatStyleResult::QuickStartChatStyleResult(hstring const& chatResponse) :
_ChatResponse(chatResponse)
{
}

hstring QuickStartChatStyleResult::ChatResponse()
{
return _ChatResponse;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#pragma once
#include "QuickStartChatStyleResult.g.h"

namespace winrt::Microsoft::Windows::DevHome::SDK::implementation
{
struct QuickStartChatStyleResult : QuickStartChatStyleResultT<QuickStartChatStyleResult>
{
QuickStartChatStyleResult() = default;

QuickStartChatStyleResult(hstring const& chatResponse);
hstring ChatResponse();

private:
hstring const _ChatResponse;
};
}

namespace winrt::Microsoft::Windows::DevHome::SDK::factory_implementation
{
struct QuickStartChatStyleResult : QuickStartChatStyleResultT<QuickStartChatStyleResult, implementation::QuickStartChatStyleResult>
{
};
}

0 comments on commit df9dc0f

Please sign in to comment.