Alguns produtos e recursos estão sendo renomeados. Os recursos de playbook generativo e de fluxo também estão sendo migrados para um único console consolidado. Confira os detalhes.
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Ao listar dados com a API,
algumas solicitações de método de lista fornecem um campo filter.
Você pode usar esses filtros para retornar apenas os resultados em que tiver interesse.
Esse
recurso de filtragem
é comum em muitas APIs do Google Cloud.
Os exemplos a seguir mostram como filtrar a resposta ao
listar os resultados do caso de teste.
importcom.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest;importcom.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest.Builder;importcom.google.cloud.dialogflow.cx.v3.TestCaseResult;importcom.google.cloud.dialogflow.cx.v3.TestCasesClient;importcom.google.cloud.dialogflow.cx.v3.TestCasesSettings;importjava.io.IOException;publicclassListTestCaseResults{publicstaticvoidmain(String[]args)throwsIOException{// TODO(developer): Replace these variables before running the sample.StringprojectId="my-project-id";StringagentId="my-agent-id";StringtestId="my-test-id";Stringlocation="my-location";listTestCaseResults(projectId,agentId,testId,location);}publicstaticvoidlistTestCaseResults(StringprojectId,StringagentId,StringtestId,Stringlocation)throwsIOException{Stringparent="projects/"+projectId+"/locations/"+location+"/agents/"+agentId+"/testCases/"+testId;Builderreq=ListTestCaseResultsRequest.newBuilder();req.setParent(parent);req.setFilter("environment=draft");TestCasesSettingstestCasesSettings=TestCasesSettings.newBuilder().setEndpoint(location+"-dialogflow.googleapis.com:443").build();// Note: close() needs to be called on the TestCasesClient object to clean up resources// such as threads. In the example below, try-with-resources is used,// which automatically calls close().try(TestCasesClientclient=TestCasesClient.create(testCasesSettings)){for(TestCaseResultelement:client.listTestCaseResults(req.build()).iterateAll()){System.out.println(element);}}}}
fromgoogle.cloud.dialogflowcx_v3.services.test_cases.clientimportTestCasesClientfromgoogle.cloud.dialogflowcx_v3.types.test_caseimportListTestCaseResultsRequestdeflist_test_case(project_id,agent_id,test_id,location):req=ListTestCaseResultsRequest()req.parent=f"projects/{project_id}/locations/{location}/agents/{agent_id}/testCases/{test_id}"req.filter="environment=draft"client=TestCasesClient(client_options={"api_endpoint":f"{location}-dialogflow.googleapis.com"})# Makes a call to list all test case results that match filterresult=client.list_test_case_results(request=req)print(result)returnresult
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-04-08 UTC."],[[["Many Google Cloud APIs, including Dialogflow, allow you to filter list method requests using a `filter` field to narrow down the results you get."],["The provided examples demonstrate how to filter test case results in Dialogflow using Java, Node.js, and Python."],["When listing test case results, you can set a filter such as `environment=draft` to retrieve specific data."],["You can make use of Application Default Credentials to properly authenticate with Dialogflow APIs."]]],[]]