스크립트에서 사용자 지정 기술 호출
스크립트를 사용하여 사용자 지정 기술을 호출할 수 있습니다.
시작하기 전에
필요한 역할: 관리자
프로시저
- 다음으로 이동 모두 > 시스템 UI > UI 작업.
-
UI 작업을 생성합니다.
UI 작업 생성에 대한 자세한 내용은 다음 문서를 참조하십시오 Create a UI action.
-
스크립트를 추가합니다.
다음 스크립트는 이에 대한 예시입니다. 변수를 사용자의 데이터로 바꿀 수 있습니다.
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);