// WARNING: Please don't edit this file. It was generated by C++/WinRT // v2.0.250303.1 #pragma once #ifndef WINRT_Microsoft_Windows_AI_Text_H #define WINRT_Microsoft_Windows_AI_Text_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.250303.1"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.250303.1" #include "winrt/Microsoft.Windows.AI.h" #include "winrt/impl/Microsoft.Windows.AI.2.h" #include "winrt/impl/Microsoft.Windows.AI.ContentSafety.2.h" #include "winrt/impl/Microsoft.Windows.AI.Foundation.2.h" #include "winrt/impl/Microsoft.Windows.AI.Text.2.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" namespace winrt::impl { template auto consume_Microsoft_Windows_AI_Text_IConversationItem::Participant() const { void* value{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::IConversationItem>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::IConversationItem, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Participant(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Participant(&value)); } return hstring{value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_IConversationItem::Participant( param::hstring const& value) const { if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::IConversationItem>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::IConversationItem, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_Participant(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_Participant(*(void**)(&value))); } } template auto consume_Microsoft_Windows_AI_Text_IConversationItem::Message() const { void* value{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::IConversationItem>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::IConversationItem, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Message(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Message(&value)); } return hstring{value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_IConversationItem::Message( param::hstring const& value) const { if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::IConversationItem>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::IConversationItem, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_Message(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_Message(*(void**)(&value))); } } template auto consume_Microsoft_Windows_AI_Text_IConversationSummaryOptions< D>::InputKind() const { winrt::Microsoft::Windows::AI::Text::InputKind value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::IConversationSummaryOptions, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->get_InputKind(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->get_InputKind(reinterpret_cast(&value))); } return value; } template auto consume_Microsoft_Windows_AI_Text_IConversationSummaryOptions< D>::InputKind(winrt::Microsoft::Windows::AI::Text::InputKind const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::IConversationSummaryOptions, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_InputKind(static_cast(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_InputKind(static_cast(value))); } } template auto consume_Microsoft_Windows_AI_Text_IConversationSummaryOptions< D>::IncludeMessageCitations() const { bool value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::IConversationSummaryOptions, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_IncludeMessageCitations(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_IncludeMessageCitations(&value)); } return value; } template auto consume_Microsoft_Windows_AI_Text_IConversationSummaryOptions< D>::IncludeMessageCitations(bool value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::IConversationSummaryOptions, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_IncludeMessageCitations(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_IncludeMessageCitations(value)); } } template auto consume_Microsoft_Windows_AI_Text_IConversationSummaryOptions< D>::IncludeParticipantAttribution() const { bool value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::IConversationSummaryOptions, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_IncludeParticipantAttribution(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_IncludeParticipantAttribution(&value)); } return value; } template auto consume_Microsoft_Windows_AI_Text_IConversationSummaryOptions< D>::IncludeParticipantAttribution(bool value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::IConversationSummaryOptions, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_IncludeParticipantAttribution(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_IncludeParticipantAttribution(value)); } } template auto consume_Microsoft_Windows_AI_Text_IConversationSummaryOptions< D>::MaxKeyPoints() const { uint32_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::IConversationSummaryOptions, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_MaxKeyPoints(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_MaxKeyPoints(&value)); } return value; } template auto consume_Microsoft_Windows_AI_Text_IConversationSummaryOptions< D>::MaxKeyPoints(uint32_t value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::IConversationSummaryOptions, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_MaxKeyPoints(value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_MaxKeyPoints(value)); } } template auto consume_Microsoft_Windows_AI_Text_IConversationSummaryOptions< D>::Language() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::IConversationSummaryOptions, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Language(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Language(&value)); } return hstring{value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_IConversationSummaryOptions::Language( param::hstring const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::IConversationSummaryOptions, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_Language(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_Language(*(void**)(&value))); } } template auto consume_Microsoft_Windows_AI_Text_ILanguageModel2< D>::GenerateResponseAsync(param::hstring const& prompt) const { void* operation{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ILanguageModel2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModel2, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->GenerateResponseAsync(*(void**)(&prompt), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->GenerateResponseAsync(*(void**)(&prompt), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress< winrt::Microsoft::Windows::AI::Text::LanguageModelResponseResult, hstring>{operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModel2:: GenerateResponseAsync( param::hstring const& prompt, winrt::Microsoft::Windows::AI::Text::LanguageModelOptions const& options) const { void* operation{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ILanguageModel2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModel2, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GenerateResponseAsync2( *(void**)(&prompt), *(void**)(&options), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GenerateResponseAsync2( *(void**)(&prompt), *(void**)(&options), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress< winrt::Microsoft::Windows::AI::Text::LanguageModelResponseResult, hstring>{operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModel2:: GenerateResponseAsync( winrt::Microsoft::Windows::AI::Text::LanguageModelContext const& context, param::hstring const& prompt, winrt::Microsoft::Windows::AI::Text::LanguageModelOptions const& options) const { void* operation{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ILanguageModel2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModel2, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GenerateResponseAsync3( *(void**)(&context), *(void**)(&prompt), *(void**)(&options), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GenerateResponseAsync3( *(void**)(&context), *(void**)(&prompt), *(void**)(&options), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress< winrt::Microsoft::Windows::AI::Text::LanguageModelResponseResult, hstring>{operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModel2:: GenerateResponseFromEmbeddingsAsync( param::async_iterable< winrt::Microsoft::Windows::AI::Foundation::EmbeddingVector> const& promptEmbedding) const { void* operation{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ILanguageModel2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModel2, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GenerateResponseFromEmbeddingsAsync( *(void**)(&promptEmbedding), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GenerateResponseFromEmbeddingsAsync( *(void**)(&promptEmbedding), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress< winrt::Microsoft::Windows::AI::Text::LanguageModelResponseResult, hstring>{operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModel2:: GenerateResponseFromEmbeddingsAsync( param::async_iterable< winrt::Microsoft::Windows::AI::Foundation::EmbeddingVector> const& promptEmbedding, winrt::Microsoft::Windows::AI::Text::LanguageModelOptions const& options) const { void* operation{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ILanguageModel2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModel2, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GenerateResponseFromEmbeddingsAsync2( *(void**)(&promptEmbedding), *(void**)(&options), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GenerateResponseFromEmbeddingsAsync2( *(void**)(&promptEmbedding), *(void**)(&options), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress< winrt::Microsoft::Windows::AI::Text::LanguageModelResponseResult, hstring>{operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModel2:: GenerateResponseFromEmbeddingsAsync( winrt::Microsoft::Windows::AI::Text::LanguageModelContext const& context, param::async_iterable< winrt::Microsoft::Windows::AI::Foundation::EmbeddingVector> const& promptEmbedding, winrt::Microsoft::Windows::AI::Text::LanguageModelOptions const& options) const { void* operation{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ILanguageModel2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModel2, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GenerateResponseFromEmbeddingsAsync3( *(void**)(&context), *(void**)(&promptEmbedding), *(void**)(&options), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GenerateResponseFromEmbeddingsAsync3( *(void**)(&context), *(void**)(&promptEmbedding), *(void**)(&options), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress< winrt::Microsoft::Windows::AI::Text::LanguageModelResponseResult, hstring>{operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModel2< D>::GenerateEmbeddingVectors(param::hstring const& prompt) const { void* result{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ILanguageModel2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModel2, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->GenerateEmbeddingVectors(*(void**)(&prompt), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->GenerateEmbeddingVectors(*(void**)(&prompt), &result)); } return winrt::Microsoft::Windows::AI::Text:: LanguageModelEmbeddingVectorResult{result, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModel2< D>::GenerateEmbeddingVectors(param::hstring const& prompt, winrt::Microsoft::Windows::AI::ContentSafety:: ContentFilterOptions const& contentFilterOptions) const { void* result{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ILanguageModel2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModel2, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GenerateEmbeddingVectors2( *(void**)(&prompt), *(void**)(&contentFilterOptions), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GenerateEmbeddingVectors2( *(void**)(&prompt), *(void**)(&contentFilterOptions), &result)); } return winrt::Microsoft::Windows::AI::Text:: LanguageModelEmbeddingVectorResult{result, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModel2< D>::GetUsablePromptLength(param::hstring const& prompt) const { uint64_t result{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ILanguageModel2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModel2, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->GetUsablePromptLength(*(void**)(&prompt), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->GetUsablePromptLength(*(void**)(&prompt), &result)); } return result; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModel2:: GetUsablePromptLength( winrt::Microsoft::Windows::AI::Text::LanguageModelContext const& context, param::hstring const& prompt) const { uint64_t result{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ILanguageModel2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModel2, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GetUsablePromptLength2( *(void**)(&context), *(void**)(&prompt), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetUsablePromptLength2( *(void**)(&context), *(void**)(&prompt), &result)); } return result; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModel2::GetVectorSpaceId() const { winrt::guid result{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ILanguageModel2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModel2, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GetVectorSpaceId(put_abi(result))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetVectorSpaceId(put_abi(result))); } return result; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModel2::CreateContext() const { void* result{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ILanguageModel2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModel2, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateContext(&result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateContext(&result)); } return winrt::Microsoft::Windows::AI::Text::LanguageModelContext{ result, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModel2::CreateContext( param::hstring const& systemPrompt) const { void* result{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ILanguageModel2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModel2, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->CreateContext2(*(void**)(&systemPrompt), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->CreateContext2(*(void**)(&systemPrompt), &result)); } return winrt::Microsoft::Windows::AI::Text::LanguageModelContext{ result, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModel2::CreateContext( param::hstring const& systemPrompt, winrt::Microsoft::Windows::AI::ContentSafety::ContentFilterOptions const& contentFilterOptions) const { void* result{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ILanguageModel2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModel2, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateContext3( *(void**)(&systemPrompt), *(void**)(&contentFilterOptions), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateContext3( *(void**)(&systemPrompt), *(void**)(&contentFilterOptions), &result)); } return winrt::Microsoft::Windows::AI::Text::LanguageModelContext{ result, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelEmbeddingVectorResult< D>::EmbeddingVectors() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *( abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_EmbeddingVectors(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_EmbeddingVectors(&value)); } return winrt::Windows::Foundation::Collections::IVectorView< winrt::Microsoft::Windows::AI::Foundation::EmbeddingVector>{ value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelEmbeddingVectorResult< D>::Status() const { winrt::Microsoft::Windows::AI::Text::LanguageModelResponseStatus value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *( abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->get_Status(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->get_Status(reinterpret_cast(&value))); } return value; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelEmbeddingVectorResult< D>::ExtendedError() const { winrt::hresult value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *( abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value))); } return value; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelOptions::Temperature() const { float value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModelOptions, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Temperature(&value)); } else { auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AI::Text::ILanguageModelOptions>**)this; check_hresult(_winrt_abi_type->get_Temperature(&value)); } return value; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelOptions::Temperature( float value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModelOptions, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_Temperature(value)); } else { auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AI::Text::ILanguageModelOptions>**)this; check_hresult(_winrt_abi_type->put_Temperature(value)); } } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelOptions::TopP() const { float value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModelOptions, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_TopP(&value)); } else { auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AI::Text::ILanguageModelOptions>**)this; check_hresult(_winrt_abi_type->get_TopP(&value)); } return value; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelOptions::TopP( float value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModelOptions, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_TopP(value)); } else { auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AI::Text::ILanguageModelOptions>**)this; check_hresult(_winrt_abi_type->put_TopP(value)); } } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelOptions::TopK() const { uint32_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModelOptions, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_TopK(&value)); } else { auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AI::Text::ILanguageModelOptions>**)this; check_hresult(_winrt_abi_type->get_TopK(&value)); } return value; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelOptions::TopK( uint32_t value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModelOptions, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_TopK(value)); } else { auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AI::Text::ILanguageModelOptions>**)this; check_hresult(_winrt_abi_type->put_TopK(value)); } } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelOptions< D>::ContentFilterOptions() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModelOptions, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_ContentFilterOptions(&value)); } else { auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AI::Text::ILanguageModelOptions>**)this; check_hresult(_winrt_abi_type->get_ContentFilterOptions(&value)); } return winrt::Microsoft::Windows::AI::ContentSafety::ContentFilterOptions{ value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelOptions< D>::ContentFilterOptions(winrt::Microsoft::Windows::AI::ContentSafety:: ContentFilterOptions const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModelOptions, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->put_ContentFilterOptions(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AI::Text::ILanguageModelOptions>**)this; check_hresult(_winrt_abi_type->put_ContentFilterOptions(*(void**)(&value))); } } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelResponseResult::Text() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModelResponseResult, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Text(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Text(&value)); } return hstring{value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelResponseResult::Status() const { winrt::Microsoft::Windows::AI::Text::LanguageModelResponseStatus value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModelResponseResult, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->get_Status(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->get_Status(reinterpret_cast(&value))); } return value; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelResponseResult< D>::ExtendedError() const { winrt::hresult value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModelResponseResult, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value))); } return value; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelStatics::GetReadyState() const { winrt::Microsoft::Windows::AI::AIFeatureReadyState result{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModelStatics, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->GetReadyState(reinterpret_cast(&result))); } else { auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AI::Text::ILanguageModelStatics>**)this; check_hresult( _winrt_abi_type->GetReadyState(reinterpret_cast(&result))); } return result; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelStatics< D>::EnsureReadyAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModelStatics, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->EnsureReadyAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AI::Text::ILanguageModelStatics>**)this; check_hresult(_winrt_abi_type->EnsureReadyAsync(&operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress< winrt::Microsoft::Windows::AI::AIFeatureReadyResult, double>{ operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ILanguageModelStatics::CreateAsync() const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ILanguageModelStatics, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateAsync(&operation)); } else { auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AI::Text::ILanguageModelStatics>**)this; check_hresult(_winrt_abi_type->CreateAsync(&operation)); } return winrt::Windows::Foundation::IAsyncOperation< winrt::Microsoft::Windows::AI::Text::LanguageModel>{ operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ITextRewriter::RewriteAsync( param::hstring const& text) const { void* operation{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ITextRewriter>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ITextRewriter, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->RewriteAsync(*(void**)(&text), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RewriteAsync(*(void**)(&text), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress< winrt::Microsoft::Windows::AI::Text::LanguageModelResponseResult, hstring>{operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ITextRewriter2::RewriteAsync( param::hstring const& text, winrt::Microsoft::Windows::AI::Text::TextRewriteTone const& tone) const { void* operation{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ITextRewriter2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ITextRewriter2, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->RewriteAsync( *(void**)(&text), static_cast(tone), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RewriteAsync( *(void**)(&text), static_cast(tone), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress< winrt::Microsoft::Windows::AI::Text::LanguageModelResponseResult, hstring>{operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ITextRewriter3::RewriteCustomAsync( param::hstring const& text, param::hstring const& customTone) const { void* operation{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ITextRewriter3>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ITextRewriter3, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->RewriteCustomAsync( *(void**)(&text), *(void**)(&customTone), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RewriteCustomAsync( *(void**)(&text), *(void**)(&customTone), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress< winrt::Microsoft::Windows::AI::Text::LanguageModelResponseResult, hstring>{operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ITextRewriterFactory::CreateInstance( winrt::Microsoft::Windows::AI::Text::LanguageModel const& languageModel) const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ITextRewriterFactory, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->CreateInstance(*(void**)(&languageModel), &value)); } else { auto const _winrt_abi_type = *( abi_t**)this; check_hresult( _winrt_abi_type->CreateInstance(*(void**)(&languageModel), &value)); } return winrt::Microsoft::Windows::AI::Text::TextRewriter{ value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ITextSummarizer::SummarizeAsync( param::hstring const& text) const { void* operation{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ITextSummarizer>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ITextSummarizer, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->SummarizeAsync(*(void**)(&text), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->SummarizeAsync(*(void**)(&text), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress< winrt::Microsoft::Windows::AI::Text::LanguageModelResponseResult, hstring>{operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ITextSummarizer< D>::SummarizeParagraphAsync(param::hstring const& text) const { void* operation{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ITextSummarizer>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ITextSummarizer, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->SummarizeParagraphAsync(*(void**)(&text), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->SummarizeParagraphAsync(*(void**)(&text), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress< winrt::Microsoft::Windows::AI::Text::LanguageModelResponseResult, hstring>{operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ITextSummarizer2:: SummarizeConversationAsync( param::async_vector_view< winrt::Microsoft::Windows::AI::Text::ConversationItem> const& messages, winrt::Microsoft::Windows::AI::Text::ConversationSummaryOptions const& options) const { void* operation{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ITextSummarizer2>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ITextSummarizer2, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->SummarizeConversationAsync( *(void**)(&messages), *(void**)(&options), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SummarizeConversationAsync( *(void**)(&messages), *(void**)(&options), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress< winrt::Microsoft::Windows::AI::Text::LanguageModelResponseResult, hstring>{operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ITextSummarizer3:: IsPromptLargerThanContext( array_view messages, winrt::Microsoft::Windows::AI::Text::ConversationSummaryOptions const& options, uint64_t& cutoffPosition) const { bool result{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ITextSummarizer3>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ITextSummarizer3, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->IsPromptLargerThanContext( messages.size(), get_abi(messages), *(void**)(&options), &cutoffPosition, &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsPromptLargerThanContext( messages.size(), get_abi(messages), *(void**)(&options), &cutoffPosition, &result)); } return result; } template auto consume_Microsoft_Windows_AI_Text_ITextSummarizer4< D>::IsPromptLargerThanContext(param::hstring const& text, uint64_t& cutoffPosition) const { bool result{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ITextSummarizer4>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ITextSummarizer4, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->IsPromptLargerThanContext( *(void**)(&text), &cutoffPosition, &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsPromptLargerThanContext( *(void**)(&text), &cutoffPosition, &result)); } return result; } template auto consume_Microsoft_Windows_AI_Text_ITextSummarizerFactory< D>::CreateInstance(winrt::Microsoft::Windows::AI::Text::LanguageModel const& languageModel) const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ITextSummarizerFactory, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->CreateInstance(*(void**)(&languageModel), &value)); } else { auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AI::Text::ITextSummarizerFactory>**)this; check_hresult( _winrt_abi_type->CreateInstance(*(void**)(&languageModel), &value)); } return winrt::Microsoft::Windows::AI::Text::TextSummarizer{ value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ITextToTableConverter::ConvertAsync( param::hstring const& text) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ITextToTableConverter, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->ConvertAsync(*(void**)(&text), &operation)); } else { auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AI::Text::ITextToTableConverter>**)this; check_hresult(_winrt_abi_type->ConvertAsync(*(void**)(&text), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress< winrt::Microsoft::Windows::AI::Text::TextToTableResponseResult, hstring>{ operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ITextToTableConverterFactory< D>::CreateInstance(winrt::Microsoft::Windows::AI::Text::LanguageModel const& languageModel) const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ITextToTableConverterFactory, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->CreateInstance(*(void**)(&languageModel), &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->CreateInstance(*(void**)(&languageModel), &value)); } return winrt::Microsoft::Windows::AI::Text::TextToTableConverter{ value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ITextToTableResponseResult::GetRows() const { uint32_t result_impl_size{}; void** result{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ITextToTableResponseResult, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GetRows(&result_impl_size, &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetRows(&result_impl_size, &result)); } return com_array{ result, result_impl_size, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AI_Text_ITextToTableResponseResult::Status() const { winrt::Microsoft::Windows::AI::Text::LanguageModelResponseStatus value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ITextToTableResponseResult, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->get_Status(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->get_Status(reinterpret_cast(&value))); } return value; } template auto consume_Microsoft_Windows_AI_Text_ITextToTableResponseResult< D>::ExtendedError() const { winrt::hresult value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ITextToTableResponseResult, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value))); } return value; } template auto consume_Microsoft_Windows_AI_Text_ITextToTableRow::GetColumns() const { uint32_t result_impl_size{}; void** result{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AI::Text::ITextToTableRow>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AI::Text::ITextToTableRow, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GetColumns(&result_impl_size, &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetColumns(&result_impl_size, &result)); } return com_array{result, result_impl_size, take_ownership_from_abi}; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Participant(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Participant()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Participant(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Participant(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Message(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Message()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Message(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Message(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base< D, winrt::Microsoft::Windows::AI::Text::IConversationSummaryOptions> { int32_t __stdcall get_InputKind(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from( this->shim().InputKind()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_InputKind(int32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().InputKind( *reinterpret_cast< winrt::Microsoft::Windows::AI::Text::InputKind const*>(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IncludeMessageCitations(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IncludeMessageCitations()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_IncludeMessageCitations(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().IncludeMessageCitations(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IncludeParticipantAttribution( bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IncludeParticipantAttribution()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_IncludeParticipantAttribution(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().IncludeParticipantAttribution(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxKeyPoints(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MaxKeyPoints()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_MaxKeyPoints(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().MaxKeyPoints(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Language(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Language()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Language(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Language(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base {}; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GenerateResponseAsync(void* prompt, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().GenerateResponseAsync( *reinterpret_cast(&prompt))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GenerateResponseAsync2(void* prompt, void* options, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().GenerateResponseAsync( *reinterpret_cast(&prompt), *reinterpret_cast(&options))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GenerateResponseAsync3(void* context, void* prompt, void* options, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().GenerateResponseAsync( *reinterpret_cast(&context), *reinterpret_cast(&prompt), *reinterpret_cast(&options))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GenerateResponseFromEmbeddingsAsync( void* promptEmbedding, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().GenerateResponseFromEmbeddingsAsync( *reinterpret_cast< winrt::Windows::Foundation::Collections::IIterable< winrt::Microsoft::Windows::AI::Foundation:: EmbeddingVector> const*>(&promptEmbedding))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GenerateResponseFromEmbeddingsAsync2( void* promptEmbedding, void* options, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().GenerateResponseFromEmbeddingsAsync( *reinterpret_cast< winrt::Windows::Foundation::Collections::IIterable< winrt::Microsoft::Windows::AI::Foundation:: EmbeddingVector> const*>(&promptEmbedding), *reinterpret_cast(&options))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GenerateResponseFromEmbeddingsAsync3( void* context, void* promptEmbedding, void* options, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().GenerateResponseFromEmbeddingsAsync( *reinterpret_cast(&context), *reinterpret_cast< winrt::Windows::Foundation::Collections::IIterable< winrt::Microsoft::Windows::AI::Foundation:: EmbeddingVector> const*>(&promptEmbedding), *reinterpret_cast(&options))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GenerateEmbeddingVectors(void* prompt, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from( this->shim().GenerateEmbeddingVectors( *reinterpret_cast(&prompt))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GenerateEmbeddingVectors2(void* prompt, void* contentFilterOptions, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from( this->shim().GenerateEmbeddingVectors( *reinterpret_cast(&prompt), *reinterpret_cast( &contentFilterOptions))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetUsablePromptLength(void* prompt, uint64_t* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetUsablePromptLength( *reinterpret_cast(&prompt))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetUsablePromptLength2(void* context, void* prompt, uint64_t* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetUsablePromptLength( *reinterpret_cast< winrt::Microsoft::Windows::AI::Text::LanguageModelContext const*>( &context), *reinterpret_cast(&prompt))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetVectorSpaceId(winrt::guid* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetVectorSpaceId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateContext(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from( this->shim().CreateContext()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateContext2(void* systemPrompt, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from( this->shim().CreateContext( *reinterpret_cast(&systemPrompt))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateContext3(void* systemPrompt, void* contentFilterOptions, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from( this->shim().CreateContext( *reinterpret_cast(&systemPrompt), *reinterpret_cast( &contentFilterOptions))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce< D, winrt::Microsoft::Windows::AI::Text::ILanguageModelEmbeddingVectorResult> : produce_base { int32_t __stdcall get_EmbeddingVectors(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>( this->shim().EmbeddingVectors()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Status(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from< winrt::Microsoft::Windows::AI::Text::LanguageModelResponseStatus>( this->shim().Status()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ExtendedError(winrt::hresult* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ExtendedError()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Temperature(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Temperature()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Temperature(float value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Temperature(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_TopP(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().TopP()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_TopP(float value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().TopP(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_TopK(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().TopK()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_TopK(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().TopK(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ContentFilterOptions(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from< winrt::Microsoft::Windows::AI::ContentSafety::ContentFilterOptions>( this->shim().ContentFilterOptions()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ContentFilterOptions(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ContentFilterOptions( *reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce< D, winrt::Microsoft::Windows::AI::Text::ILanguageModelResponseResult> : produce_base< D, winrt::Microsoft::Windows::AI::Text::ILanguageModelResponseResult> { int32_t __stdcall get_Text(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Text()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Status(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from< winrt::Microsoft::Windows::AI::Text::LanguageModelResponseStatus>( this->shim().Status()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ExtendedError(winrt::hresult* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ExtendedError()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetReadyState(int32_t* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from( this->shim().GetReadyState()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall EnsureReadyAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().EnsureReadyAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().CreateAsync()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall RewriteAsync(void* text, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().RewriteAsync( *reinterpret_cast(&text))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall RewriteAsync(void* text, int32_t tone, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().RewriteAsync( *reinterpret_cast(&text), *reinterpret_cast(&tone))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall RewriteCustomAsync(void* text, void* customTone, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().RewriteCustomAsync( *reinterpret_cast(&text), *reinterpret_cast(&customTone))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateInstance(void* languageModel, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from( this->shim().CreateInstance( *reinterpret_cast< winrt::Microsoft::Windows::AI::Text::LanguageModel const*>( &languageModel))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall SummarizeAsync(void* text, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().SummarizeAsync( *reinterpret_cast(&text))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SummarizeParagraphAsync(void* text, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().SummarizeParagraphAsync( *reinterpret_cast(&text))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall SummarizeConversationAsync(void* messages, void* options, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().SummarizeConversationAsync( *reinterpret_cast< winrt::Windows::Foundation::Collections::IVectorView< winrt::Microsoft::Windows::AI::Text:: ConversationItem> const*>(&messages), *reinterpret_cast( &options))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall IsPromptLargerThanContext(uint32_t __messagesSize, void** messages, void* options, uint64_t* cutoffPosition, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsPromptLargerThanContext( array_view( reinterpret_cast< winrt::Microsoft::Windows::AI::Text::ConversationItem const*>( messages), reinterpret_cast< winrt::Microsoft::Windows::AI::Text::ConversationItem const*>( messages) + __messagesSize), *reinterpret_cast(&options), *cutoffPosition)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall IsPromptLargerThanContext(void* text, uint64_t* cutoffPosition, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsPromptLargerThanContext( *reinterpret_cast(&text), *cutoffPosition)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base< D, winrt::Microsoft::Windows::AI::Text::ITextSummarizerFactory> { int32_t __stdcall CreateInstance(void* languageModel, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from( this->shim().CreateInstance( *reinterpret_cast< winrt::Microsoft::Windows::AI::Text::LanguageModel const*>( &languageModel))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall ConvertAsync(void* text, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().ConvertAsync( *reinterpret_cast(&text))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce< D, winrt::Microsoft::Windows::AI::Text::ITextToTableConverterFactory> : produce_base< D, winrt::Microsoft::Windows::AI::Text::ITextToTableConverterFactory> { int32_t __stdcall CreateInstance(void* languageModel, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from( this->shim().CreateInstance( *reinterpret_cast< winrt::Microsoft::Windows::AI::Text::LanguageModel const*>( &languageModel))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base< D, winrt::Microsoft::Windows::AI::Text::ITextToTableResponseResult> { int32_t __stdcall GetRows(uint32_t* __resultSize, void*** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); std::tie(*__resultSize, *result) = detach_abi(this->shim().GetRows()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Status(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from< winrt::Microsoft::Windows::AI::Text::LanguageModelResponseStatus>( this->shim().Status()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ExtendedError(winrt::hresult* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ExtendedError()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetColumns(uint32_t* __resultSize, void*** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); std::tie(*__resultSize, *result) = detach_abi(this->shim().GetColumns()); return 0; } catch (...) { return to_hresult(); } }; #endif } // namespace winrt::impl WINRT_EXPORT namespace winrt::Microsoft::Windows::AI::Text { inline ConversationItem::ConversationItem() : ConversationItem( impl::call_factory_cast< ConversationItem (*)( winrt::Windows::Foundation::IActivationFactory const&), ConversationItem>( [](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) {} inline ConversationSummaryOptions::ConversationSummaryOptions() : ConversationSummaryOptions( impl::call_factory_cast< ConversationSummaryOptions (*)( winrt::Windows::Foundation::IActivationFactory const&), ConversationSummaryOptions>( [](winrt::Windows::Foundation::IActivationFactory const& f) { return f .template ActivateInstance(); })) {} inline auto LanguageModel::GetReadyState() { return impl::call_factory_cast< winrt::Microsoft::Windows::AI::AIFeatureReadyState (*)( ILanguageModelStatics const&), LanguageModel, ILanguageModelStatics>( [](ILanguageModelStatics const& f) { return f.GetReadyState(); }); } inline auto LanguageModel::EnsureReadyAsync() { return impl::call_factory_cast< winrt::Windows::Foundation::IAsyncOperationWithProgress< winrt::Microsoft::Windows::AI::AIFeatureReadyResult, double> (*)( ILanguageModelStatics const&), LanguageModel, ILanguageModelStatics>( [](ILanguageModelStatics const& f) { return f.EnsureReadyAsync(); }); } inline auto LanguageModel::CreateAsync() { return impl::call_factory_cast< winrt::Windows::Foundation::IAsyncOperation< winrt::Microsoft::Windows::AI::Text::LanguageModel> (*)( ILanguageModelStatics const&), LanguageModel, ILanguageModelStatics>( [](ILanguageModelStatics const& f) { return f.CreateAsync(); }); } inline LanguageModelOptions::LanguageModelOptions() : LanguageModelOptions( impl::call_factory_cast< LanguageModelOptions (*)( winrt::Windows::Foundation::IActivationFactory const&), LanguageModelOptions>( [](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) {} inline TextRewriter::TextRewriter( winrt::Microsoft::Windows::AI::Text::LanguageModel const& languageModel) : TextRewriter(impl::call_factory( [&](ITextRewriterFactory const& f) { return f.CreateInstance(languageModel); })) {} inline TextSummarizer::TextSummarizer( winrt::Microsoft::Windows::AI::Text::LanguageModel const& languageModel) : TextSummarizer( impl::call_factory( [&](ITextSummarizerFactory const& f) { return f.CreateInstance(languageModel); })) {} inline TextToTableConverter::TextToTableConverter( winrt::Microsoft::Windows::AI::Text::LanguageModel const& languageModel) : TextToTableConverter(impl::call_factory( [&](ITextToTableConverterFactory const& f) { return f.CreateInstance(languageModel); })) {} } namespace std { #ifndef WINRT_LEAN_AND_MEAN template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash< winrt::Microsoft::Windows::AI::Text::ILanguageModelEmbeddingVectorResult> : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash< winrt::Microsoft::Windows::AI::Text::LanguageModelEmbeddingVectorResult> : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } // namespace std #endif