스크립트에서 사용자 지정 기술 호출

  • 릴리스 버전: Yokohama
  • 업데이트 날짜 2025년 01월 30일
  • 읽기1분
  • 스크립트를 사용하여 사용자 지정 기술을 호출할 수 있습니다.

    시작하기 전에

    필요한 역할: 관리자

    프로시저

    1. 다음으로 이동 모두 > 시스템 UI > UI 작업.
    2. UI 작업을 생성합니다.
      UI 동작 생성에 대한 자세한 내용은 다음 문서를 참조하십시오 Create a UI action.
    3. 스크립트를 추가합니다.

      다음 스크립트는 예시입니다. 변수를 데이터로 바꿀 수 있습니다.

      var inputsPayload = {};
      
      // create the payload to deliver input data to the skill
      
      inputsPayload[‘input name’] = {
      
        tableName: 'table name',
      
        sysId: 'sys_id',
      
        queryString: ''
      
      };
      
      
      //create the request by combining the capability sys ID and the skill config sys ID
      
      var request = {
      
          executionRequests: [{
      
              payload: inputsPayload,
      
              capabilityId: ‘capability sys id’,
      
              meta: {
      
                  skillConfigId: ‘skill config sys id’
      
              }
      
          }],
      
          mode: 'sync'
      
      };
      
      
      //run the custom skill and get the output in a string format
      try {
      var output = sn_one_extend.OneExtendUtil.execute(request)['capabilities'][request.executionRequests[0].capabilityId]['response'];
      var LLMOutput = JSON.parse(output).model_output;
      } catch(e) {
       gs.error(e);
       gs.addErrorMessage('Something went wrong while executing the skill.');
      }
      action.setRedirectURL(current);