기술 세트 업데이트(Azure AI Search REST API)

요청 URI에서 업데이트할 기술 세트 의 이름을 지정하여 HTTP PUT을 사용하여 기존 기술 세트 및 지식 저장소 를 업데이트할 수 있습니다.

PUT https://[servicename].search.windows.net/skillsets/[skillset name]?api-version=[api-version]
  Content-Type: application/json
  api-key: [admin key]

참고

기술 세트는 Azure AI Search에서 AI 보강 의 기초입니다. 제한된 처리를 위해 무료 리소스를 사용할 수 있지만 더 크고 빈번한 워크로드의 경우 청구 가능한 Cognitive Services 리소스가 필요합니다. 자세한 내용은 Azure AI Search 기술 세트에 Cognitive Services 리소스 연결을 참조하세요.

URI 매개 변수

매개 변수 Description
서비스 이름 필수 사항입니다. 검색 서비스의 고유한 사용자 정의 이름으로 설정합니다.
skillset name 필수 사항입니다. 요청 URI는 업데이트할 기술 세트의 이름을 지정합니다.
api-version 필수 사항입니다. 현재 안정적인 버전은 입니다 api-version=2020-06-30. 더 많은 버전은 API 버전을 참조하세요.
disableCacheReprocessingChangeDetection 선택 사항입니다. 증분 보강(false 기본적으로)에 사용됩니다. true 현재 작업을 기반으로 기존 문서에 대한 업데이트를 방지하려면 로 설정합니다. 자세한 내용은 캐시 관리를 참조하세요.

요청 헤더

다음 표에서는 필수 요청 헤더와 선택적 요청 헤더에 대해 설명합니다.

필드 Description
콘텐츠 형식 필수 사항입니다. application/json
api-key Azure 역할을 사용하고 요청에 전달자 토큰이 제공된 경우 선택 사항이며, 그렇지 않으면 키가 필요합니다. api-key는 검색 서비스에 대한 요청을 인증하는 고유한 시스템 생성 문자열입니다. 업데이트 요청에는 쿼리 키가 아닌 관리자 키로 설정된 헤더가 포함되어 api-key 야 합니다. 자세한 내용은 키 인증을 사용하여 Azure AI Search에 연결을 참조하세요.

요청 본문

요청 본문 구문은 기술 세트 만들기와 동일합니다.

기존 기술 세트를 업데이트할 때 전체 정의가 요청 본문의 내용으로 바뀝니다. 일반적으로 업데이트에 사용하는 가장 좋은 패턴은 GET을 사용하여 기술 세트 정의를 검색하고 수정한 다음 PUT으로 업데이트하는 것입니다.

응답

성공적인 요청의 경우, 상태 코드 “201 생성됨”이 표시되어야 합니다.

기본적으로 응답 본문에는 생성된 기능 정의에 대한 JSON이 포함됩니다. 그러나 Prefer 요청 헤더를 return=minimal로 설정하면 응답 본문이 비어 있게 되고, 성공 상태 코드가 “201 생성됨”이 아닌 “204 콘텐츠 없음”으로 표시됩니다. 기능을 만드는 데 사용한 방법(PUT 또는 POST)에 상관없이 결과는 동일합니다.

예제

예: 기술 세트 업데이트

다음 예제에서는 재무 문서 컬렉션을 보강하는 데 사용되는 기술 세트를 업데이트합니다.

PUT https://[servicename].search.windows.net/skillsets/financedocenricher?api-version=2020-06-30
api-key: [admin key]
Content-Type: application/json

요청 본문은 JSON 문서입니다. 이 특정 기술 세트는 의 실체 /document/content 를 두 가지 변환으로 독립적으로 처리하는 두 가지 기술을 비동기적으로 사용합니다. 또는 한 변환의 출력을 다른 변환의 입력으로 지정할 수 있습니다. 자세한 내용은 기능을 정의하는 방법을 참조하세요.

{
  "name": "financedocenricher",
  "description": 
  "An updated version of a skillset used to extract sentiment from financial records, extract company names, and then find additional information about each company mentioned. This version changes the target names.",
  "skills":
  [
    {
      "@odata.type": "#Microsoft.Skills.Text.EntityRecognitionSkill",
      "categories": [ "Organization" ],
      "defaultLanguageCode": "en",
      "inputs": [
        {
          "name": "text",
          "source": "/document/content"
        }
      ],
      "outputs": [
        {
          "name": "organizations",
          "targetName": "companies"
        }
      ]
    },
    {
      "@odata.type": "#Microsoft.Skills.Text.SentimentSkill",
      "inputs": [
        {
          "name": "text",
          "source": "/document/content"
        }
      ],
      "outputs": [
        {
          "name": "score",
          "targetName": "positivityscore"
        }
      ]
    },
  ],
  "cognitiveServices": 
  {
  "@odata.type": "#Microsoft.Azure.Search.CognitiveServicesByKey",
  "description": "mycogsvcs resource in West US 2",
  "key": "<your key goes here>"
  }
}

예: Cognitive Services 키 제거

기존 기술 세트를 업데이트하고 연결된 Cognitive Services 키를 제거하려면 를 로 설정하여 섹션을 @odata.type#Microsoft.Azure.Search.DefaultCognitiveServices수정 cognitiveServices 합니다.

{
  "name": "financedocenricher"
  "skills":
  [
    {
      "@odata.type": "#Microsoft.Skills.Text.EntityRecognitionSkill",
      "categories": [ "Organization" ],
      "defaultLanguageCode": "en",
      "inputs": [
        {
          "name": "text",
          "source": "/document/content"
        }
      ],
      "outputs": [
        {
          "name": "organizations",
          "targetName": "companies"
        }
      ]
    },
  ],
  "cognitiveServices": 
  {
  "@odata.type": "#Microsoft.Azure.Search.DefaultCognitiveServices"
  }
}

추가 정보