Aracılığıyla paylaş


Windows Uygulama SDK'sında Phi Silica için API başvurusu

Önemli

Windows Uygulama SDK'sının en son deneysel kanal sürümünde kullanılabilir.

Windows Uygulama SDK'sı deneysel kanalı, geliştirmenin erken aşamalarında API'leri ve özellikleri içerir. Deneysel kanaldaki tüm API'ler kapsamlı düzeltmelere ve hataya neden olan değişikliklere tabidir ve herhangi bir zamanda sonraki sürümlerden kaldırılabilir. Deneysel özellikler üretim ortamlarında kullanılmak üzere desteklenmez ve bunları kullanan uygulamalar Microsoft Store'da yayımlanamaz.

  • Phi Silica, Çin anakarasında mevcut değildir.
  • Bağımsız uygulamalar desteklenmez.

Microsoft'un cihaz içi işleme ve sohbet oluşturma, metin üzerinde mantık yürütme, matematik çözme, kod oluşturma ve daha fazlasını sağlayan en güçlü NPU tarafından ayarlanmış yerel dil modeli Phi Silica gibi yerel dil modellerine erişebilen Windows Uygulama SDK'sı API'leri hakkında bilgi edinin.

Daha fazla ayrıntı için bkz. windows uygulama SDK'sıPhi Silica'yı kullanmaya başlama .

Bahşiş

Windows Uygulama SDK'sı GitHub deposunda (başlıkta Phi Silica dahil) yeni bir Sorun oluşturarak veya mevcutbir soruna yanıt vererek bu API'ler ve işlevleri hakkında geri bildirim sağlayın.


Microsoft.Windows.AI.Generative ad alanı

Yerel, cihaz içi yapay zeka istem işleme ve yanıtları için API'ler sağlar.

ImageDescriptionGenerator sınıfı

public sealed class ImageDescriptionGenerator : System.IDisposable

ImageDescriptionGenerator.Close yöntemi

// This member is not implemented in C#
Açıklamalar

C# dilinde uygulanmadı.

ImageDescriptionGenerator.CreateAsync yöntemi

public static Windows.Foundation.IAsyncOperation<Microsoft.Windows.AI.Generative.ImageDescriptionGenerator> CreateAsync ();

ImageDescriptionGenerator.DescribeAsync(Microsoft.Graphics.Imaging.ImageBuffer) yöntemi

public Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.AI.Generative.LanguageModelResponse,string> DescribeAsync (Microsoft.Graphics.Imaging.ImageBuffer image);

Uyarı

Bir görüntüde ImageDescriptionGenerator.DescribeAsync() çağrılırken bazen bir hata oluşur. Bu hata atlanabilir, böylece hata ayıklayıcı devam edebilir ve doğru çıktıyı üretebilir. Hata, son kullanıcılar (uygulamanızı kullanan müşteriler) için değil yalnızca geliştirici ortamında görünür. Debug veya Yayın derlemelerinin kullanılması bu hatayı tetikler. Hata, her çalıştırmada değil aralıklı olarak oluşur.

ImageDescriptionGenerator.DescribeAsync(Microsoft.Graphics.Imaging.ImageBuffer,Microsoft.Windows.AI.Generative.ImageDescriptionScenario) yöntemi

public Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.AI.Generative.LanguageModelResponse,string> DescribeAsync (Microsoft.Graphics.Imaging.ImageBuffer image, Microsoft.Windows.AI.Generative.ImageDescriptionScenario scenario);
Parametreler
resim
senaryo
İadeler
Açıklamalar

ImageDescriptionGenerator.DescribeAsync(Microsoft.Graphics.Imaging.ImageBuffer,Microsoft.Windows.AI.Generative.ImageDescriptionScenario,Microsoft.Windows.AI.ContentModeration.ContentFilterOptions) yöntemi

public Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.AI.Generative.LanguageModelResponse,string> DescribeAsync (Microsoft.Graphics.Imaging.ImageBuffer image, Microsoft.Windows.AI.Generative.ImageDescriptionScenario scenario, Microsoft.Windows.AI.ContentModeration.ContentFilterOptions contentFilterOptions);
Parametreler
resim
senaryo
içerik filtreleme seçenekleri
İadeler
Açıklamalar

ImageDescriptionGenerator.IsAvailable yöntemi

public static bool IsAvailable ();

ImageDescriptionGenerator.MakeAvailableAsync yöntemi

public static Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.Management.Deployment.PackageDeploymentResult,Microsoft.Windows.Management.Deployment.PackageDeploymentProgress> MakeAvailableAsync ();

ImageDescriptionScenario numaralandırıcısı

public enum ImageDescriptionScenario

Alanları

Erişilebilirlik: 1
Resim yazısı: 2
DetailedNarration: 3
OfficeCharts: 4

ImageLLMAdapterCreator sınıfı

public sealed class ImageLLMAdapterCreator : System.IDisposable

ImageLLMAdapterCreator.Close yöntemi

// This member is not implemented in C#
Açıklamalar

C# dilinde uygulanmadı.

ImageLLMAdapterCreator.CreateAsync yöntemi

public static Windows.Foundation.IAsyncOperation<Microsoft.Windows.AI.Generative.ImageLLMAdapterCreator> CreateAsync ();
İadeler

ImageLLMAdapterCreator.GetImageLLMEmbeddings(Microsoft.Windows.SemanticSearch.EmbeddingVector) yöntemi

public System.Collections.Generic.IReadOnlyList<float> GetImageLLMEmbeddings (Microsoft.Windows.SemanticSearch.EmbeddingVector embeddings);
Parametreler
eklemeler
İadeler

ImageLLMAdapterCreator.GetImageLLMEmbeddingsAsync(Microsoft.Windows.SemanticSearch.EmbeddingVector) yöntemi

public Windows.Foundation.IAsyncOperation<System.Collections.Generic.IReadOnlyList<float>> GetImageLLMEmbeddingsAsync (Microsoft.Windows.SemanticSearch.EmbeddingVector embeddings);
Parametreler
eklemeler
İadeler

ImageLLMAdapterCreator.GetModelInputSize yöntemi

public uint GetModelInputSize ();
İadeler

ImageLLMAdapterCreator.GetModelOutputSize yöntemi

public uint GetModelOutputSize ();
İadeler

ImageLLMAdapterCreator.IsAvailable yöntemi

public static bool IsAvailable ();
İadeler

ImageLLMAdapterCreator.MakeAvailableAsync yöntemi

public static Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.Management.Deployment.PackageDeploymentResult,Microsoft.Windows.Management.Deployment.PackageDeploymentProgress> MakeAvailableAsync ();
İadeler

LanguageModel sınıfı

public sealed class LanguageModel : System.IDisposable

Sağlanan bir istem için yanıt oluşturmak üzere yerel dil modeliyle etkileşim kurabilen bir nesneyi temsil eder.

LanguageModel.Close yöntemi

Nesne ve ilişkili kaynakları kaldırır.

Açıklamalar

C# dilinde uygulanmadı.

LanguageModel.CreateAsync yöntemi

public static Windows.Foundation.IAsyncOperation<Microsoft.Windows.AI.Generative.LanguageModel> CreateAsync ();

LanguageModel sınıfının yeni bir örneğini zaman uyumsuz olarak oluşturur.

İadeler

TextRecognizer sınıfının yeni bir örneği.

LanguageModel.CreateContext yöntemi

public Microsoft.Windows.AI.Generative.LanguageModelContext CreateContext ();
İadeler
Açıklamalar

LanguageModel.CreateContext(System.String,Microsoft.Windows.AI.ContentModeration.ContentFilterOptions) yöntemi

public Microsoft.Windows.AI.Generative.LanguageModelContext CreateContext (string systemPrompt, Microsoft.Windows.AI.ContentModeration.ContentFilterOptions contentFilterOptions);
Parametreler
Sistem İstemi
içerik filtreleme seçenekleri
İadeler
Açıklamalar

LanguageModel.GenerateEmbeddingVector(System.String,Microsoft.Windows.AI.ContentModeration.ContentFilterOptions) yöntemi

public System.Collections.Generic.IReadOnlyList<Microsoft.Windows.SemanticSearch.EmbeddingVector> GenerateEmbeddingVector (string prompt, Microsoft.Windows.AI.ContentModeration.ContentFilterOptions contentFilterOptions);
Parametreler
Talimat
içerik filtreleme seçenekleri
İadeler
Açıklamalar

LanguageModel.GenerateEmbeddingVector(System.String) yöntemi

public System.Collections.Generic.IReadOnlyList<Microsoft.Windows.SemanticSearch.EmbeddingVector> GenerateEmbeddingVector (string prompt);
Parametreler
Talimat
İadeler
Açıklamalar

LanguageModel.GenerateEmbeddingVectorAsync(System.String) yöntemi

public Windows.Foundation.IAsyncOperation<System.Collections.Generic.IReadOnlyList<Microsoft.Windows.SemanticSearch.EmbeddingVector>> GenerateEmbeddingVectorAsync (string prompt);
Parametreler
Talimat
İadeler
Açıklamalar

LanguageModel.GenerateEmbeddingVectorAsync(System.String,Microsoft.Windows.AI.ContentModeration.ContentFilterOptions) yöntemi

public Windows.Foundation.IAsyncOperation<System.Collections.Generic.IReadOnlyList<Microsoft.Windows.SemanticSearch.EmbeddingVector>> GenerateEmbeddingVectorAsync (string prompt, Microsoft.Windows.AI.ContentModeration.ContentFilterOptions contentFilterOptions);
Parametreler
Talimat
içerik filtreleme seçenekleri
İadeler
Açıklamalar

LanguageModel.GenerateResponseAsync(Microsoft.Windows.AI.Generateive.LanguageModelOptions,System.String,Microsoft.Windows.AI.ContentModeration.ContentFilterOptions) yöntemi

public Windows.Foundation.IAsyncOperation<Microsoft.Windows.AI.Generative.LanguageModelResponse> GenerateResponseAsync (Microsoft.Windows.AI.Generative.LanguageModelOptions options, string prompt, Microsoft.Windows.AI.ContentModeration.ContentFilterOptions contentFilterOptions);
Parametreler
Seçenekler
Talimat
içerik filtreleme seçenekleri
İadeler
Açıklamalar

LanguageModel.GenerateResponseAsync(System.String) yöntemi

public Windows.Foundation.IAsyncOperation<Microsoft.Windows.AI.Generative.LanguageModelResponse> GenerateResponseAsync (string prompt);

Tek bir istem için tam yanıt oluşturur ve döndürür.

Parametreler
Talimat

Soru biçiminde bir istem.

İadeler

Yanıt dizesi ve durumu.

Özel durum

ArgumentException: Belirtilen istem, modelin kabul edebildiği en fazla belirteç sayısından daha uzun.

LanguageModel.GenerateResponseAsync(Microsoft.Windows.AI.Generateive.LanguageModelOptions,System.String,Microsoft.Windows.AI.ContentModeration.ContentFilterOptions,Microsoft.Windows.AI.Generateive.LanguageModelContext) yöntemi

public Windows.Foundation.IAsyncOperation<Microsoft.Windows.AI.Generative.LanguageModelResponse> GenerateResponseAsync (Microsoft.Windows.AI.Generative.LanguageModelOptions options, string prompt, Microsoft.Windows.AI.ContentModeration.ContentFilterOptions contentFilterOptions, Microsoft.Windows.AI.Generative.LanguageModelContext context);
Parametreler
Seçenekler
Talimat
içerik filtreleme seçenekleri
Bağlam
İadeler
Açıklamalar

LanguageModel.GenerateResponseAsync(Microsoft.Windows.AI.Generateive.LanguageModelOptions,System.String) yöntemi

public Windows.Foundation.IAsyncOperation<Microsoft.Windows.AI.Generative.LanguageModelResponse> GenerateResponseAsync (Microsoft.Windows.AI.Generative.LanguageModelOptions options, string prompt);
Parametreler
Seçenekler
Talimat
İadeler
Açıklamalar

LanguageModel.GenerateResponseFromEmbeddingsWithProgressAsync(Microsoft.Windows.AI.Generative.LanguageModelOptions,Windows.Foundation.Collections.IVectorView{Microsoft.Windows.SemanticSearch.EmbeddingVector},Microsoft.Windows.AI.ContentModeration.ContentFilterOptions,Microsoft.Windows.AI.Generative.LanguageModelContext) yöntemi

public Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.AI.Generative.LanguageModelResponse,string> GenerateResponseFromEmbeddingsWithProgressAsync (Microsoft.Windows.AI.Generative.LanguageModelOptions options, System.Collections.Generic.IReadOnlyList<Microsoft.Windows.SemanticSearch.EmbeddingVector> promptEmbedding, Microsoft.Windows.AI.ContentModeration.ContentFilterOptions contentFilterOptions, Microsoft.Windows.AI.Generative.LanguageModelContext context);
Parametreler
Seçenekler
promptEmbedding
içerik filtreleme seçenekleri
Bağlam
İadeler
Açıklamalar

LanguageModel.GenerateResponseFromEmbeddingsWithProgressAsync(Microsoft.Windows.AI.Generative.LanguageModelOptions,Windows.Foundation.Collections.IVectorView{Microsoft.Windows.SemanticSearch.EmbeddingVector},Microsoft.Windows.AI.ContentModeration.ContentFilterOptions) yöntemi

public Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.AI.Generative.LanguageModelResponse,string> GenerateResponseFromEmbeddingsWithProgressAsync (Microsoft.Windows.AI.Generative.LanguageModelOptions options, System.Collections.Generic.IReadOnlyList<Microsoft.Windows.SemanticSearch.EmbeddingVector> promptEmbedding, Microsoft.Windows.AI.ContentModeration.ContentFilterOptions contentFilterOptions);
Parametreler
Seçenekler
promptEmbedding
içerik filtreleme seçenekleri
İadeler
Açıklamalar

LanguageModel.GenerateResponseFromEmbeddingsWithProgressAsync(Windows.Foundation.Collections.IVectorView{Microsoft.Windows.SemanticSearch.EmbeddingVector}) yöntemi

public Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.AI.Generative.LanguageModelResponse,string> GenerateResponseFromEmbeddingsWithProgressAsync (System.Collections.Generic.IReadOnlyList<Microsoft.Windows.SemanticSearch.EmbeddingVector> promptEmbedding);
Parametreler
promptEmbedding
İadeler
Açıklamalar

LanguageModel.GenerateResponseFromEmbeddingsWithProgressAsync(Microsoft.Windows.AI.Generative.LanguageModelOptions, Windows.Foundation.Collections.IVectorView{Microsoft.Windows.SemanticSearch.EmbeddingVector}) yöntemi

public Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.AI.Generative.LanguageModelResponse,string> GenerateResponseFromEmbeddingsWithProgressAsync (Microsoft.Windows.AI.Generative.LanguageModelOptions options, System.Collections.Generic.IReadOnlyList<Microsoft.Windows.SemanticSearch.EmbeddingVector> promptEmbedding);
Parametreler
Seçenekler
promptEmbedding
İadeler

LanguageModel.GenerateResponseFromTokensWithProgressAsync(Microsoft.Windows.AI.Generative.LanguageModelOptions,Windows.Foundation.Collections.IVectorView{System.Int64}) yöntemi

public Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.AI.Generative.LanguageModelResponse,string> GenerateResponseFromTokensWithProgressAsync (Microsoft.Windows.AI.Generative.LanguageModelOptions options, System.Collections.Generic.IReadOnlyList<long> promptTokens);
Parametreler
Seçenekler
promptTokens
İadeler

LanguageModel.GenerateResponseFromTokensWithProgressAsync(Microsoft.Windows.AI.Generative.LanguageModelOptions,Windows.Foundation.Collections.IVectorView{System.Int64},Microsoft.Windows.AI.ContentModeration.ContentFilterOptions,Microsoft.Windows.AI.Generative.LanguageModelContext) yöntemi

public Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.AI.Generative.LanguageModelResponse,string> GenerateResponseFromTokensWithProgressAsync (Microsoft.Windows.AI.Generative.LanguageModelOptions options, System.Collections.Generic.IReadOnlyList<long> promptTokens, Microsoft.Windows.AI.ContentModeration.ContentFilterOptions contentFilterOptions, Microsoft.Windows.AI.Generative.LanguageModelContext context);
Parametreler
Seçenekler
promptTokens
içerik filtreleme seçenekleri
Bağlam
İadeler

LanguageModel.GenerateResponseFromTokensWithProgressAsync(Microsoft.Windows.AI.Generative.LanguageModelOptions,Windows.Foundation.Collections.IVectorView{System.Int64},Microsoft.Windows.AI.ContentModeration.ContentFilterOptions) yöntemi

public Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.AI.Generative.LanguageModelResponse,string> GenerateResponseFromTokensWithProgressAsync (Microsoft.Windows.AI.Generative.LanguageModelOptions options, System.Collections.Generic.IReadOnlyList<long> promptTokens, Microsoft.Windows.AI.ContentModeration.ContentFilterOptions contentFilterOptions);
Parametreler
Seçenekler
promptTokens
içerik filtreleme seçenekleri
İadeler

LanguageModel.GenerateResponseWithProgressAsync(Microsoft.Windows.AI.Generateive.LanguageModelOptions,System.String,Microsoft.Windows.AI.ContentModeration.ContentFilterOptions) yöntemi

public Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.AI.Generative.LanguageModelResponse,string> GenerateResponseWithProgressAsync (Microsoft.Windows.AI.Generative.LanguageModelOptions options, string prompt, Microsoft.Windows.AI.ContentModeration.ContentFilterOptions contentFilterOptions);
Parametreler
Seçenekler
Talimat
içerik filtreleme seçenekleri
İadeler

LanguageModel.GenerateResponseWithProgressAsync(System.String) yöntemi

public Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.AI.Generative.LanguageModelResponse,string> GenerateResponseWithProgressAsync (string prompt);
Parametreler
Talimat
İadeler

LanguageModel.GenerateResponseWithProgressAsync(Microsoft.Windows.AI.Generateive.LanguageModelOptions,System.String) yöntemi

public Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.AI.Generative.LanguageModelResponse,string> GenerateResponseWithProgressAsync (Microsoft.Windows.AI.Generative.LanguageModelOptions options, string prompt);
Parametreler
Seçenekler
Talimat
İadeler

LanguageModel.GenerateResponseWithProgressAsync(Microsoft.Windows.AI.Generateive.LanguageModelOptions,System.String,Microsoft.Windows.AI.ContentModeration.ContentFilterOptions,Microsoft.Windows.AI.Generateive.LanguageModelContext) yöntemi

public Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.AI.Generative.LanguageModelResponse,string> GenerateResponseWithProgressAsync (Microsoft.Windows.AI.Generative.LanguageModelOptions options, string prompt, Microsoft.Windows.AI.ContentModeration.ContentFilterOptions contentFilterOptions, Microsoft.Windows.AI.Generative.LanguageModelContext context);
Parametreler
Seçenekler
Talimat
içerik filtreleme seçenekleri
Bağlam
İadeler

LanguageModel.GenerateTokens(System.String,Microsoft.Windows.AI.ContentModeration.ContentFilterOptions) yöntemi

public System.Collections.Generic.IReadOnlyList<long> GenerateTokens (string text, Microsoft.Windows.AI.ContentModeration.ContentFilterOptions contentFilterOptions);
Parametreler
Metin
içerik filtreleme seçenekleri
İadeler

LanguageModel.GenerateTokens(System.String,Microsoft.Windows.AI.ContentModeration.ContentFilterOptions) yöntemi

public System.Collections.Generic.IReadOnlyList<long> GenerateTokens (string text, Microsoft.Windows.AI.ContentModeration.ContentFilterOptions contentFilterOptions);
Parametreler
Metin
içerik filtreleme seçenekleri
İadeler

LanguageModel.GenerateTokensAsync(System.String) yöntemi

public Windows.Foundation.IAsyncOperation<System.Collections.Generic.IReadOnlyList<long>> GenerateTokensAsync (string text);
Parametreler
Metin
İadeler

LanguageModel.GenerateTokensAsync(System.String,Microsoft.Windows.AI.ContentModeration.ContentFilterOptions) yöntemi

public Windows.Foundation.IAsyncOperation<System.Collections.Generic.IReadOnlyList<long>> GenerateTokensAsync (string text, Microsoft.Windows.AI.ContentModeration.ContentFilterOptions contentFilterOptions);
Parametreler
Metin
içerik filtreleme seçenekleri
İadeler

LanguageModel.IsAvailable yöntemi

public static bool IsAvailable ();
İadeler

LanguageModel.IsPromptLargerThanContext(Microsoft.Windows.AI.Generative.LanguageModelContext,System.String) yöntemi

public bool IsPromptLargerThanContext (Microsoft.Windows.AI.Generative.LanguageModelContext context, string prompt);
Parametreler
Bağlam
Talimat
İadeler

LanguageModel.IsPromptLargerThanContext(System.String) yöntemi

public bool IsPromptLargerThanContext (string prompt);
Parametreler
Talimat
İadeler

LanguageModel.MakeAvailableAsync yöntemi

public static Windows.Foundation.IAsyncOperationWithProgress<Microsoft.Windows.Management.Deployment.PackageDeploymentResult,Microsoft.Windows.Management.Deployment.PackageDeploymentProgress> MakeAvailableAsync ();
İadeler

LanguageModelContext sınıfı

public sealed class LanguageModelContext

LanguageModelOptions sınıfı

public sealed class LanguageModelOptions

LanguageModelOptions.#ctor oluşturucu

public LanguageModelOptions ();

LanguageModelOptions.#ctor(Microsoft.Windows.AI.Generative.LanguageModelSkill,System.Single,System.Single,System.UInt32) oluşturucu

public LanguageModelOptions (Microsoft.Windows.AI.Generative.LanguageModelSkill skill, float temp, float top_p, uint top_k);
Parametreler
beceri
temp
top_p
top_k

LanguageModelOptions.Skill özelliği

public Microsoft.Windows.AI.Generative.LanguageModelSkill Skill { get; set; }
Özellik değeri

LanguageModelOptions.Temp özelliği

public float Temp { get; set; }
Özellik değeri

LanguageModelOptions.Top_k özelliği

public uint Top_k { get; set; }
Özellik değeri

LanguageModelOptions.Top_p özelliği

public float Top_p { get; set; }
Özellik değeri

LanguageModelResponse sınıfı

public sealed class LanguageModelResponse

LanguageModelResponse.#ctor(System.String,Microsoft.Windows.AI.Generative.LanguageModelResponseStatus) oluşturucusu

public LanguageModelResponse (string response, Microsoft.Windows.AI.Generative.LanguageModelResponseStatus status);
Parametreler
yanıt
durum

LanguageModelResponse.Response özelliği

public string Response { get; }
Özellik değeri

LanguageModelResponse.Status özelliği

public Microsoft.Windows.AI.Generative.LanguageModelResponseStatus Status { get; }
Özellik değeri

LanguageModelResponseStatus numaralandırma türü

public enum LanguageModelResponseStatus

Alanları

Tamamlandı: 0
InProgress: 1
Politika Tarafından Engellendi: 2
PromptLargerThanContext: 3
Politika Tarafından Engellenen İstekte Bulunuluyor: 4
Politika Tarafından Engellendi: 5

LanguageModelSkill sıralaması

public enum LanguageModelSkill

Alanları

Genel: 0
TextToTable: 1
Özetle: 2
Yeniden yazma: 3