הצגת נתונים עם מסנן
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
כשמציגים נתונים באמצעות ה-API, חלק מהבקשות של שיטת הרשימה מספקות שדה filter.
אתם יכולים להשתמש במסננים האלה כדי לקבל רק את התוצאות שמעניינות אתכם.
תכונת הסינון הזו נפוצה בהרבה ממשקי Google Cloud API.
בדוגמאות הבאות אפשר לראות איך לסנן את התגובה כשמציגים את תוצאות מקרי הבדיקה.
Java
כדי לבצע אימות ב-Dialogflow CX, צריך להגדיר את Application Default Credentials.
למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
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);}}}}
Node.js
כדי לבצע אימות ב-Dialogflow CX, צריך להגדיר את Application Default Credentials.
למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
כדי לבצע אימות ב-Dialogflow CX, צריך להגדיר את Application Default Credentials.
למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.
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
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["התוכן קשה להבנה","hardToUnderstand","thumb-down"],["שגיאות בקוד לדוגמה או במידע","incorrectInformationOrSampleCode","thumb-down"],["חסרים לי פרטים או דוגמאות","missingTheInformationSamplesINeed","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2026-11-11 (שעון UTC)."],[],[]]