이 페이지는 Apigee 및 Apigee Hybrid에 적용됩니다.
Apigee Edge 문서 보기
개요
SetDialogflowResponse 정책은 Dialogflow와 Apigee의 통합을 도와줍니다. 자세한 내용은 Apigee와 Contact Center AI 통합을 참조하세요.
SetDialogflowResponse 정책은 데이터를 WebhookResponse로 Dialogflow 에이전트에 보내기 전에 백엔드 시스템의 응답 데이터를 처리하고 형식을 지정합니다. Dialogflow 에이전트에는 특정 형식의 WebhookResponse가 필요하며 SetDialogflowResponse 정책은 필수 형식으로 응답을 빌드합니다. 정책은 Dialogflow 에이전트에 필요한 형식으로 WebhookResponse를 생성합니다. WebhookResponse에는 Dialogflow 에이전트가 이해하는 자연어 문법 및 기타 매개변수가 있습니다.
백엔드 서비스 통합업체는 Dialoglfow WebhookResponse의 형식을 이해하는 데 시간을 소비할 필요가 없습니다. 즉시 사용 가능한 SetDialogflowResponse 정책이 응답 데이터를 원활하게 처리해 줍니다.
이 정책은 확장 가능한 정책이며, 이 정책을 사용하면 Apigee 라이선스에 따라 비용 또는 사용률이 영향을 받을 수 있습니다. 정책 유형 및 사용 영향에 대한 자세한 내용은 정책 유형을 참조하세요.
<SetDialogflowResponse>
SetDialogflowResponse 정책을 정의합니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 필수 |
| 유형 | 복합 객체 |
| 상위 요소 | 해당 사항 없음 |
| 하위 요소 |
<DisplayName><Source><DialogflowVersion><NaturalLanguageResponse><Parameters><IgnoreUnresolvedVariables> |
다음 표에서는 SetDialogflowResponse 요소의 모든 하위 요소를 간략하게 설명합니다.
| 하위 요소 | 필수 여부 | 설명 |
|---|---|---|
<DisplayName> |
선택사항 | 정책의 커스텀 이름입니다. |
<Source> |
선택사항 | 파싱할 변수를 지정합니다. |
<DialogflowVersion> |
선택사항 | Dialogflow 버전을 지정합니다. |
<NaturalLanguageResponse> |
선택사항 | WebhookResponse.FulfillmentResponse 객체로 전송해야 하는 모든 콘텐츠를 캡슐화합니다. |
<Parameters> |
선택사항 | <Parameter>의 상위 요소입니다. 웹훅의 응답에 설정할 매개변수 집합을 정의합니다. |
<IgnoreUnresolvedVariables> |
선택사항 | 해결되지 않은 변수가 발생하면 처리를 중지할지 여부를 지정합니다. |
| 기타 하위 요소 | ||
<MergeBehavior> |
선택사항 | 응답 메시지의 병합 동작을 지정합니다. |
<Header> |
선택사항 | 응답 헤더에서 지정된 필드의 값을 추출합니다. |
<JSONPath> |
선택사항 | 지정된 JSON 경로의 값을 추출합니다. |
<Parameter> |
필수 | 웹훅 응답의 sessionInfo.parameters 객체에서 설정할 매개변수를 지정합니다. |
<Phrase> |
필수 | 웹훅 응답의 fulfillmentResponse.messages 객체에 설정할 문법(텍스트)을 지정합니다. |
<Phrases> |
선택사항 | <Phrase>의 상위 요소입니다. 웹훅의 응답에 설정할 자연어 문법 집합을 정의합니다. |
<Ref> |
선택사항 | 지정된 참조 변수의 값을 추출합니다. |
<Value> |
선택사항 | 커스텀 텍스트를 지정된 매개변수로 설정합니다. |
예
다음 예시는 샘플 SetDialogflowResponse 정책 및 Dialogflow 에이전트에 전송되는 WebhookResponse를 보여줍니다.
구문
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <SetDialogflowResponse continueOnError="false" enabled="true" name="POLICY_NAME"> <!-- The display name for this policy --> <DisplayName>DISPLAY_NAME</DisplayName> <!-- The message variable from which the policy extracts the required information --> <Source>MESSAGE_VARIABLE</Source> <!-- The version of Dialogflow for which this response policy is written up. This policy supports only the CX version. This element is optional and defaults to CX if unspecified --> <DialogflowVersion>DIALOGFLOW_VERSION</DialogflowVersion> <!-- A container object to encapsulate all content needed for a natural language response to be returned to Dialogflow from the Southbound API --> <NaturalLanguageResponse> <!-- Defines the merge behavior for existing responses and new responses. Refer here for more details --> <MergeBehavior>MERGE_BEHAVIOR</MergeBehavior> <!-- An ordered list of natural language phrases to be returned to Dialogflow from the Southbound API --> <Phrases> <!-- A phrase is a natural language phrase that Dialogflow agents can send back to their caller/chatting customer --> <Phrase> <!-- A phrase can be extracted from the response JSON payload of a service callout --> <JSONPath>JSON_PATH</JSONPath> </Phrase> <Phrase> <!-- A phrase can be extracted from the response headers of a service callout --> <Header name="HEADER_NAME"/> </Phrase> <Phrase> <!-- A phrase refer to the value of an existing flow variable --> <Ref>EXISTING_FLOW_VARIABLE</Ref> </Phrase> <Phrase> <!-- A phrase can be static text --> <Value>CUSTOM_TEXT</Value> </Phrase> </Phrases> </NaturalLanguageResponse> <!-- A container object defining the parameters to be set as session parameters in the Webhook response sent to Dialogflow --> <Parameters> <!-- Defines a single parameter to be set in sessionInfo.parameters object of the WebhookResponse object. The name of the parameter is defined as an attribute --> <Parameter name="PARAMETER_NAME"> <!-- A parameter's value can be extracted from the response JSON payload of a service callout --> <JSONPath>JSON_PATH</JSONPath> </Parameter> <Parameter name="PARAMETER_NAME"> <!-- A parameter's value can be extracted from the response headers of a service callout --> <Header name="HEADER_NAME"/> </Parameter> <Parameter name="PARAMETER_NAME"> <!-- A parameter's value can be refer to the value of an existing flow variable --> <Ref>EXISTING_FLOW_VARIABLE</Ref> </Parameter> <Parameter name="PARAMETER_NAME"> <!-- A parameter's value can be static text --> <Value>CUSTOM_TEXT</Value> </Parameter> </Parameters> <IgnoreUnresolvedVariables>BOOLEAN_VALUE</IgnoreUnresolvedVariables> </SetDialogflowResponse>
SetDialogflowResponse 정책
다음 예시에서는 SetDialogflowResponse 정책 정의를 보여줍니다.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <SetDialogflowResponse continueOnError="false" enabled="true" name="CCAIDialogflowResponse-InsuranceAgent"> <DisplayName>Insurance Agent Webhook Response Policy</DisplayName> <Source>myMessageVar</Source> <DialogflowVersion>CX</DialogflowVersion> <NaturalLanguageResponse> <MergeBehavior>APPEND</MergeBehavior> <Phrases> <Phrase> <JSONPath>$.claim.status.text</JSONPath> </Phrase> <Phrase> <Header name="X-Response-Text"/> </Phrase> <Phrase> <Ref>myVar</Ref> </Phrase> <Phrase> <Value>You call is important to us</Value> </Phrase> </Phrases> </NaturalLanguageResponse> <Parameters> <Parameter name="claimStatus"> <JSONPath>$.claim.status.value</JSONPath> </Parameter> <Parameter name="claimAmount"> <JSONPath>$.claim.amount</JSONPath> </Parameter> <Parameter name="timeSpent"> <Header name="X-Time-Spent"/> </Parameter> <Parameter name="myVar"> <Ref>dialogflow.my.var</Ref> </Parameter> <Parameter name="responder"> <Value>SYSTEM</Value> </Parameter> </Parameters> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> </SetDialogflowResponse>
다음 샘플로 이동하여 이 정책에서 생성된 웹훅 응답을 확인합니다.
웹훅 응답
다음 예시에서는 Dialogflow 에이전트로 전송된 WebhookResponse를 보여줍니다.
{ "fulfillmentResponse": { "mergeBehavior": "APPEND", "messages": [{ "text": { "text": ["Your claim is currently being processed", "Please call back in a couple of days"] } }] }, "sessionInfo": { "parameters": { "claimStatus": "PROCESSING", "claimAmount": 1000 } } }
이 요소에는 다음과 같이 모든 정책에 공통된 속성이 있습니다.
| 속성 | 기본값 | 필수 여부 | 설명 |
|---|---|---|---|
name |
해당 사항 없음 | 필수 |
정책의 내부 이름입니다. 원하는 경우 |
continueOnError |
거짓 | 선택사항 | 정책이 실패할 경우 오류가 반환되도록 하려면 false로 설정합니다. 이는 대부분의 정책에서 예상되는 동작입니다. 정책이 실패해도 흐름 실행이 계속되도록 하려면 true로 설정합니다. 참조:
|
enabled |
참 | 선택사항 | 정책을 시행하려면 true로 설정합니다. 정책을 중지하려면 false로 설정합니다. 정책이 흐름에 연결되어 있어도 정책이 시행되지 않습니다. |
async |
거짓 | 지원 중단됨 | 이 속성은 지원이 중단되었습니다. |
하위 요소 참조
이 섹션에서는<SetDialogflowResponse>의 하위 요소를 설명합니다.
<DisplayName>
name 속성 외에 이 요소를 사용하여 관리 UI 프록시 편집기에서 자연스러운 다른 이름으로 정책의 라벨을 지정합니다.
<DisplayName> 요소는 모든 정책에 공통으로 적용됩니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 선택사항. <DisplayName>을 생략하면 정책의 name 속성 값이 사용됩니다. |
| 유형 | 문자열 |
| 상위 요소 | <PolicyElement> |
| 하위 요소 | 없음 |
<DisplayName> 요소는 다음 문법을 사용합니다.
구문
<PolicyElement> <DisplayName>POLICY_DISPLAY_NAME</DisplayName> ... </PolicyElement>
예
<PolicyElement> <DisplayName>My Validation Policy</DisplayName> </PolicyElement>
<DisplayName> 요소에 속성 또는 하위 요소가 없습니다.
<Source>
파싱할 변수를 지정합니다. <Source>의 기본값은 message입니다. message 값은 상황에 따라 다릅니다. 요청 흐름에서 message는 요청 메시지로 확인됩니다. 응답 흐름에서 message는 응답 메시지로 확인됩니다.
이 정책을 사용하여 요청 또는 응답 메시지에서 정보를 추출하는 경우가 많지만 모든 변수에서 정보를 추출하는 데 사용할 수 있습니다. 예를 들어 AccessEntity 정책에서 생성된 항목 및 서비스 콜아웃 정책에서 반환한 데이터에서 정보를 추출하거나 XML 또는 JSON 객체에서 정보를 추출하는 데 사용할 수 있습니다.
<Source>를 확인할 수 없거나 메시지가 아닌 유형으로 확인되면 정책이 실패하고 런타임 오류가 발생합니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 선택사항 |
| 유형 | 문자열 |
| 상위 요소 |
<SetDialogflowResponse>
|
| 하위 요소 | 없음 |
<Source> 요소는 다음 문법을 사용합니다.
구문
<Source>MESSAGE_VARIABLE</Source>
예
다음 예시에서는 소스를 myMessageVar로 설정합니다.
<Source>myMessageVar</Source>
<DialogflowVersion>
Dialogflow 버전을 지정합니다. SetDialogflowResponse 정책은 CX 버전만 지원합니다. 정책에서 이 요소를 지정하지 않으면 버전은 기본적으로 CX가 됩니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 선택사항 |
| 유형 | 문자열 |
| 상위 요소 |
<SetDialogflowResponse>
|
| 하위 요소 | 없음 |
<DialogflowVersion> 요소는 다음 문법을 사용합니다.
구문
<DialogflowVersion>DIALOGFLOW_VERSION</DialogflowVersion>
예
다음 예시에서는 DialogflowVersion을 CX로 설정합니다.
<DialogflowVersion>CX</DialogflowVersion>
<IgnoreUnresolvedVariables>
해결되지 않은 변수가 발생하면 처리를 중지할지 여부를 결정합니다.
| 기본값 | 참 |
| 필수 여부 | 선택사항 |
| 유형 | 불리언 |
| 상위 요소 |
<SetDialogflowResponse>
|
| 하위 요소 | 없음 |
확인되지 않은 변수를 무시하고 계속 처리하려면 true로 설정합니다. 그렇지 않으면 false로 설정합니다. 기본값은 true입니다.
<IgnoreUnresolvedVariables>를 true로 설정하는 것은 <SetDialogflowResponse>의 continueOnError를 true로 설정하는 것과 다릅니다. continueOnError를 true로 설정하면 Apigee가 모든 오류를 무시하지만 변수의 오류를 무시하지 않습니다.
<IgnoreUnresolvedVariables> 요소는 다음 문법을 사용합니다.
구문
<IgnoreUnresolvedVariables>[true|false]</IgnoreUnresolvedVariables>
예
다음 예시에서는 <IgnoreUnresolvedVariables>를 false로 설정합니다.
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<MergeBehavior>
응답 메시지의 병합 동작을 정의합니다. 다음 값 중 하나를 지정할 수 있습니다.
APPEND: 사용자에게 전송 대기 중인 메시지 목록에 메시지를 추가합니다.REPLACE: 사용자에게 전송 대기 중인 메시지 목록에서 이전 메시지를 새 메시지로 바꿉니다.
APPEND입니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 선택사항 |
| 유형 | 문자열 |
| 상위 요소 |
<NaturalLanguageResponse>
|
| 하위 요소 | 없음 |
<MergeBehavior> 요소는 다음 문법을 사용합니다.
구문
<MergeBehavior>BEHAVIOR</MergeBehavior>
예
다음 예시에서는 병합 동작을 APPEND로 설정합니다.
<MergeBehavior>APPEND</MergeBehavior>
<NaturalLanguageResponse>
Dialogflow 에이전트로 전송하려는 모든 자연어 응답을 캡슐화합니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 선택사항 |
| 유형 | 복합 객체 |
| 상위 요소 |
<SetDialogflowResponse>
|
| 하위 요소 |
<MergeBehavior><Phrases> |
<Parameters>
웹훅의 응답에 설정할 매개변수 집합을 정의합니다. 매개변수 이름은 <Parameter> 요소의 속성입니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 선택사항 |
| 유형 | 복합 객체 |
| 상위 요소 |
<SetDialogflowResponse>
|
| 하위 요소 |
<Parameter>
|
<Parameter>
웹훅 응답의 sessionInfo.parameters 객체에 설정할 매개변수를 지정합니다.
정적 텍스트를 파라미터 값으로 지정하거나 응답의 다음 필드에서 값을 추출할 수 있습니다.
- 응답 헤더 필드
- JSON 페이로드
- 흐름 변수
추출할 값마다 별도의 <Parameter> 요소를 정의해야 합니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 필수 |
| 유형 | 복합 객체 |
| 상위 요소 |
<Parameters>
|
| 하위 요소 |
<Header><JSONPath><Ref><Value> |
<Parameter> 요소에는 다음과 같은 속성이 있습니다.
| 속성 | 설명 | 필수 여부 | 유형 |
|---|---|---|---|
name |
이 매개변수로 만들 변수의 이름입니다. | 예 | 문자열 |
<Parameter> 요소는 다음 문법을 사용합니다.
구문
<Parameters> <Parameter name="PARAMETER_NAME"> <Header name="HEADER_NAME"/> </Parameter> <Parameter name="PARAMETER_NAME"> <JSONPath>JSON_PATH</JSONPath> </Parameter> <Parameter name="PARAMETER_NAME"> <Ref>EXISTING_FLOW_VARIABLE</Ref> </Parameter> <Parameter name="PARAMETER_NAME"> <Value>CUSTOM_TEXT</Value> </Parameter> </Parameters>
헤더 필드 값 추출
이 예시에서는 timeSpent 매개변수를 X-Time-Spent 헤더 필드의 값으로 설정합니다.
<Parameter name="timeSpent">
<Header name="X-Time-Spent"/>
</Parameter>JSON 경로 값 추출
이 예시에서는 claimAmount 매개변수를 JSON 페이로드의 claim.amount 필드 값으로 설정합니다.
<Parameter name="claimAmount"> <JSONPath>$.claim.amount</JSONPath> </Parameter>
흐름 변수 값 추출
이 예시에서는 myVar 매개변수를 dialogflow.my.var 흐름 변수의 값으로 설정합니다.
<Parameter name="myVar"> <Ref>dialogflow.my.var</Ref> </Parameter>
커스텀 텍스트 설정
이 예시에서는 responder 매개변수의 값을 SYSTEM으로 설정합니다.
<Parameter name="responder"> <Value>SYSTEM</Value> </Parameter>
<Phrases>
<Phrase>의 상위 요소입니다. 웹훅 응답에서 설정할 자연어 문법의 순서가 지정된 목록을 정의합니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 선택사항 |
| 유형 | 복합 객체 |
| 상위 요소 |
<NaturalLanguageResponse>
|
| 하위 요소 |
<Phrase>
|
<Phrase>
웹훅 응답의 fulfillmentResponse.messages 객체에 설정할 문법(텍스트)을 지정합니다.
정적 텍스트를 문법 값으로 지정하거나 응답의 다음 필드에서 값을 추출할 수 있습니다.
- 응답 헤더 필드
- JSON 페이로드
- 흐름 변수
추출할 값마다 별도의 <Phrase> 요소를 정의해야 합니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 필수 |
| 유형 | 복합 객체 |
| 상위 요소 |
<Phrases>
|
| 하위 요소 |
<Header><JSONPath><Ref><Value> |
<Phrase> 요소는 다음 문법을 사용합니다.
구문
<Phrases>
<Phrase>
<Header name="HEADER_NAME"/>
</Phrase>
<Phrase>
<JSONPath>JSON_PATH</JSONPath>
</Phrase>
<Phrase>
<Ref>EXISTING_FLOW_VARIABLE</Ref>
</Phrase>
<Phrase>
<Value>CUSTOM_TEXT</Value>
</Phrase>
</Phrases>헤더 필드 값 추출
이 예시에서는 응답의 자연어 텍스트를 X-Response-Text 헤더 필드의 값으로 설정합니다.
<Phrase>
<Header name="X-Response-Text"/>
</Phrase>JSON 경로 값 추출
이 예시에서는 응답의 자연어 텍스트를 JSON 페이로드의 claim.status.text 필드 값으로 설정합니다.
<Phrase> <JSONPath>$.claim.status.text</JSONPath> </Phrase>
흐름 변수 값 추출
이 예시에서는 응답의 자연어 텍스트를 myVar 흐름 변수의 값으로 설정합니다.
<Phrase>
<Ref>myVar</Ref>
</Phrase>
커스텀 텍스트 설정
이 예시에서는 응답의 자연어 텍스트에 You call is important to us 텍스트를 추가합니다.
<Phrase> <Value>You call is important to us</Value> </Phrase>
<Header>
응답 헤더의 지정된 필드에서 값을 추출합니다. 헤더 값을 사용하여 자연어 텍스트 또는 응답 매개변수를 설정할 수 있습니다.
- 헤더 값을 자연어 응답으로 추출하려면
<Phrase>요소 내에<Header>요소를 지정합니다. - 헤더 값을 응답 매개변수로 추출하려면
<Parameter>요소 내에<Header>요소를 지정합니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 선택사항 |
| 유형 | 문자열 |
| 상위 요소 |
<Phrase><Parameter> |
| 하위 요소 | 없음 |
<Header> 요소는 다음 문법을 사용합니다.
구문
<Header name="HEADER_FIELD"/>
예시 1
다음 예시에서는 X-Response-Text 헤더 필드의 값을 자연어 응답으로 가져옵니다.
<Phrase> <Header name="X-Response-Text"/> <Phrase/>
예시 2
다음 예시에서는 X-Response-Text 헤더 필드의 값을 응답 매개변수로 가져옵니다.
<Parameter name="timeSpent"> <Header name="X-Response-Text"/> <Parameter/>
timeSpent 흐름 변수는 X-Response-Text 헤더 필드의 값으로 설정됩니다.
<Header> 요소에는 다음과 같은 속성이 있습니다.
| 속성 | 설명 | 필수 ? | 유형 |
|---|---|---|---|
| 이름 | 값을 추출할 응답 헤더의 이름을 지정합니다. | 필수 | 문자열 |
<JSONPath>
서비스 콜아웃의 JSON 페이로드에서 JSON 경로 값을 추출합니다. 이 값을 사용하여 자연어 텍스트 또는 응답 매개변수를 설정할 수 있습니다.
- JSON 값을 자연어 텍스트로 추출하려면
<Phrase>요소 내에<JSONPath>요소를 지정합니다. - JSON 값을 응답 매개변수로 추출하려면
<Parameter>요소 내에<JSONPath>요소를 지정합니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 선택사항 |
| 유형 | 문자열 |
| 상위 요소 |
<Phrase><Parameter> |
| 하위 요소 | 없음 |
<JSONPath> 요소는 다음 문법을 사용합니다.
구문
<JSONPath>JSON_PATH</JSONPath>
예시 1
다음 예시에서는 claim.status.text JSON 필드의 값을 자연어 응답으로 가져옵니다.
<Phrase> <JSONPath>$.claim.status.text</JSONPath> <Phrase/>
예시 2
다음 예시에서는 claim.amount JSON 필드의 값을 응답 매개변수로 가져옵니다.
<Parameter name="claimAmount"> <JSONPath>$.claim.amount.</JSONPath> <Parameter/>
claimAmount 흐름 변수는 {claim.amount} JSON 필드의 값으로 설정됩니다.
<Ref>
기존 흐름 변수의 값을 추출합니다. 이 값을 사용하여 자연어 텍스트 또는 응답 매개변수를 설정할 수 있습니다.
- 변수 값을 자연어 텍스트로 추출하려면
<Phrase>요소 내에<Ref>요소를 지정합니다. - 변수의 값을 응답 매개변수로 추출하려면
<Parameter>요소 내에<Ref>요소를 지정합니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 선택사항 |
| 유형 | 문자열 |
| 상위 요소 |
<Phrase><Parameter> |
| 하위 요소 | 없음 |
<Ref> 요소는 다음 문법을 사용합니다.
구문
<Ref>EXISTING_FLOW_VARIABLE</Ref>
예시 1
다음 예시에서는 myVar 흐름 변수의 값을 자연어 응답으로 가져옵니다.
<Phrase> <Ref>myVar</Ref> <Phrase/>
예시 2
다음 예시에서는 dialogflow.my.var 흐름 변수의 값을 응답 매개변수로 가져옵니다.
<Parameter name="customVar"> <Ref>dialogflow.my.var</Ref> <Parameter/>
customVar 흐름 변수는 dialogflow.my.var 변수 값으로 설정됩니다.
<Value>
리터럴 값을 자연어 텍스트 또는 응답 매개변수로 설정합니다.
- 리터럴 값을 자연어 텍스트로 설정하려면
<Phrase>요소 내에<Value>요소를 지정합니다. - 리터럴 값을 응답 매개변수로 설정하려면
<Parameter>요소 내에<Value>요소를 지정합니다.
| 기본값 | 해당 사항 없음 |
| 필수 여부 | 선택사항 |
| 유형 | 문자열 |
| 상위 요소 |
<Phrase><Parameter> |
| 하위 요소 | 없음 |
<Value> 요소는 다음 문법을 사용합니다.
구문
<Value>CUSTOM_TEXT</Value>
예시 1
다음 예시에서는 리터럴 텍스트 You call is important to us를 자연어 응답으로 설정합니다.
<Phrase> <Value>You call is important to us</Value> <Phrase/>
예시 2
다음 예시에서는 리터럴 텍스트 SYSTEM을 응답 매개변수로 설정합니다.
<Parameter name="responder"> <Value>SYSTEM</Value> <Parameter/>
responder 흐름 변수는 SYSTEM으로 설정됩니다.
오류 코드
This section describes the fault codes and error messages that are returned and fault variables that are set by Apigee when this policy triggers an error. This information is important to know if you are developing fault rules to handle faults. To learn more, see What you need to know about policy errors and Handling faults.
Runtime errors
These errors can occur when the policy executes.
| Fault code | HTTP status | Cause |
|---|---|---|
steps.setdialogflowresponse.ExecutionFailed |
500 |
This error occurs when the execution of the policy failed because of a generic exception. The fault message has the details of the exception. |
steps.setdialogflowresponse.InvalidSourceType |
500 |
This error occurs if the variable specified in the <Source> element is not of message type. |
steps.setdialogflowresponse.MalformedInput |
500 |
This error occurs when the JSON provided to this policy is invalid or malformed. |
steps.setdialogflowresponse.SourceMessageNotAvailable |
500 |
This error occurs if the
message
variable specified in the Source element of the policy is either:
|
steps.setdialogflowresponse.UnresolvedHeader |
500 |
This error occurs if the Header element has an invalid header.
For example, if the Header element has the value X-Response-Text,
and there is no X-Response-Text in the response header, you will get this error.
|
steps.setdialogflowresponse.UnresolvedJSONPath |
500 |
This error occurs if the JSONPath element has an invalid path.
For example, if the JSONPath element has the value {claim.status.value},
and there is no status object in the JSON payload, you will get this error. |
steps.setdialogflowresponse.UnresolvedVariable |
500 |
This error occurs if a variable specified in the SetDialogflowResponse policy is either:
|
Deployment errors
These errors can occur when you deploy a proxy containing this policy.
| Error name | Cause |
|---|---|
UnsupportedOperation |
This error occurs if you have specified unsupported Dialogflow version in the
DialogflowVersion element. The SetDialogflowResponse policy supports
only the CX version. |
Fault variables
Whenever there are execution errors in a policy, Apigee generates error messages. You can view these error messages in the error response. Many a time, system generated error messages might not be relevant in the context of your product. You might want to customize the error messages based on the type of error to make the messages more meaningful.
To customize the error messages, you can use either fault rules or the RaiseFault policy. For
information about differences between fault rules and the RaiseFault policy, see
FaultRules vs. the RaiseFault policy.
You must check for conditions using the Condition element in both the fault rules and the RaiseFault policy.
Apigee provides fault variables unique to each policy and the values of the fault variables are set when a policy triggers runtime errors.
By using these variables, you can check for specific error conditions and take appropriate actions. For more information about checking error
conditions, see Building conditions.
The following table describes the fault variables specific to this policy.
| Variables | Where | Example |
|---|---|---|
fault.name="FAULT_NAME" |
FAULT_NAME is the name of the fault, as listed in the Runtime errors table. The fault name is the last part of the fault code. | fault.name Matches "UnresolvedVariable" |
setdialogflowresponse.POLICY_NAME.failed |
POLICY_NAME is the user-specified name of the policy that threw the fault. | setdialogflowresponse.My-Set-Dialogflow-Response.failed = true |
관련 주제
SetDialogflowResponse 정책 사용을 보여주는 Apigee 프록시 및 공유 흐름의 참조 구현은 Apigee GitHub에서 확인할 수 있습니다. 자세한 내용은 대화형 AI 참조 구현을 참조하세요.