다음 코드 스니펫은 대화 웹훅 (JSON)의 예를 보여줍니다.
사용자가 "공기질 어때
샌프란시스코?':
"inputs":[{"intent":"actions.intent.CHECK_AIR_QUALITY","rawInputs":[{"inputType":"VOICE","query":"what is the air quality in san francisco tomorrow"}],"arguments":[{"name":"location","structuredValue":{"geo":{"longitude":-122.41941550000001,"latitude":37.7749295},"@context":"https://schema.org","@type":"Place","name":"san francisco"}},{"name":"temporalCoverage","rawText":"2018-04-25","textValue":"2018-04-25"}]}]
app.intent('actions.intent.CHECK_AIR_QUALITY',(conv)=>{constattributes=conv.arguments.get('attributes');constlocation=conv.arguments.get('location');consttemporal_coverage=conv.arguments.get('temporalCoverage');Consttime_indicator=conv.arguments.get('timeIndicator')//YourActionlogic.Ifyouneedtouseanyoftheparametervalues,//youshouldcheckfirstthatitisdefined.Arguments.getreturns//undefinedifitcan't find a value for a parameter.});
내장 인텐트와의 통합 테스트
통합을 테스트하려면 다음 단계를 따르세요.
테스트 작업이 사용 설정된 상태로 작업 시뮬레이터를 열거나 엽니다.
기기에서 어시스턴트를 사용할 수 있습니다.
내장 인텐트와 관련된 쿼리를 말하거나 입력합니다. 예를 들어
“게임하고 싶어.”
표시된 앱 선택 대화상자에서 작업을 찾습니다.
앱에 인텐트를 보낼 앱을 선택합니다.
그림 3. 내장 인텐트 문구에서 생성되는 작업 선택 대화상자
그림 4. 내장 인텐트에 연결된 작업 호출
내장 인텐트 사용 권장사항
내장 인텐트를 사용할 때는 다음 권장사항을 따라야 합니다.
내장 인텐트를 특정 작업에 매핑: 특정 내장 인텐트가
작업을 트리거하고 사용자를 특정 인텐트로 보내고
기능을 최대한 원활하게 구현하세요. 대상
작업이 PLAY_GAME 내장 인텐트를 지원하고
해당 인텐트를 수신하면 사용자를 즉시 게임 기능으로 보내야 합니다.
확인할 수 있습니다 게임을 하고 싶은지 사용자에게 다시 묻지 않습니다.
내장 인텐트 매개변수 처리: 내장 인텐트를 사용해야 합니다.
매개변수 값을 포함해야 합니다.
사용자에게 이러한 값을 다시 입력하라는 메시지를 표시하지 않습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-26(UTC)"],[],[]]