ContentSafetyClient.GetTextBlocklistItemsAsync Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Sobrecargas
GetTextBlocklistItemsAsync(String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, CancellationToken) |
Obtiene todos los objetos BlockItems por blocklistName. |
GetTextBlocklistItemsAsync(String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, RequestContext) |
[Método Protocol] Obtener todos los objetos BlockItems por blocklistName
|
GetTextBlocklistItemsAsync(String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, CancellationToken)
Obtiene todos los objetos BlockItems por blocklistName.
public virtual Azure.AsyncPageable<Azure.AI.ContentSafety.TextBlockItem> GetTextBlocklistItemsAsync (string blocklistName, int? maxCount = default, int? skip = default, int? maxpagesize = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetTextBlocklistItemsAsync : string * Nullable<int> * Nullable<int> * Nullable<int> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.AI.ContentSafety.TextBlockItem>
override this.GetTextBlocklistItemsAsync : string * Nullable<int> * Nullable<int> * Nullable<int> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.AI.ContentSafety.TextBlockItem>
Public Overridable Function GetTextBlocklistItemsAsync (blocklistName As String, Optional maxCount As Nullable(Of Integer) = Nothing, Optional skip As Nullable(Of Integer) = Nothing, Optional maxpagesize As Nullable(Of Integer) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of TextBlockItem)
Parámetros
- blocklistName
- String
Nombre de la lista de bloques de texto.
- cancellationToken
- CancellationToken
Token de cancelación que se va a usar.
Devoluciones
Excepciones
blocklistName
es null.
blocklistName
es una cadena vacía y se esperaba que no estuviera vacía.
Ejemplos
En este ejemplo se muestra cómo llamar a GetTextBlocklistItemsAsync con parámetros necesarios.
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new ContentSafetyClient(endpoint, credential);
await foreach (var item in client.GetTextBlocklistItemsAsync("<blocklistName>", 1234, 1234, 1234))
{
}
Comentarios
Obtiene todos los objetos blockItems en una lista de bloques de texto.
Se aplica a
GetTextBlocklistItemsAsync(String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, RequestContext)
[Método Protocol] Obtener todos los objetos BlockItems por blocklistName
- Este método de protocolo permite la creación explícita de la solicitud y el procesamiento de la respuesta para escenarios avanzados.
- Pruebe primero la sobrecarga de comodidad más GetTextBlocklistItemsAsync(String, Nullable<Int32>, Nullable<Int32>, Nullable<Int32>, CancellationToken) sencilla con modelos fuertemente tipados.
public virtual Azure.AsyncPageable<BinaryData> GetTextBlocklistItemsAsync (string blocklistName, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context);
abstract member GetTextBlocklistItemsAsync : string * Nullable<int> * Nullable<int> * Nullable<int> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetTextBlocklistItemsAsync : string * Nullable<int> * Nullable<int> * Nullable<int> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetTextBlocklistItemsAsync (blocklistName As String, maxCount As Nullable(Of Integer), skip As Nullable(Of Integer), maxpagesize As Nullable(Of Integer), context As RequestContext) As AsyncPageable(Of BinaryData)
Parámetros
- blocklistName
- String
Nombre de la lista de bloques de texto.
- context
- RequestContext
Contexto de solicitud, que puede invalidar los comportamientos predeterminados de la canalización de cliente por llamada.
Devoluciones
del AsyncPageable<T> servicio que contiene una lista de BinaryData objetos. Los detalles del esquema de cuerpo de cada elemento de la colección se encuentran en la sección Comentarios siguiente.
Excepciones
blocklistName
es null.
blocklistName
es una cadena vacía y se esperaba que no estuviera vacía.
El servicio devolvió un código de estado no correcto.
Ejemplos
En este ejemplo se muestra cómo llamar a GetTextBlocklistItemsAsync con los parámetros necesarios y analizar el resultado.
var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new ContentSafetyClient(endpoint, credential);
await foreach (var item in client.GetTextBlocklistItemsAsync("<blocklistName>", 1234, 1234, 1234, new RequestContext()))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("blockItemId").ToString());
Console.WriteLine(result.GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("text").ToString());
}
Se aplica a
Comentarios
https://aka.ms/ContentUserFeedback.
Próximamente: A lo largo de 2024 iremos eliminando gradualmente GitHub Issues como mecanismo de comentarios sobre el contenido y lo sustituiremos por un nuevo sistema de comentarios. Para más información, vea:Enviar y ver comentarios de