๋งž์ถค ์ถ”์ฒœ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ๋งŒ๋“ค๊ธฐ

๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ค๊ณ  ๋งž์ถค ์ถ”์ฒœ์„ ์œ„ํ•ด ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•˜๋ ค๋ฉด ์‚ฌ์šฉํ•˜๋ ค๋Š” ์†Œ์Šค์˜ ์„น์…˜์œผ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

BigQuery

BigQuery ํ…Œ์ด๋ธ”์—์„œ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“œ๋Š” ๋ฐฉ๋ฒ•์€ ๋‘ ๊ฐ€์ง€์ž…๋‹ˆ๋‹ค.

  • ์ผํšŒ์„ฑ ์ˆ˜์ง‘: BigQuery ํ…Œ์ด๋ธ”์—์„œ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค. ์ˆ˜๋™์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ƒˆ๋กœ๊ณ ์นจํ•˜์ง€ ์•Š๋Š” ํ•œ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ๋ฐ์ดํ„ฐ๊ฐ€ ๋ณ€๊ฒฝ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

  • ์ฃผ๊ธฐ์  ์ˆ˜์ง‘: ํ•˜๋‚˜ ์ด์ƒ์˜ BigQuery ํ…Œ์ด๋ธ”์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๊ณ  ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๊ฐ€ BigQuery ๋ฐ์ดํ„ฐ ์„ธํŠธ์˜ ์ตœ์‹  ๋ฐ์ดํ„ฐ๋กœ ์—…๋ฐ์ดํŠธ๋˜๋Š” ๋นˆ๋„๋ฅผ ๊ฒฐ์ •ํ•˜๋Š” ๋™๊ธฐํ™” ๋นˆ๋„๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ ํ‘œ์—์„œ๋Š” BigQuery ๋ฐ์ดํ„ฐ๋ฅผ Vertex AI Search ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋กœ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๋Š” ๋‘ ๊ฐ€์ง€ ๋ฐฉ๋ฒ•์„ ๋น„๊ตํ•ฉ๋‹ˆ๋‹ค.

์ผํšŒ์„ฑ ์ˆ˜์ง‘ ์ฃผ๊ธฐ์  ์ˆ˜์ง‘
์ •์‹ ๋ฒ„์ „ (GA) ๊ณต๊ฐœ ๋ฏธ๋ฆฌ๋ณด๊ธฐ
๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜๋™์œผ๋กœ ์ƒˆ๋กœ๊ณ ์นจํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ๊ฐ€ 1์ผ, 3์ผ ๋˜๋Š” 5์ผ๋งˆ๋‹ค ์ž๋™์œผ๋กœ ์—…๋ฐ์ดํŠธ๋ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜๋™์œผ๋กœ ์ƒˆ๋กœ๊ณ ์นจํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.
Vertex AI Search๊ฐ€ BigQuery์˜ ํ•œ ํ…Œ์ด๋ธ”์—์„œ ๋‹จ์ผ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค. Vertex AI Search๊ฐ€ BigQuery ๋ฐ์ดํ„ฐ ์„ธํŠธ์˜ ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ์™€ ์ง€์ •๋œ ๊ฐ ํ…Œ์ด๋ธ”์˜ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด(ํ•ญ๋ชฉ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ผ๊ณ  ํ•จ)๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค. ๊ฐ ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ๋Š” ํ…Œ์ด๋ธ”์˜ ๋ฐ์ดํ„ฐ ์œ ํ˜•(์˜ˆ: ๊ตฌ์กฐํ™”๋œ ๋ฐ์ดํ„ฐ)์ด ๋™์ผํ•ด์•ผ ํ•˜๋ฉฐ ๋™์ผํ•œ BigQuery ๋ฐ์ดํ„ฐ ์„ธํŠธ์— ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
๋จผ์ € ํ•œ ํ…Œ์ด๋ธ”์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•œ ๋‹ค์Œ ๋‹ค๋ฅธ ์†Œ์Šค ๋˜๋Š” BigQuery ํ…Œ์ด๋ธ”์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ถ”๊ฐ€๋กœ ์ˆ˜์ง‘ํ•˜์—ฌ ์—ฌ๋Ÿฌ ํ…Œ์ด๋ธ”์˜ ๋ฐ์ดํ„ฐ๋ฅผ ํ•˜๋‚˜์˜ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์— ๊ฒฐํ•ฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ˆ˜๋™ ๋ฐ์ดํ„ฐ ๊ฐ€์ ธ์˜ค๊ธฐ๋Š” ์ง€์›๋˜์ง€ ์•Š์œผ๋ฏ€๋กœ ํ•ญ๋ชฉ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ๋ฐ์ดํ„ฐ๋ฅผ ํ•œ BigQuery ํ…Œ์ด๋ธ”์—์„œ๋งŒ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
๋ฐ์ดํ„ฐ ์†Œ์Šค ์•ก์„ธ์Šค ์ œ์–ด๊ฐ€ ์ง€์›๋ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ์†Œ์Šค ์•ก์„ธ์Šค ์ œ์–ด๋Š” ์ง€์›๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๊ฐ€์ ธ์˜จ ๋ฐ์ดํ„ฐ์— ์•ก์„ธ์Šค ์ œ์–ด๊ฐ€ ํฌํ•จ๋  ์ˆ˜ ์žˆ์ง€๋งŒ ์ด๋Ÿฌํ•œ ์ œ์–ด๊ฐ€ ์ ์šฉ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
Google Cloud ์ฝ˜์†” ๋˜๋Š” API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ์™€ ํ•ด๋‹น ํ•ญ๋ชฉ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ค๋ ค๋ฉด ์ฝ˜์†”์„ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
CMEK ์ค€์ˆ˜ CMEK ์ค€์ˆ˜

BigQuery์—์„œ ํ•œ ๋ฒˆ ๊ฐ€์ ธ์˜ค๊ธฐ

BigQuery ํ…Œ์ด๋ธ”์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•˜๋ ค๋ฉด ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ๋”ฐ๋ผ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ค๊ณ  Google Cloud ์ฝ˜์†” ๋˜๋Š” API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•ฉ๋‹ˆ๋‹ค.

๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๊ธฐ ์ „์— ์ˆ˜์ง‘ํ•  ๋ฐ์ดํ„ฐ ์ค€๋น„๋ฅผ ๊ฒ€ํ† ํ•˜์„ธ์š”.

์ฝ˜์†”

Google Cloud ์ฝ˜์†”์„ ์‚ฌ์šฉํ•˜์—ฌ BigQuery์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•˜๋ ค๋ฉด ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ๋”ฐ๋ฅด์„ธ์š”.

  1. Google Cloud ์ฝ˜์†”์—์„œ AI ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

    AI ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜

  2. ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

  3. ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ๋งŒ๋“ค๊ธฐ๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  4. ์†Œ์Šค ํŽ˜์ด์ง€์—์„œ BigQuery๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  5. ์–ด๋–ค ์ข…๋ฅ˜์˜ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค์‹œ๊ฒ ์–ด์š”? ์„น์…˜์—์„œ ๊ฐ€์ ธ์˜ฌ ๋ฐ์ดํ„ฐ ์œ ํ˜•์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  6. ๋™๊ธฐํ™” ๋นˆ๋„ ์„น์…˜์—์„œ ์ผํšŒ์„ฑ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  7. BigQuery ๊ฒฝ๋กœ ํ•„๋“œ์—์„œ ์ฐพ์•„๋ณด๊ธฐ๋ฅผ ํด๋ฆญํ•˜๊ณ  ์ˆ˜์ง‘์„ ์œ„ํ•ด ์ค€๋น„ํ•œ ํ…Œ์ด๋ธ”์„ ์„ ํƒํ•œ ๋‹ค์Œ ์„ ํƒ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค. ๋˜๋Š” BigQuery ๊ฒฝ๋กœ ํ•„๋“œ์— ํ…Œ์ด๋ธ” ์œ„์น˜๋ฅผ ์ง์ ‘ ์ž…๋ ฅํ•ด๋„ ๋ฉ๋‹ˆ๋‹ค.

  8. ๊ณ„์†์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  9. ๊ตฌ์กฐํ™”๋œ ๋ฐ์ดํ„ฐ๋ฅผ ์ผํšŒ์„ฑ์œผ๋กœ ๊ฐ€์ ธ์˜ค๋Š” ๊ฒฝ์šฐ:

    1. ํ•„๋“œ๋ฅผ ํ‚ค ์†์„ฑ์— ๋งคํ•‘ํ•ฉ๋‹ˆ๋‹ค.

    2. ์Šคํ‚ค๋งˆ์—์„œ ์ค‘์š”ํ•œ ํ•„๋“œ๊ฐ€ ๋ˆ„๋ฝ๋œ ๊ฒฝ์šฐ ์ƒˆ ํ•„๋“œ ์ถ”๊ฐ€๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ•„๋“œ๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

      ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์ž๋™ ๊ฐ์ง€ ๋ฐ ์ˆ˜์ • ์ •๋ณด๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

    3. ๊ณ„์†์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  10. ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ๋ฆฌ์ „์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  11. ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ์ด๋ฆ„์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

  12. ๋งŒ๋“ค๊ธฐ๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  13. ์ˆ˜์ง‘ ์ƒํƒœ๋ฅผ ํ™•์ธํ•˜๋ ค๋ฉด ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ์ด๋ฆ„์„ ํด๋ฆญํ•œ ํ›„ ๋ฐ์ดํ„ฐ ํŽ˜์ด์ง€์—์„œ ์„ธ๋ถ€์ •๋ณด๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ํ™œ๋™ ํƒญ์˜ ์ƒํƒœ ์—ด์ด ์ง„ํ–‰ ์ค‘์—์„œ ๊ฐ€์ ธ์˜ค๊ธฐ ์™„๋ฃŒ๋จ์œผ๋กœ ๋ณ€๊ฒฝ๋˜๋ฉด ์ˆ˜์ง‘์ด ์™„๋ฃŒ๋œ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

    ๋ฐ์ดํ„ฐ ํฌ๊ธฐ์— ๋”ฐ๋ผ ์ˆ˜์ง‘์— ๋ช‡ ๋ถ„๋ถ€ํ„ฐ ๋ช‡ ์‹œ๊ฐ„๊นŒ์ง€ ๊ฑธ๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

REST

๋ช…๋ น์ค„์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ค๊ณ  BigQuery์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๋ ค๋ฉด ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ๋”ฐ๋ฅด์„ธ์š”.

  1. ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

    curl -X POST \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "Content-Type: application/json" \
    -H "X-Goog-User-Project: PROJECT_ID" \
    "https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores?dataStoreId=DATA_STORE_ID" \
    -d '{
      "displayName": "DATA_STORE_DISPLAY_NAME",
      "industryVertical": "GENERIC",
      "solutionTypes": ["SOLUTION_TYPE_RECOMMENDATION"]
    }'
    

    ๋‹ค์Œ์„ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค.

    • PROJECT_ID: Google Cloud ํ”„๋กœ์ ํŠธ์˜ ID์ž…๋‹ˆ๋‹ค.
    • DATA_STORE_ID: ๋งŒ๋“ค๋ ค๋Š” Vertex AI Search ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ID์ž…๋‹ˆ๋‹ค. ์ด ID๋Š” ์†Œ๋ฌธ์ž, ์ˆซ์ž, ๋ฐ‘์ค„, ํ•˜์ดํ”ˆ๋งŒ ํฌํ•จํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    • DATA_STORE_DISPLAY_NAME: ๋งŒ๋“ค๋ ค๋Š” Vertex AI Search ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ํ‘œ์‹œ ์ด๋ฆ„์ž…๋‹ˆ๋‹ค.
  2. BigQuery์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.

    ์Šคํ‚ค๋งˆ๋ฅผ ์ •์˜ํ•œ ๊ฒฝ์šฐ ๋ฐ์ดํ„ฐ๊ฐ€ ํ•ด๋‹น ์Šคํ‚ค๋งˆ๋ฅผ ์ค€์ˆ˜ํ•˜๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

    curl -X POST \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "Content-Type: application/json" \
    "https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/documents:import" \
    -d '{
      "bigquerySource": {
        "projectId": "PROJECT_ID",
        "datasetId":"DATASET_ID",
        "tableId": "TABLE_ID",
        "dataSchema": "DATA_SCHEMA",
        "aclEnabled": "BOOLEAN"
      },
      "reconciliationMode": "RECONCILIATION_MODE",
      "autoGenerateIds": "AUTO_GENERATE_IDS",
      "idField": "ID_FIELD",
      "errorConfig": {
        "gcsPrefix": "ERROR_DIRECTORY"
      }
    }'
    

    ๋‹ค์Œ์„ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค.

    • PROJECT_ID: Google Cloud ํ”„๋กœ์ ํŠธ์˜ ID์ž…๋‹ˆ๋‹ค.
    • DATA_STORE_ID: Vertex AI Search ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ID์ž…๋‹ˆ๋‹ค.
    • DATASET_ID: BigQuery ๋ฐ์ดํ„ฐ ์„ธํŠธ์˜ ID์ž…๋‹ˆ๋‹ค.
    • TABLE_ID: BigQuery ํ…Œ์ด๋ธ”์˜ ID์ž…๋‹ˆ๋‹ค.
      • BigQuery ํ…Œ์ด๋ธ”์ด PROJECT_ID์— ์—†์œผ๋ฉด ์„œ๋น„์Šค ๊ณ„์ • service-<project number>@gcp-sa-discoveryengine.iam.gserviceaccount.com์— BigQuery ํ…Œ์ด๋ธ”์— ๋Œ€ํ•œ "BigQuery ๋ฐ์ดํ„ฐ ๋ทฐ์–ด" ๊ถŒํ•œ์„ ๋ถ€์—ฌํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด '123' ์†Œ์Šค ํ”„๋กœ์ ํŠธ์—์„œ '456' ๋Œ€์ƒ ํ”„๋กœ์ ํŠธ๋กœ BigQuery ํ…Œ์ด๋ธ”์„ ๊ฐ€์ ธ์˜ค๋Š” ๊ฒฝ์šฐ '123' ํ”„๋กœ์ ํŠธ์˜ BigQuery ํ…Œ์ด๋ธ”์— ๋Œ€ํ•œ service-456@gcp-sa-discoveryengine.iam.gserviceaccount.com ๊ถŒํ•œ์„ ๋ถ€์—ฌํ•ฉ๋‹ˆ๋‹ค.
    • DATA_SCHEMA: ์„ ํƒ์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค. ๊ฐ’์€ document ๋ฐ custom์ž…๋‹ˆ๋‹ค. ๊ธฐ๋ณธ๊ฐ’์€ document์ž…๋‹ˆ๋‹ค.
      • document: ์‚ฌ์šฉํ•˜๋Š” BigQuery ํ…Œ์ด๋ธ”์ด ์ˆ˜์ง‘์„ ์œ„ํ•œ ๋ฐ์ดํ„ฐ ์ค€๋น„์— ์ œ๊ณต๋œ ๊ธฐ๋ณธ BigQuery ์Šคํ‚ค๋งˆ๋ฅผ ์ค€์ˆ˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ๋ฌธ์„œ์˜ ID๋ฅผ ์ •์˜ํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ๋ชจ๋“  ๋ฐ์ดํ„ฐ๊ฐ€ jsonData ๋ฌธ์ž์—ด์— ํฌํ•จ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
      • custom: ๋ชจ๋“  BigQuery ํ…Œ์ด๋ธ” ์Šคํ‚ค๋งˆ๊ฐ€ ํ—ˆ์šฉ๋˜๋ฉฐ Vertex AI Search๊ฐ€ ๊ฐ€์ ธ์˜จ ๊ฐ ๋ฌธ์„œ์˜ ID๋ฅผ ์ž๋™์œผ๋กœ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
    • ERROR_DIRECTORY: ์„ ํƒ์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค. ๊ฐ€์ ธ์˜ค๊ธฐ์— ๋Œ€ํ•œ ์˜ค๋ฅ˜ ์ •๋ณด๋ฅผ ๋ณผ ์ˆ˜ ์žˆ๋Š” Cloud Storage ๋””๋ ‰ํ„ฐ๋ฆฌ์ž…๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด gs://<your-gcs-bucket>/directory/import_errors์ž…๋‹ˆ๋‹ค. Vertex AI Search๊ฐ€ ์ž„์‹œ ๋””๋ ‰ํ„ฐ๋ฆฌ๋ฅผ ์ž๋™์œผ๋กœ ๋งŒ๋“ค๋„๋ก ํ•˜๋ ค๋ฉด ์ด ํ•„๋“œ๋ฅผ ๋น„์›Œ ๋‘๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.
    • RECONCILIATION_MODE: ์„ ํƒ์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค. ๊ฐ’์€ FULL ๋ฐ INCREMENTAL์ž…๋‹ˆ๋‹ค. ๊ธฐ๋ณธ๊ฐ’์€ INCREMENTAL์ž…๋‹ˆ๋‹ค. INCREMENTAL์„ ์ง€์ •ํ•˜๋ฉด BigQuery์˜ ๋ฐ์ดํ„ฐ๊ฐ€ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์— ์ ์ง„์ ์œผ๋กœ ์ƒˆ๋กœ๊ณ ์นจ๋ฉ๋‹ˆ๋‹ค. ์ด ๊ฒฝ์šฐ ์ƒˆ ๋ฌธ์„œ๋ฅผ ์ถ”๊ฐ€ํ•˜๊ณ  ๊ธฐ์กด ๋ฌธ์„œ๋ฅผ ๋™์ผํ•œ ID์˜ ์—…๋ฐ์ดํŠธ๋œ ๋ฌธ์„œ๋กœ ๋Œ€์ฒดํ•˜๋Š” ์‚ฝ์ž…/์—…๋ฐ์ดํŠธ(upsert) ์ž‘์—…์ด ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. FULL์„ ์ง€์ •ํ•˜๋ฉด ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์—์„œ ๋ฌธ์„œ์˜ ์ „์ฒด ์žฌ๋ฐฐ์น˜๊ฐ€ ์ด๋ฃจ์–ด์ง‘๋‹ˆ๋‹ค. ์ฆ‰, ์ƒˆ ๋ฌธ์„œ์™€ ์—…๋ฐ์ดํŠธ๋œ ๋ฌธ์„œ๋Š” ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์— ์ถ”๊ฐ€๋˜๊ณ  BigQuery์— ์—†๋Š” ๋ฌธ์„œ๋Š” ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์—์„œ ์‚ญ์ œ๋ฉ๋‹ˆ๋‹ค. FULL ๋ชจ๋“œ๋Š” ๋” ์ด์ƒ ํ•„์š”ํ•˜์ง€ ์•Š์€ ๋ฌธ์„œ๋ฅผ ์ž๋™์œผ๋กœ ์‚ญ์ œํ•˜๋ ค๋Š” ๊ฒฝ์šฐ์— ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค.
    • AUTO_GENERATE_IDS: ์„ ํƒ์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค. ๋ฌธ์„œ ID๋ฅผ ์ž๋™์œผ๋กœ ์ƒ์„ฑํ• ์ง€ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. true๋กœ ์„ค์ •ํ•˜๋ฉด ํŽ˜์ด๋กœ๋“œ์˜ ํ•ด์‹œ์— ๋”ฐ๋ผ ๋ฌธ์„œ ID๊ฐ€ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค. ์ƒ์„ฑ๋œ ๋ฌธ์„œ ID๋Š” ์—ฌ๋Ÿฌ ๊ฐ€์ ธ์˜ค๊ธฐ์—์„œ ์ผ๊ด€๋˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์—ฌ๋Ÿฌ ๊ฐ€์ ธ์˜ค๊ธฐ์—์„œ ID๋ฅผ ์ž๋™์œผ๋กœ ์ƒ์„ฑํ•˜๋Š” ๊ฒฝ์šฐ ๋ฌธ์„œ ID์˜ ์ผ๊ด€์„ฑ์„ ์œ ์ง€ํ•˜๊ธฐ ์œ„ํ•ด reconciliationMode๋ฅผ FULL๋กœ ์„ค์ •ํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

      bigquerySource.dataSchema๊ฐ€ custom์œผ๋กœ ์„ค์ •๋œ ๊ฒฝ์šฐ์—๋งŒ autoGenerateIds๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด INVALID_ARGUMENT ์˜ค๋ฅ˜๊ฐ€ ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค. autoGenerateIds๋ฅผ ์ง€์ •ํ•˜์ง€ ์•Š๊ฑฐ๋‚˜ false๋กœ ์„ค์ •ํ•œ ๊ฒฝ์šฐ idField๋ฅผ ์ง€์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ๋ฌธ์„œ๋ฅผ ๊ฐ€์ ธ์˜ค์ง€ ๋ชปํ•ฉ๋‹ˆ๋‹ค.

    • ID_FIELD: ์„ ํƒ์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค. ๋ฌธ์„œ ID์ธ ํ•„๋“œ๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. BigQuery ์†Œ์Šค ํŒŒ์ผ์˜ ๊ฒฝ์šฐ idField๋Š” ๋ฌธ์„œ ID๊ฐ€ ํฌํ•จ๋œ BigQuery ํ…Œ์ด๋ธ”์˜ ์—ด ์ด๋ฆ„์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.

      (1) bigquerySource.dataSchema๊ฐ€ custom์œผ๋กœ ์„ค์ •๋˜๊ณ  (2) auto_generate_ids๊ฐ€ false๋กœ ์„ค์ •๋˜์—ˆ๊ฑฐ๋‚˜ ์ง€์ •๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ์—๋งŒ idField๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด INVALID_ARGUMENT ์˜ค๋ฅ˜๊ฐ€ ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค.

      BigQuery ์—ด ์ด๋ฆ„์˜ ๊ฐ’์€ ๋ฌธ์ž์—ด ์œ ํ˜•์ด๊ณ  1~63์ž(์˜๋ฌธ ๊ธฐ์ค€)์—ฌ์•ผ ํ•˜๋ฉฐ RFC-1034๋ฅผ ์ค€์ˆ˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ๋ฌธ์„œ๋ฅผ ๊ฐ€์ ธ์˜ค์ง€ ๋ชปํ•ฉ๋‹ˆ๋‹ค.

C#

์ž์„ธํ•œ ๋‚ด์šฉ์€ AI Applications C# API ์ฐธ๊ณ  ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

AI Applications์— ์ธ์ฆํ•˜๋ ค๋ฉด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ธฐ๋ณธ ์‚ฌ์šฉ์ž ์ธ์ฆ ์ •๋ณด๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋กœ์ปฌ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์˜ ์ธ์ฆ ์„ค์ •์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ๋งŒ๋“ค๊ธฐ

using Google.Cloud.DiscoveryEngine.V1;
using Google.LongRunning;

public sealed partial class GeneratedDataStoreServiceClientSnippets
{
    /// <summary>Snippet for CreateDataStore</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void CreateDataStoreRequestObject()
    {
        // Create client
        DataStoreServiceClient dataStoreServiceClient = DataStoreServiceClient.Create();
        // Initialize request argument(s)
        CreateDataStoreRequest request = new CreateDataStoreRequest
        {
            ParentAsCollectionName = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]"),
            DataStore = new DataStore(),
            DataStoreId = "",
            CreateAdvancedSiteSearch = false,
            CmekConfigNameAsCmekConfigName = CmekConfigName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
            SkipDefaultSchemaCreation = false,
        };
        // Make the request
        Operation<DataStore, CreateDataStoreMetadata> response = dataStoreServiceClient.CreateDataStore(request);

        // Poll until the returned long-running operation is complete
        Operation<DataStore, CreateDataStoreMetadata> completedResponse = response.PollUntilCompleted();
        // Retrieve the operation result
        DataStore result = completedResponse.Result;

        // Or get the name of the operation
        string operationName = response.Name;
        // This name can be stored, then the long-running operation retrieved later by name
        Operation<DataStore, CreateDataStoreMetadata> retrievedResponse = dataStoreServiceClient.PollOnceCreateDataStore(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            DataStore retrievedResult = retrievedResponse.Result;
        }
    }
}

๋ฌธ์„œ ๊ฐ€์ ธ์˜ค๊ธฐ

using Google.Cloud.DiscoveryEngine.V1;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;

public sealed partial class GeneratedDocumentServiceClientSnippets
{
    /// <summary>Snippet for ImportDocuments</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void ImportDocumentsRequestObject()
    {
        // Create client
        DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
        // Initialize request argument(s)
        ImportDocumentsRequest request = new ImportDocumentsRequest
        {
            ParentAsBranchName = BranchName.FromProjectLocationDataStoreBranch("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]"),
            InlineSource = new ImportDocumentsRequest.Types.InlineSource(),
            ErrorConfig = new ImportErrorConfig(),
            ReconciliationMode = ImportDocumentsRequest.Types.ReconciliationMode.Unspecified,
            UpdateMask = new FieldMask(),
            AutoGenerateIds = false,
            IdField = "",
            ForceRefreshContent = false,
        };
        // Make the request
        Operation<ImportDocumentsResponse, ImportDocumentsMetadata> response = documentServiceClient.ImportDocuments(request);

        // Poll until the returned long-running operation is complete
        Operation<ImportDocumentsResponse, ImportDocumentsMetadata> completedResponse = response.PollUntilCompleted();
        // Retrieve the operation result
        ImportDocumentsResponse result = completedResponse.Result;

        // Or get the name of the operation
        string operationName = response.Name;
        // This name can be stored, then the long-running operation retrieved later by name
        Operation<ImportDocumentsResponse, ImportDocumentsMetadata> retrievedResponse = documentServiceClient.PollOnceImportDocuments(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            ImportDocumentsResponse retrievedResult = retrievedResponse.Result;
        }
    }
}

Go

์ž์„ธํ•œ ๋‚ด์šฉ์€ AI Applications Go API ์ฐธ๊ณ  ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

AI Applications์— ์ธ์ฆํ•˜๋ ค๋ฉด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ธฐ๋ณธ ์‚ฌ์šฉ์ž ์ธ์ฆ ์ •๋ณด๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋กœ์ปฌ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์˜ ์ธ์ฆ ์„ค์ •์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ๋งŒ๋“ค๊ธฐ


package main

import (
	"context"

	discoveryengine "cloud.google.com/go/discoveryengine/apiv1"
	discoveryenginepb "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := discoveryengine.NewDataStoreClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &discoveryenginepb.CreateDataStoreRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#CreateDataStoreRequest.
	}
	op, err := c.CreateDataStore(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

๋ฌธ์„œ ๊ฐ€์ ธ์˜ค๊ธฐ


package main

import (
	"context"

	discoveryengine "cloud.google.com/go/discoveryengine/apiv1"
	discoveryenginepb "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := discoveryengine.NewDocumentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &discoveryenginepb.ImportDocumentsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ImportDocumentsRequest.
	}
	op, err := c.ImportDocuments(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Java

์ž์„ธํ•œ ๋‚ด์šฉ์€ AI Applications Java API ์ฐธ๊ณ  ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

AI Applications์— ์ธ์ฆํ•˜๋ ค๋ฉด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ธฐ๋ณธ ์‚ฌ์šฉ์ž ์ธ์ฆ ์ •๋ณด๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋กœ์ปฌ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์˜ ์ธ์ฆ ์„ค์ •์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ๋งŒ๋“ค๊ธฐ

import com.google.cloud.discoveryengine.v1.CollectionName;
import com.google.cloud.discoveryengine.v1.CreateDataStoreRequest;
import com.google.cloud.discoveryengine.v1.DataStore;
import com.google.cloud.discoveryengine.v1.DataStoreServiceClient;

public class SyncCreateDataStore {

  public static void main(String[] args) throws Exception {
    syncCreateDataStore();
  }

  public static void syncCreateDataStore() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (DataStoreServiceClient dataStoreServiceClient = DataStoreServiceClient.create()) {
      CreateDataStoreRequest request =
          CreateDataStoreRequest.newBuilder()
              .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
              .setDataStore(DataStore.newBuilder().build())
              .setDataStoreId("dataStoreId929489618")
              .setCreateAdvancedSiteSearch(true)
              .setSkipDefaultSchemaCreation(true)
              .build();
      DataStore response = dataStoreServiceClient.createDataStoreAsync(request).get();
    }
  }
}

๋ฌธ์„œ ๊ฐ€์ ธ์˜ค๊ธฐ

import com.google.cloud.discoveryengine.v1.BranchName;
import com.google.cloud.discoveryengine.v1.DocumentServiceClient;
import com.google.cloud.discoveryengine.v1.ImportDocumentsRequest;
import com.google.cloud.discoveryengine.v1.ImportDocumentsResponse;
import com.google.cloud.discoveryengine.v1.ImportErrorConfig;
import com.google.protobuf.FieldMask;

public class SyncImportDocuments {

  public static void main(String[] args) throws Exception {
    syncImportDocuments();
  }

  public static void syncImportDocuments() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
      ImportDocumentsRequest request =
          ImportDocumentsRequest.newBuilder()
              .setParent(
                  BranchName.ofProjectLocationDataStoreBranchName(
                          "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
                      .toString())
              .setErrorConfig(ImportErrorConfig.newBuilder().build())
              .setUpdateMask(FieldMask.newBuilder().build())
              .setAutoGenerateIds(true)
              .setIdField("idField1629396127")
              .setForceRefreshContent(true)
              .build();
      ImportDocumentsResponse response = documentServiceClient.importDocumentsAsync(request).get();
    }
  }
}

Node.js

์ž์„ธํ•œ ๋‚ด์šฉ์€ AI Applications Node.js API ์ฐธ๊ณ  ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

AI Applications์— ์ธ์ฆํ•˜๋ ค๋ฉด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ธฐ๋ณธ ์‚ฌ์šฉ์ž ์ธ์ฆ ์ •๋ณด๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋กœ์ปฌ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์˜ ์ธ์ฆ ์„ค์ •์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ๋งŒ๋“ค๊ธฐ

/**
 * This snippet has been automatically generated and should be regarded as a code template only.
 * It will require modifications to work.
 * It may require correct/in-range values for request initialization.
 * TODO(developer): Uncomment these variables before running the sample.
 */
/**
 *  Resource name of the CmekConfig to use for protecting this DataStore.
 */
// const cmekConfigName = 'abc123'
/**
 *  DataStore without CMEK protections. If a default CmekConfig is set for
 *  the project, setting this field will override the default CmekConfig as
 *  well.
 */
// const disableCmek = true
/**
 *  Required. The parent resource name, such as
 *  `projects/{project}/locations/{location}/collections/{collection}`.
 */
// const parent = 'abc123'
/**
 *  Required. The DataStore google.cloud.discoveryengine.v1.DataStore  to
 *  create.
 */
// const dataStore = {}
/**
 *  Required. The ID to use for the
 *  DataStore google.cloud.discoveryengine.v1.DataStore, which will become
 *  the final component of the
 *  DataStore google.cloud.discoveryengine.v1.DataStore's resource name.
 *  This field must conform to RFC-1034 (https://tools.ietf.org/html/rfc1034)
 *  standard with a length limit of 63 characters. Otherwise, an
 *  INVALID_ARGUMENT error is returned.
 */
// const dataStoreId = 'abc123'
/**
 *  A boolean flag indicating whether user want to directly create an advanced
 *  data store for site search.
 *  If the data store is not configured as site
 *  search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will
 *  be ignored.
 */
// const createAdvancedSiteSearch = true
/**
 *  A boolean flag indicating whether to skip the default schema creation for
 *  the data store. Only enable this flag if you are certain that the default
 *  schema is incompatible with your use case.
 *  If set to true, you must manually create a schema for the data store before
 *  any documents can be ingested.
 *  This flag cannot be specified if `data_store.starting_schema` is specified.
 */
// const skipDefaultSchemaCreation = true

// Imports the Discoveryengine library
const {DataStoreServiceClient} = require('@google-cloud/discoveryengine').v1;

// Instantiates a client
const discoveryengineClient = new DataStoreServiceClient();

async function callCreateDataStore() {
  // Construct request
  const request = {
    parent,
    dataStore,
    dataStoreId,
  };

  // Run request
  const [operation] = await discoveryengineClient.createDataStore(request);
  const [response] = await operation.promise();
  console.log(response);
}

callCreateDataStore();

๋ฌธ์„œ ๊ฐ€์ ธ์˜ค๊ธฐ

/**
 * This snippet has been automatically generated and should be regarded as a code template only.
 * It will require modifications to work.
 * It may require correct/in-range values for request initialization.
 * TODO(developer): Uncomment these variables before running the sample.
 */
/**
 *  The Inline source for the input content for documents.
 */
// const inlineSource = {}
/**
 *  Cloud Storage location for the input content.
 */
// const gcsSource = {}
/**
 *  BigQuery input source.
 */
// const bigquerySource = {}
/**
 *  FhirStore input source.
 */
// const fhirStoreSource = {}
/**
 *  Spanner input source.
 */
// const spannerSource = {}
/**
 *  Cloud SQL input source.
 */
// const cloudSqlSource = {}
/**
 *  Firestore input source.
 */
// const firestoreSource = {}
/**
 *  AlloyDB input source.
 */
// const alloyDbSource = {}
/**
 *  Cloud Bigtable input source.
 */
// const bigtableSource = {}
/**
 *  Required. The parent branch resource name, such as
 *  `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
 *  Requires create/update permission.
 */
// const parent = 'abc123'
/**
 *  The desired location of errors incurred during the Import.
 */
// const errorConfig = {}
/**
 *  The mode of reconciliation between existing documents and the documents to
 *  be imported. Defaults to
 *  ReconciliationMode.INCREMENTAL google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL.
 */
// const reconciliationMode = {}
/**
 *  Indicates which fields in the provided imported documents to update. If
 *  not set, the default is to update all fields.
 */
// const updateMask = {}
/**
 *  Whether to automatically generate IDs for the documents if absent.
 *  If set to `true`,
 *  Document.id google.cloud.discoveryengine.v1.Document.id s are
 *  automatically generated based on the hash of the payload, where IDs may not
 *  be consistent during multiple imports. In which case
 *  ReconciliationMode.FULL google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.FULL 
 *  is highly recommended to avoid duplicate contents. If unset or set to
 *  `false`, Document.id google.cloud.discoveryengine.v1.Document.id s have
 *  to be specified using
 *  id_field google.cloud.discoveryengine.v1.ImportDocumentsRequest.id_field,
 *  otherwise, documents without IDs fail to be imported.
 *  Supported data sources:
 *  * GcsSource google.cloud.discoveryengine.v1.GcsSource.
 *  GcsSource.data_schema google.cloud.discoveryengine.v1.GcsSource.data_schema 
 *  must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
 *  * BigQuerySource google.cloud.discoveryengine.v1.BigQuerySource.
 *  BigQuerySource.data_schema google.cloud.discoveryengine.v1.BigQuerySource.data_schema 
 *  must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
 *  * SpannerSource google.cloud.discoveryengine.v1.SpannerSource.
 *  * CloudSqlSource google.cloud.discoveryengine.v1.CloudSqlSource.
 *  * FirestoreSource google.cloud.discoveryengine.v1.FirestoreSource.
 *  * BigtableSource google.cloud.discoveryengine.v1.BigtableSource.
 */
// const autoGenerateIds = true
/**
 *  The field indicates the ID field or column to be used as unique IDs of
 *  the documents.
 *  For GcsSource google.cloud.discoveryengine.v1.GcsSource  it is the key of
 *  the JSON field. For instance, `my_id` for JSON `{"my_id": "some_uuid"}`.
 *  For others, it may be the column name of the table where the unique ids are
 *  stored.
 *  The values of the JSON field or the table column are used as the
 *  Document.id google.cloud.discoveryengine.v1.Document.id s. The JSON field
 *  or the table column must be of string type, and the values must be set as
 *  valid strings conform to RFC-1034 (https://tools.ietf.org/html/rfc1034)
 *  with 1-63 characters. Otherwise, documents without valid IDs fail to be
 *  imported.
 *  Only set this field when
 *  auto_generate_ids google.cloud.discoveryengine.v1.ImportDocumentsRequest.auto_generate_ids 
 *  is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.
 *  If it is unset, a default value `_id` is used when importing from the
 *  allowed data sources.
 *  Supported data sources:
 *  * GcsSource google.cloud.discoveryengine.v1.GcsSource.
 *  GcsSource.data_schema google.cloud.discoveryengine.v1.GcsSource.data_schema 
 *  must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
 *  * BigQuerySource google.cloud.discoveryengine.v1.BigQuerySource.
 *  BigQuerySource.data_schema google.cloud.discoveryengine.v1.BigQuerySource.data_schema 
 *  must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
 *  * SpannerSource google.cloud.discoveryengine.v1.SpannerSource.
 *  * CloudSqlSource google.cloud.discoveryengine.v1.CloudSqlSource.
 *  * FirestoreSource google.cloud.discoveryengine.v1.FirestoreSource.
 *  * BigtableSource google.cloud.discoveryengine.v1.BigtableSource.
 */
// const idField = 'abc123'
/**
 *  Optional. Whether to force refresh the unstructured content of the
 *  documents.
 *  If set to `true`, the content part of the documents will be refreshed
 *  regardless of the update status of the referencing content.
 */
// const forceRefreshContent = true

// Imports the Discoveryengine library
const {DocumentServiceClient} = require('@google-cloud/discoveryengine').v1;

// Instantiates a client
const discoveryengineClient = new DocumentServiceClient();

async function callImportDocuments() {
  // Construct request
  const request = {
    parent,
  };

  // Run request
  const [operation] = await discoveryengineClient.importDocuments(request);
  const [response] = await operation.promise();
  console.log(response);
}

callImportDocuments();

Python

์ž์„ธํ•œ ๋‚ด์šฉ์€ AI Applications Python API ์ฐธ๊ณ  ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

AI Applications์— ์ธ์ฆํ•˜๋ ค๋ฉด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ธฐ๋ณธ ์‚ฌ์šฉ์ž ์ธ์ฆ ์ •๋ณด๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋กœ์ปฌ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์˜ ์ธ์ฆ ์„ค์ •์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ๋งŒ๋“ค๊ธฐ


from google.api_core.client_options import ClientOptions
from google.cloud import discoveryengine

# TODO(developer): Uncomment these variables before running the sample.
# project_id = "YOUR_PROJECT_ID"
# location = "YOUR_LOCATION" # Values: "global"
# data_store_id = "YOUR_DATA_STORE_ID"


def create_data_store_sample(
    project_id: str,
    location: str,
    data_store_id: str,
) -> str:
    #  For more information, refer to:
    # https://cloud.google.com/generative-ai-app-builder/docs/locations#specify_a_multi-region_for_your_data_store
    client_options = (
        ClientOptions(api_endpoint=f"{location}-discoveryengine.googleapis.com")
        if location != "global"
        else None
    )

    # Create a client
    client = discoveryengine.DataStoreServiceClient(client_options=client_options)

    # The full resource name of the collection
    # e.g. projects/{project}/locations/{location}/collections/default_collection
    parent = client.collection_path(
        project=project_id,
        location=location,
        collection="default_collection",
    )

    data_store = discoveryengine.DataStore(
        display_name="My Data Store",
        # Options: GENERIC, MEDIA, HEALTHCARE_FHIR
        industry_vertical=discoveryengine.IndustryVertical.GENERIC,
        # Options: SOLUTION_TYPE_RECOMMENDATION, SOLUTION_TYPE_SEARCH, SOLUTION_TYPE_CHAT, SOLUTION_TYPE_GENERATIVE_CHAT
        solution_types=[discoveryengine.SolutionType.SOLUTION_TYPE_SEARCH],
        # TODO(developer): Update content_config based on data store type.
        # Options: NO_CONTENT, CONTENT_REQUIRED, PUBLIC_WEBSITE
        content_config=discoveryengine.DataStore.ContentConfig.CONTENT_REQUIRED,
    )

    request = discoveryengine.CreateDataStoreRequest(
        parent=parent,
        data_store_id=data_store_id,
        data_store=data_store,
        # Optional: For Advanced Site Search Only
        # create_advanced_site_search=True,
    )

    # Make the request
    operation = client.create_data_store(request=request)

    print(f"Waiting for operation to complete: {operation.operation.name}")
    response = operation.result()

    # After the operation is complete,
    # get information from operation metadata
    metadata = discoveryengine.CreateDataStoreMetadata(operation.metadata)

    # Handle the response
    print(response)
    print(metadata)

    return operation.operation.name

๋ฌธ์„œ ๊ฐ€์ ธ์˜ค๊ธฐ


from google.api_core.client_options import ClientOptions
from google.cloud import discoveryengine

# TODO(developer): Uncomment these variables before running the sample.
# project_id = "YOUR_PROJECT_ID"
# location = "YOUR_LOCATION" # Values: "global"
# data_store_id = "YOUR_DATA_STORE_ID"
# bigquery_dataset = "YOUR_BIGQUERY_DATASET"
# bigquery_table = "YOUR_BIGQUERY_TABLE"

#  For more information, refer to:
# https://cloud.google.com/generative-ai-app-builder/docs/locations#specify_a_multi-region_for_your_data_store
client_options = (
    ClientOptions(api_endpoint=f"{location}-discoveryengine.googleapis.com")
    if location != "global"
    else None
)

# Create a client
client = discoveryengine.DocumentServiceClient(client_options=client_options)

# The full resource name of the search engine branch.
# e.g. projects/{project}/locations/{location}/dataStores/{data_store_id}/branches/{branch}
parent = client.branch_path(
    project=project_id,
    location=location,
    data_store=data_store_id,
    branch="default_branch",
)

request = discoveryengine.ImportDocumentsRequest(
    parent=parent,
    bigquery_source=discoveryengine.BigQuerySource(
        project_id=project_id,
        dataset_id=bigquery_dataset,
        table_id=bigquery_table,
        data_schema="custom",
    ),
    # Options: `FULL`, `INCREMENTAL`
    reconciliation_mode=discoveryengine.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL,
)

# Make the request
operation = client.import_documents(request=request)

print(f"Waiting for operation to complete: {operation.operation.name}")
response = operation.result()

# After the operation is complete,
# get information from operation metadata
metadata = discoveryengine.ImportDocumentsMetadata(operation.metadata)

# Handle the response
print(response)
print(metadata)

Ruby

์ž์„ธํ•œ ๋‚ด์šฉ์€ AI Applications Ruby API ์ฐธ๊ณ  ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

AI Applications์— ์ธ์ฆํ•˜๋ ค๋ฉด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ธฐ๋ณธ ์‚ฌ์šฉ์ž ์ธ์ฆ ์ •๋ณด๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋กœ์ปฌ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์˜ ์ธ์ฆ ์„ค์ •์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ๋งŒ๋“ค๊ธฐ

require "google/cloud/discovery_engine/v1"

##
# Snippet for the create_data_store call in the DataStoreService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#create_data_store.
#
def create_data_store
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest.new

  # Call the create_data_store method.
  result = client.create_data_store request

  # The returned object is of type Gapic::Operation. You can use it to
  # check the status of an operation, cancel it, or wait for results.
  # Here is how to wait for a response.
  result.wait_until_done! timeout: 60
  if result.response?
    p result.response
  else
    puts "No response received."
  end
end

๋ฌธ์„œ ๊ฐ€์ ธ์˜ค๊ธฐ

require "google/cloud/discovery_engine/v1"

##
# Snippet for the import_documents call in the DocumentService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#import_documents.
#
def import_documents
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new

  # Call the import_documents method.
  result = client.import_documents request

  # The returned object is of type Gapic::Operation. You can use it to
  # check the status of an operation, cancel it, or wait for results.
  # Here is how to wait for a response.
  result.wait_until_done! timeout: 60
  if result.response?
    p result.response
  else
    puts "No response received."
  end
end

์ฃผ๊ธฐ์  ๋™๊ธฐํ™”๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ BigQuery์— ์—ฐ๊ฒฐ

๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๊ธฐ ์ „์— ์ˆ˜์ง‘ํ•  ๋ฐ์ดํ„ฐ ์ค€๋น„๋ฅผ ๊ฒ€ํ† ํ•˜์„ธ์š”.

๋‹ค์Œ ์ ˆ์ฐจ์—์„œ๋Š” BigQuery ๋ฐ์ดํ„ฐ ์„ธํŠธ๋ฅผ Vertex AI Search ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ์™€ ์—ฐ๊ฒฐํ•˜๋Š” ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ๋ฅผ ๋งŒ๋“œ๋Š” ๋ฐฉ๋ฒ•๊ณผ ๋งŒ๋“ค๋ ค๋Š” ๊ฐ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ๋ฐ์ดํ„ฐ ์„ธํŠธ์— ํ…Œ์ด๋ธ”์„ ์ง€์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ์˜ ํ•˜์œ„ ์š”์†Œ์ธ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ํ•ญ๋ชฉ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

๋ฐ์ดํ„ฐ ์„ธํŠธ์˜ ๋ฐ์ดํ„ฐ๋Š” ์ฃผ๊ธฐ์ ์œผ๋กœ ํ•ญ๋ชฉ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์— ๋™๊ธฐํ™”๋ฉ๋‹ˆ๋‹ค. ๋งค์ผ, 3์ผ๋งˆ๋‹ค ๋˜๋Š” 5์ผ๋งˆ๋‹ค ๋™๊ธฐํ™”๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ฝ˜์†”

Google Cloud ์ฝ˜์†”์„ ์‚ฌ์šฉํ•˜์—ฌ BigQuery ๋ฐ์ดํ„ฐ ์„ธํŠธ์˜ ๋ฐ์ดํ„ฐ๋ฅผ Vertex AI Search์— ์ฃผ๊ธฐ์ ์œผ๋กœ ๋™๊ธฐํ™”ํ•˜๋Š” ์ปค๋„ฅํ„ฐ๋ฅผ ๋งŒ๋“ค๋ ค๋ฉด ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ๋”ฐ๋ฅด์„ธ์š”.

  1. Google Cloud ์ฝ˜์†”์—์„œ AI ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

    AI ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜

  2. ํƒ์ƒ‰ ๋ฉ”๋‰ด์—์„œ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  3. ๋ฐ์ดํ„ฐ ์ €์žฅ์†Œ ๋งŒ๋“ค๊ธฐ๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  4. ์†Œ์Šค ํŽ˜์ด์ง€์—์„œ BigQuery๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  5. ๊ฐ€์ ธ์˜ฌ ๋ฐ์ดํ„ฐ์˜ ์ข…๋ฅ˜๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  6. ์ฃผ๊ธฐ์ ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  7. ๋™๊ธฐํ™” ๋นˆ๋„๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. Vertex AI Search ์ปค๋„ฅํ„ฐ๊ฐ€ BigQuery ๋ฐ์ดํ„ฐ ์„ธํŠธ์™€ ๋™๊ธฐํ™”๋˜๋Š” ๋นˆ๋„์ž…๋‹ˆ๋‹ค. ๋นˆ๋„๋Š” ๋‚˜์ค‘์— ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  8. BigQuery ๋ฐ์ดํ„ฐ ์„ธํŠธ ๊ฒฝ๋กœ ํ•„๋“œ์—์„œ ์ฐพ์•„๋ณด๊ธฐ๋ฅผ ํด๋ฆญํ•˜๊ณ  ์ˆ˜์ง‘์„ ์œ„ํ•ด ์ค€๋น„ํ•œ ํ…Œ์ด๋ธ”์ด ํฌํ•จ๋œ ๋ฐ์ดํ„ฐ ์„ธํŠธ๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. ๋˜๋Š” BigQuery ๊ฒฝ๋กœ ํ•„๋“œ์— ํ…Œ์ด๋ธ” ์œ„์น˜๋ฅผ ์ง์ ‘ ์ž…๋ ฅํ•ด๋„ ๋ฉ๋‹ˆ๋‹ค. ๊ฒฝ๋กœ์˜ ํ˜•์‹์€ projectname.datasetname์ž…๋‹ˆ๋‹ค.

  9. ๋™๊ธฐํ™”ํ•  ํ…Œ์ด๋ธ” ํ•„๋“œ์—์„œ ์ฐพ์•„๋ณด๊ธฐ๋ฅผ ํด๋ฆญํ•œ ๋‹ค์Œ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์— ์ €์žฅํ•  ๋ฐ์ดํ„ฐ๊ฐ€ ํฌํ•จ๋œ ํ…Œ์ด๋ธ”์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  10. ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์— ์‚ฌ์šฉํ•  ์ถ”๊ฐ€ ํ…Œ์ด๋ธ”์ด ๋ฐ์ดํ„ฐ ์„ธํŠธ์— ์žˆ๋Š” ๊ฒฝ์šฐ ํ…Œ์ด๋ธ” ์ถ”๊ฐ€๋ฅผ ํด๋ฆญํ•˜๊ณ  ํ•ด๋‹น ํ…Œ์ด๋ธ”๋„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.

  11. ๊ณ„์†์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  12. ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ๋ฆฌ์ „์„ ์„ ํƒํ•˜๊ณ  ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ์˜ ์ด๋ฆ„์„ ์ž…๋ ฅํ•œ ํ›„ ๋งŒ๋“ค๊ธฐ๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

    ๋ฐ์ดํ„ฐ๋ฅผ BigQuery ๋ฐ์ดํ„ฐ ์„ธํŠธ์™€ ์ฃผ๊ธฐ์ ์œผ๋กœ ๋™๊ธฐํ™”ํ•˜๋Š” ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ๋ฅผ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. ํ•˜๋‚˜ ์ด์ƒ์˜ ํ•ญ๋ชฉ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋„ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ์ด๋ฆ„์€ BigQuery ํ…Œ์ด๋ธ”๊ณผ ๋™์ผํ•ฉ๋‹ˆ๋‹ค.

  13. ์ˆ˜์ง‘ ์ƒํƒœ๋ฅผ ํ™•์ธํ•˜๋ ค๋ฉด ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ ์ด๋ฆ„์„ ํด๋ฆญํ•œ ํ›„ ๋ฐ์ดํ„ฐ ํŽ˜์ด์ง€ > ๋ฐ์ดํ„ฐ ์ˆ˜์ง‘ ํ™œ๋™ ํƒญ์—์„œ ์„ธ๋ถ€์ •๋ณด๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ํ™œ๋™ ํƒญ์˜ ์ƒํƒœ ์—ด์ด ์ง„ํ–‰ ์ค‘์—์„œ ์„ฑ๊ณต์œผ๋กœ ๋ณ€๊ฒฝ๋˜๋ฉด ์ฒซ ๋ฒˆ์งธ ์ˆ˜์ง‘์ด ์™„๋ฃŒ๋œ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

    ๋ฐ์ดํ„ฐ ํฌ๊ธฐ์— ๋”ฐ๋ผ ์ˆ˜์ง‘์— ๋ช‡ ๋ถ„๋ถ€ํ„ฐ ๋ช‡ ์‹œ๊ฐ„๊นŒ์ง€ ๊ฑธ๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋ฐ์ดํ„ฐ ์†Œ์Šค๋ฅผ ์„ค์ •ํ•˜๊ณ  ๋ฐ์ดํ„ฐ๋ฅผ ์ฒ˜์Œ ๊ฐ€์ ธ์˜จ ํ›„์—๋Š” ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๊ฐ€ ์„ค์ • ์ค‘์— ์„ ํƒํ•œ ๋นˆ๋„๋กœ ํ•ด๋‹น ์†Œ์Šค์˜ ๋ฐ์ดํ„ฐ๋ฅผ ๋™๊ธฐํ™”ํ•ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ๊ฐ€ ์ƒ์„ฑ๋œ ํ›„ ์•ฝ 1์‹œ๊ฐ„ ํ›„์— ์ฒซ ๋ฒˆ์งธ ๋™๊ธฐํ™”๊ฐ€ ์ด๋ฃจ์–ด์ง‘๋‹ˆ๋‹ค. ์ดํ›„ ๋‹ค์Œ ๋™๊ธฐํ™”๊ฐ€ ์•ฝ 24์‹œ๊ฐ„, 72์‹œ๊ฐ„ ๋˜๋Š” 120์‹œ๊ฐ„ ํ›„์— ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ ๋‹จ๊ณ„

  • ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ์•ฑ์— ์—ฐ๊ฒฐํ•˜๋ ค๋ฉด ์•ฑ์„ ๋งŒ๋“ค๊ณ  ๋งž์ถค ์ถ”์ฒœ ์•ฑ ๋งŒ๋“ค๊ธฐ์˜ ๋‹จ๊ณ„๋ฅผ ๋”ฐ๋ผ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  • ์•ฑ๊ณผ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ์„ค์ •ํ•œ ํ›„ ์ถ”์ฒœ์„ ๋ฏธ๋ฆฌ ๋ณด๊ฑฐ๋‚˜ ๊ฐ€์ ธ์˜ค๋ ค๋ฉด ์ถ”์ฒœ ๊ฐ€์ ธ์˜ค๊ธฐ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

Cloud Storage

๋‹ค์Œ ๋‘ ๊ฐ€์ง€ ๋ฐฉ๋ฒ•์œผ๋กœ Cloud Storage ํ…Œ์ด๋ธ”์—์„œ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ์ผํšŒ์„ฑ ์ˆ˜์ง‘: Cloud Storage ํด๋” ๋˜๋Š” ํŒŒ์ผ์—์„œ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค. ์ˆ˜๋™์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ƒˆ๋กœ๊ณ ์นจํ•˜์ง€ ์•Š๋Š” ํ•œ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ๋ฐ์ดํ„ฐ๊ฐ€ ๋ณ€๊ฒฝ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

  • ์ฃผ๊ธฐ์  ์ˆ˜์ง‘: Cloud Storage ํด๋” ๋˜๋Š” ํŒŒ์ผ์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๊ณ  ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๊ฐ€ ํ•ด๋‹น Cloud Storage ์œ„์น˜์˜ ์ตœ์‹  ๋ฐ์ดํ„ฐ๋กœ ์—…๋ฐ์ดํŠธ๋˜๋Š” ๋นˆ๋„๋ฅผ ๊ฒฐ์ •ํ•˜๋Š” ๋™๊ธฐํ™” ๋นˆ๋„๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ ํ‘œ์—์„œ๋Š” Cloud Storage ๋ฐ์ดํ„ฐ๋ฅผ Vertex AI Search ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋กœ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๋Š” ๋‘ ๊ฐ€์ง€ ๋ฐฉ๋ฒ•์„ ๋น„๊ตํ•ฉ๋‹ˆ๋‹ค.

์ผํšŒ์„ฑ ์ˆ˜์ง‘ ์ฃผ๊ธฐ์  ์ˆ˜์ง‘
์ •์‹ ๋ฒ„์ „ (GA) ๊ณต๊ฐœ ๋ฏธ๋ฆฌ๋ณด๊ธฐ
๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜๋™์œผ๋กœ ์ƒˆ๋กœ๊ณ ์นจํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ๊ฐ€ 1์ผ, 3์ผ ๋˜๋Š” 5์ผ๋งˆ๋‹ค ์ž๋™์œผ๋กœ ์—…๋ฐ์ดํŠธ๋ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜๋™์œผ๋กœ ์ƒˆ๋กœ๊ณ ์นจํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.
Vertex AI Search๊ฐ€ Cloud Storage์˜ ํ•œ ํด๋” ๋˜๋Š” ํŒŒ์ผ์—์„œ ๋‹จ์ผ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค. Vertex AI Search๊ฐ€ ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ๋ฅผ ๋งŒ๋“ค๊ณ  ์ง€์ •๋œ ํŒŒ์ผ ๋˜๋Š” ํด๋”์˜ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด(ํ•ญ๋ชฉ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ผ๊ณ  ํ•จ)๋ฅผ ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค. ๊ฐ Cloud Storage ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ๋Š” ๋‹จ์ผ ํ•ญ๋ชฉ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
๋จผ์ € ํ•œ Cloud Storage ์œ„์น˜์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•œ ๋‹ค์Œ ๋‹ค๋ฅธ ์œ„์น˜์—์„œ ๋” ๋งŽ์€ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•˜์—ฌ ์—ฌ๋Ÿฌ ํŒŒ์ผ, ํด๋”, ๋ฒ„ํ‚ท์˜ ๋ฐ์ดํ„ฐ๋ฅผ ํ•˜๋‚˜์˜ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์— ๊ฒฐํ•ฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ˆ˜๋™ ๋ฐ์ดํ„ฐ ๊ฐ€์ ธ์˜ค๊ธฐ๋Š” ์ง€์›๋˜์ง€ ์•Š์œผ๋ฏ€๋กœ ํ•ญ๋ชฉ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ๋ฐ์ดํ„ฐ๋Š” ํ•œ Cloud Storage ํŒŒ์ผ ๋˜๋Š” ํด๋”์—์„œ๋งŒ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
๋ฐ์ดํ„ฐ ์†Œ์Šค ์•ก์„ธ์Šค ์ œ์–ด๊ฐ€ ์ง€์›๋ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋ฐ์ดํ„ฐ ์†Œ์Šค ์•ก์„ธ์Šค ์ œ์–ด๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”. ๋ฐ์ดํ„ฐ ์†Œ์Šค ์•ก์„ธ์Šค ์ œ์–ด๋Š” ์ง€์›๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๊ฐ€์ ธ์˜จ ๋ฐ์ดํ„ฐ์— ์•ก์„ธ์Šค ์ œ์–ด๊ฐ€ ํฌํ•จ๋  ์ˆ˜ ์žˆ์ง€๋งŒ ์ด๋Ÿฌํ•œ ์ œ์–ด๊ฐ€ ์ ์šฉ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
Google Cloud ์ฝ˜์†” ๋˜๋Š” API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ์™€ ํ•ด๋‹น ํ•ญ๋ชฉ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ค๋ ค๋ฉด ์ฝ˜์†”์„ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
CMEK ์ค€์ˆ˜ CMEK ์ค€์ˆ˜

Cloud Storage์—์„œ ํ•œ ๋ฒˆ ๊ฐ€์ ธ์˜ค๊ธฐ

Cloud Storage์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•˜๋ ค๋ฉด ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ๋”ฐ๋ผ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ค๊ณ  Google Cloud ์ฝ˜์†” ๋˜๋Š” API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•ฉ๋‹ˆ๋‹ค.

๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๊ธฐ ์ „์— ์ˆ˜์ง‘ํ•  ๋ฐ์ดํ„ฐ ์ค€๋น„๋ฅผ ๊ฒ€ํ† ํ•˜์„ธ์š”.

์ฝ˜์†”

์ฝ˜์†”์„ ์‚ฌ์šฉํ•˜์—ฌ Cloud Storage ๋ฒ„ํ‚ท์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•˜๋ ค๋ฉด ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

  1. Google Cloud ์ฝ˜์†”์—์„œ AI ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

    AI ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜

  2. ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

  3. ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ๋งŒ๋“ค๊ธฐ๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  4. ์†Œ์Šค ํŽ˜์ด์ง€์—์„œ Cloud Storage๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  5. ๊ฐ€์ ธ์˜ฌ ํด๋” ๋˜๋Š” ํŒŒ์ผ ์„ ํƒ ์„น์…˜์—์„œ ํด๋” ๋˜๋Š” ํŒŒ์ผ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  6. ์ฐพ์•„๋ณด๊ธฐ๋ฅผ ํด๋ฆญํ•˜๊ณ  ์ˆ˜์ง‘์„ ์œ„ํ•ด ์ค€๋น„ํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ์„ ํƒํ•œ ๋‹ค์Œ ์„ ํƒ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค. ๋˜๋Š” gs:// ํ•„๋“œ์— ์œ„์น˜๋ฅผ ์ง์ ‘ ์ž…๋ ฅํ•ด๋„ ๋ฉ๋‹ˆ๋‹ค.

  7. ๊ฐ€์ ธ์˜ฌ ๋ฐ์ดํ„ฐ์˜ ์œ ํ˜•์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  8. ๊ณ„์†์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  9. ๊ตฌ์กฐํ™”๋œ ๋ฐ์ดํ„ฐ๋ฅผ ์ผํšŒ์„ฑ์œผ๋กœ ๊ฐ€์ ธ์˜ค๋Š” ๊ฒฝ์šฐ:

    1. ํ•„๋“œ๋ฅผ ํ‚ค ์†์„ฑ์— ๋งคํ•‘ํ•ฉ๋‹ˆ๋‹ค.

    2. ์Šคํ‚ค๋งˆ์—์„œ ์ค‘์š”ํ•œ ํ•„๋“œ๊ฐ€ ๋ˆ„๋ฝ๋œ ๊ฒฝ์šฐ ์ƒˆ ํ•„๋“œ ์ถ”๊ฐ€๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ•„๋“œ๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

      ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์ž๋™ ๊ฐ์ง€ ๋ฐ ์ˆ˜์ • ์ •๋ณด๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

    3. ๊ณ„์†์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  10. ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ๋ฆฌ์ „์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  11. ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ์ด๋ฆ„์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

  12. ์„ ํƒ์‚ฌํ•ญ: ๊ตฌ์กฐํ™”๋˜์ง€ ์•Š์€ ๋ฌธ์„œ๋ฅผ ์„ ํƒํ•œ ๊ฒฝ์šฐ ๋ฌธ์„œ์˜ ํŒŒ์‹ฑ ๋ฐ ์ฒญํฌ ์ฒ˜๋ฆฌ ์˜ต์…˜์„ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํŒŒ์„œ๋ฅผ ๋น„๊ตํ•˜๋ ค๋ฉด ๋ฌธ์„œ ํŒŒ์‹ฑ์„ ์ฐธ๊ณ ํ•˜์„ธ์š”. ์ฒญํฌ ์ฒ˜๋ฆฌ์— ๊ด€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ RAG์šฉ ๋ฌธ์„œ ์ฒญํฌ ์ฒ˜๋ฆฌ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

    OCR ํŒŒ์„œ ๋ฐ ๋ ˆ์ด์•„์›ƒ ํŒŒ์„œ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ถ”๊ฐ€ ๋น„์šฉ์ด ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. Document AI ๊ธฐ๋Šฅ ๊ฐ€๊ฒฉ ์ฑ…์ •์„ ์ฐธ๊ณ ํ•˜์„ธ์š”.

    ํŒŒ์„œ๋ฅผ ์„ ํƒํ•˜๋ ค๋ฉด ๋ฌธ์„œ ์ฒ˜๋ฆฌ ์˜ต์…˜์„ ํŽผ์น˜๊ณ  ์‚ฌ์šฉํ•  ํŒŒ์„œ ์˜ต์…˜์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.

  13. ๋งŒ๋“ค๊ธฐ๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  14. ์ˆ˜์ง‘ ์ƒํƒœ๋ฅผ ํ™•์ธํ•˜๋ ค๋ฉด ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ์ด๋ฆ„์„ ํด๋ฆญํ•œ ํ›„ ๋ฐ์ดํ„ฐ ํŽ˜์ด์ง€์—์„œ ์„ธ๋ถ€์ •๋ณด๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ํ™œ๋™ ํƒญ์˜ ์ƒํƒœ ์—ด์ด ์ง„ํ–‰ ์ค‘์—์„œ ๊ฐ€์ ธ์˜ค๊ธฐ ์™„๋ฃŒ๋จ์œผ๋กœ ๋ณ€๊ฒฝ๋˜๋ฉด ์ˆ˜์ง‘์ด ์™„๋ฃŒ๋œ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

    ๋ฐ์ดํ„ฐ ํฌ๊ธฐ์— ๋”ฐ๋ผ ์ˆ˜์ง‘์— ๋ช‡ ๋ถ„ ๋˜๋Š” ๋ช‡ ์‹œ๊ฐ„๊นŒ์ง€ ๊ฑธ๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

REST

๋ช…๋ น์ค„์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ค๊ณ  Cloud Storage์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•˜๋ ค๋ฉด ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ๋”ฐ๋ฅด์„ธ์š”.

  1. ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

    curl -X POST \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "Content-Type: application/json" \
    -H "X-Goog-User-Project: PROJECT_ID" \
    "https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores?dataStoreId=DATA_STORE_ID" \
    -d '{
      "displayName": "DATA_STORE_DISPLAY_NAME",
      "industryVertical": "GENERIC",
      "solutionTypes": ["SOLUTION_TYPE_RECOMMENDATION"]
    }'
    

    ๋‹ค์Œ์„ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค.

    • PROJECT_ID: Google Cloud ํ”„๋กœ์ ํŠธ์˜ ID์ž…๋‹ˆ๋‹ค.
    • DATA_STORE_ID: ๋งŒ๋“ค๋ ค๋Š” Vertex AI Search ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ID์ž…๋‹ˆ๋‹ค. ์ด ID๋Š” ์†Œ๋ฌธ์ž, ์ˆซ์ž, ๋ฐ‘์ค„, ํ•˜์ดํ”ˆ๋งŒ ํฌํ•จํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    • DATA_STORE_DISPLAY_NAME: ๋งŒ๋“ค๋ ค๋Š” Vertex AI Search ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ํ‘œ์‹œ ์ด๋ฆ„์ž…๋‹ˆ๋‹ค.
  2. Cloud Storage์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.

      curl -X POST \
      -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      -H "Content-Type: application/json" \
      "https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/documents:import" \
      -d '{
        "gcsSource": {
          "inputUris": ["INPUT_FILE_PATTERN_1", "INPUT_FILE_PATTERN_2"],
          "dataSchema": "DATA_SCHEMA",
        },
        "reconciliationMode": "RECONCILIATION_MODE",
        "autoGenerateIds": "AUTO_GENERATE_IDS",
        "idField": "ID_FIELD",
        "errorConfig": {
          "gcsPrefix": "ERROR_DIRECTORY"
        }
      }'
    

    ๋‹ค์Œ์„ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค.

    • PROJECT_ID: Google Cloud ํ”„๋กœ์ ํŠธ์˜ ID์ž…๋‹ˆ๋‹ค.
    • DATA_STORE_ID: Vertex AI Search ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ID์ž…๋‹ˆ๋‹ค.
    • INPUT_FILE_PATTERN: ๋ฌธ์„œ๊ฐ€ ํฌํ•จ๋œ Cloud Storage์˜ ํŒŒ์ผ ํŒจํ„ด์ž…๋‹ˆ๋‹ค.

      ์ •ํ˜• ๋ฐ์ดํ„ฐ ๋˜๋Š” ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๊ฐ€ ์žˆ๋Š” ๋น„์ •ํ˜• ๋ฐ์ดํ„ฐ์˜ ๊ฒฝ์šฐ ์ž…๋ ฅ ํŒŒ์ผ ํŒจํ„ด์˜ ์˜ˆ๋Š” gs://<your-gcs-bucket>/directory/object.json์ด๊ณ  ํ•˜๋‚˜ ์ด์ƒ์˜ ํŒŒ์ผ์„ ์ผ์น˜์‹œํ‚ค๋Š” ํŒจํ„ด์˜ ์˜ˆ๋Š” gs://<your-gcs-bucket>/directory/*.json์ž…๋‹ˆ๋‹ค.

      ๋น„์ •ํ˜• ๋ฌธ์„œ์˜ ๊ฒฝ์šฐ ์˜ˆ์‹œ๋Š” gs://<your-gcs-bucket>/directory/*.pdf์ž…๋‹ˆ๋‹ค. ํŒจํ„ด๊ณผ ์ผ์น˜ํ•˜๋Š” ๊ฐ ํŒŒ์ผ์€ ๋ฌธ์„œ๊ฐ€ ๋ฉ๋‹ˆ๋‹ค.

      <your-gcs-bucket>์ด PROJECT_ID์— ์žˆ์ง€ ์•Š์œผ๋ฉด ์„œ๋น„์Šค ๊ณ„์ • service-<project number>@gcp-sa-discoveryengine.iam.gserviceaccount.com์— Cloud Storage ๋ฒ„ํ‚ท์— ๋Œ€ํ•œ '์Šคํ† ๋ฆฌ์ง€ ๊ฐ์ฒด ๋ทฐ์–ด' ๊ถŒํ•œ์„ ๋ถ€์—ฌํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด '123' ์†Œ์Šค ํ”„๋กœ์ ํŠธ์—์„œ '456' ๋Œ€์ƒ ํ”„๋กœ์ ํŠธ๋กœ Cloud Storage ๋ฒ„ํ‚ท์„ ๊ฐ€์ ธ์˜ค๋Š” ๊ฒฝ์šฐ '123' ํ”„๋กœ์ ํŠธ์˜ Cloud Storage ๋ฒ„ํ‚ท์— ๋Œ€ํ•œ service-456@gcp-sa-discoveryengine.iam.gserviceaccount.com ๊ถŒํ•œ์„ ๋ถ€์—ฌํ•ฉ๋‹ˆ๋‹ค.

    • DATA_SCHEMA: ์„ ํƒ์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค. ๊ฐ’์€ document, custom, csv, content์ž…๋‹ˆ๋‹ค. ๊ธฐ๋ณธ๊ฐ’์€ document์ž…๋‹ˆ๋‹ค.

      • document: ๋น„์ •ํ˜• ๋ฌธ์„œ์˜ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ์™€ ํ•จ๊ป˜ ๊ตฌ์กฐํ™”๋˜์ง€ ์•Š์€ ๋ฐ์ดํ„ฐ๋ฅผ ์—…๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค. ํŒŒ์ผ์˜ ๊ฐ ์ค„์€ ๋‹ค์Œ ํ˜•์‹ ์ค‘ ํ•˜๋‚˜๋ฅผ ๋”ฐ๋ผ์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ๋ฌธ์„œ์˜ ID๋ฅผ ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

        • { "id": "<your-id>", "jsonData": "<JSON string>", "content": { "mimeType": "<application/pdf or text/html>", "uri": "gs://<your-gcs-bucket>/directory/filename.pdf" } }
        • { "id": "<your-id>", "structData": <JSON object>, "content": { "mimeType": "<application/pdf or text/html>", "uri": "gs://<your-gcs-bucket>/directory/filename.pdf" } }
      • custom: ์ •ํ˜• ๋ฌธ์„œ์˜ JSON์„ ์—…๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ๋Š” ์Šคํ‚ค๋งˆ์— ๋”ฐ๋ผ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค. ์Šคํ‚ค๋งˆ๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ์ž๋™์œผ๋กœ ๊ฐ์ง€๋ฉ๋‹ˆ๋‹ค. ๋ฌธ์„œ์˜ JSON ๋ฌธ์ž์—ด์„ ๊ฐ ์ค„์— ์ผ๊ด€๋œ ํ˜•์‹์œผ๋กœ ์ง์ ‘ ๋ฐฐ์น˜ํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ Vertex AI Search๊ฐ€ ๊ฐ€์ ธ์˜จ ๊ฐ ๋ฌธ์„œ์˜ ID๋ฅผ ์ž๋™์œผ๋กœ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

      • content: ๊ตฌ์กฐํ™”๋˜์ง€ ์•Š์€ ๋ฌธ์„œ(PDF, HTML, DOC, TXT, PPTX)๋ฅผ ์—…๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ๋ฌธ์„œ์˜ ID๋Š” 16์ง„์ˆ˜ ๋ฌธ์ž์—ด๋กœ ์ธ์ฝ”๋”ฉ๋œ SHA256(GCS_URI)์˜ ์ฒ˜์Œ 128๋น„ํŠธ๋กœ ์ž๋™์œผ๋กœ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค. ์ผ์น˜ํ•˜๋Š” ํŒŒ์ผ์ด ํŒŒ์ผ ํ•œ๋„์ธ 10๋งŒ ๊ฐœ๋ฅผ ์ดˆ๊ณผํ•˜์ง€ ์•Š๋Š” ํ•œ ์ž…๋ ฅ ํŒŒ์ผ ํŒจํ„ด์„ ์—ฌ๋Ÿฌ ๊ฐœ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

      • csv: ๊ฐ ํ—ค๋”๊ฐ€ ๋ฌธ์„œ ํ•„๋“œ์— ๋งคํ•‘๋˜๋„๋ก ํ—ค๋” ํ–‰์„ CSV ํŒŒ์ผ์— ํฌํ•จํ•ฉ๋‹ˆ๋‹ค. inputUris ํ•„๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ CSV ํŒŒ์ผ์˜ ๊ฒฝ๋กœ๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.

    • ERROR_DIRECTORY: ์„ ํƒ์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค. ๊ฐ€์ ธ์˜ค๊ธฐ์— ๋Œ€ํ•œ ์˜ค๋ฅ˜ ์ •๋ณด๋ฅผ ๋ณผ ์ˆ˜ ์žˆ๋Š” Cloud Storage ๋””๋ ‰ํ„ฐ๋ฆฌ์ž…๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด gs://<your-gcs-bucket>/directory/import_errors์ž…๋‹ˆ๋‹ค. Vertex AI Search๊ฐ€ ์ž„์‹œ ๋””๋ ‰ํ„ฐ๋ฆฌ๋ฅผ ์ž๋™์œผ๋กœ ๋งŒ๋“ค๋„๋ก ํ•˜๋ ค๋ฉด ์ด ํ•„๋“œ๋ฅผ ๋น„์›Œ ๋‘๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

    • RECONCILIATION_MODE: ์„ ํƒ์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค. ๊ฐ’์€ FULL ๋ฐ INCREMENTAL์ž…๋‹ˆ๋‹ค. ๊ธฐ๋ณธ๊ฐ’์€ INCREMENTAL์ž…๋‹ˆ๋‹ค. INCREMENTAL์„ ์ง€์ •ํ•˜๋ฉด Cloud Storage์˜ ๋ฐ์ดํ„ฐ๊ฐ€ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์— ์ ์ง„์ ์œผ๋กœ ์ƒˆ๋กœ๊ณ ์นจ๋ฉ๋‹ˆ๋‹ค. ์ด ๊ฒฝ์šฐ ์ƒˆ ๋ฌธ์„œ๋ฅผ ์ถ”๊ฐ€ํ•˜๊ณ  ๊ธฐ์กด ๋ฌธ์„œ๋ฅผ ๋™์ผํ•œ ID์˜ ์—…๋ฐ์ดํŠธ๋œ ๋ฌธ์„œ๋กœ ๋Œ€์ฒดํ•˜๋Š” ์‚ฝ์ž…/์—…๋ฐ์ดํŠธ(upsert) ์ž‘์—…์ด ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. FULL์„ ์ง€์ •ํ•˜๋ฉด ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์—์„œ ๋ฌธ์„œ์˜ ์ „์ฒด ์žฌ๋ฐฐ์น˜๊ฐ€ ์ด๋ฃจ์–ด์ง‘๋‹ˆ๋‹ค. ์ฆ‰, ์ƒˆ ๋ฌธ์„œ์™€ ์—…๋ฐ์ดํŠธ๋œ ๋ฌธ์„œ๋Š” ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์— ์ถ”๊ฐ€๋˜๊ณ  Cloud Storage์— ์—†๋Š” ๋ฌธ์„œ๋Š” ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์—์„œ ์‚ญ์ œ๋ฉ๋‹ˆ๋‹ค. FULL ๋ชจ๋“œ๋Š” ๋” ์ด์ƒ ํ•„์š”ํ•˜์ง€ ์•Š์€ ๋ฌธ์„œ๋ฅผ ์ž๋™์œผ๋กœ ์‚ญ์ œํ•˜๋ ค๋Š” ๊ฒฝ์šฐ์— ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค.

    • AUTO_GENERATE_IDS: ์„ ํƒ์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค. ๋ฌธ์„œ ID๋ฅผ ์ž๋™์œผ๋กœ ์ƒ์„ฑํ• ์ง€ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. true๋กœ ์„ค์ •ํ•˜๋ฉด ํŽ˜์ด๋กœ๋“œ์˜ ํ•ด์‹œ์— ๋”ฐ๋ผ ๋ฌธ์„œ ID๊ฐ€ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค. ์ƒ์„ฑ๋œ ๋ฌธ์„œ ID๋Š” ์—ฌ๋Ÿฌ ๊ฐ€์ ธ์˜ค๊ธฐ์—์„œ ์ผ๊ด€๋˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์—ฌ๋Ÿฌ ๊ฐ€์ ธ์˜ค๊ธฐ์—์„œ ID๋ฅผ ์ž๋™์œผ๋กœ ์ƒ์„ฑํ•˜๋Š” ๊ฒฝ์šฐ ๋ฌธ์„œ ID์˜ ์ผ๊ด€์„ฑ์„ ์œ ์ง€ํ•˜๊ธฐ ์œ„ํ•ด reconciliationMode๋ฅผ FULL๋กœ ์„ค์ •ํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

      gcsSource.dataSchema๊ฐ€ custom ๋˜๋Š” csv๋กœ ์„ค์ •๋œ ๊ฒฝ์šฐ์—๋งŒ autoGenerateIds๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด INVALID_ARGUMENT ์˜ค๋ฅ˜๊ฐ€ ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค. autoGenerateIds๋ฅผ ์ง€์ •ํ•˜์ง€ ์•Š๊ฑฐ๋‚˜ false๋กœ ์„ค์ •ํ•œ ๊ฒฝ์šฐ idField๋ฅผ ์ง€์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ๋ฌธ์„œ๋ฅผ ๊ฐ€์ ธ์˜ค์ง€ ๋ชปํ•ฉ๋‹ˆ๋‹ค.

    • ID_FIELD: ์„ ํƒ์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค. ๋ฌธ์„œ ID์ธ ํ•„๋“œ๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. Cloud Storage ์†Œ์Šค ๋ฌธ์„œ์˜ ๊ฒฝ์šฐ idField๋Š” ๋ฌธ์„œ ID์ธ JSON ํ•„๋“œ์˜ ์ด๋ฆ„์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด {"my_id":"some_uuid"}๊ฐ€ ๋ฌธ์„œ ์ค‘ ํ•˜๋‚˜์—์„œ ๋ฌธ์„œ ID ํ•„๋“œ์ด๋ฉด "idField":"my_id"๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋ฉด ์ด๋ฆ„์ด "my_id"์ธ ๋ชจ๋“  JSON ํ•„๋“œ๊ฐ€ ๋ฌธ์„œ ID๋กœ ์‹๋ณ„๋ฉ๋‹ˆ๋‹ค.

      ์ด ํ•„๋“œ๋Š” (1) gcsSource.dataSchema๊ฐ€ custom ๋˜๋Š” csv๋กœ ์„ค์ •๋˜์—ˆ๊ณ  (2) auto_generate_ids๊ฐ€ false๋กœ ์„ค์ •๋˜์—ˆ๊ฑฐ๋‚˜ ์ง€์ •๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ์—๋งŒ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด INVALID_ARGUMENT ์˜ค๋ฅ˜๊ฐ€ ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค.

      Cloud Storage JSON ํ•„๋“œ์˜ ๊ฐ’์€ ๋ฌธ์ž์—ด ์œ ํ˜•์ด๊ณ  1~63์ž(์˜๋ฌธ ๊ธฐ์ค€)์—ฌ์•ผ ํ•˜๋ฉฐ RFC-1034๋ฅผ ์ค€์ˆ˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ๋ฌธ์„œ๋ฅผ ๊ฐ€์ ธ์˜ค์ง€ ๋ชปํ•ฉ๋‹ˆ๋‹ค.

      id_field๋กœ ์ง€์ •๋œ JSON ํ•„๋“œ ์ด๋ฆ„์€ ๋ฌธ์ž์—ด ์œ ํ˜•์ด๊ณ  1~63์ž(์˜๋ฌธ ๊ธฐ์ค€)์—ฌ์•ผ ํ•˜๊ณ  RFC-1034๋ฅผ ์ค€์ˆ˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ๋ฌธ์„œ๋ฅผ ๊ฐ€์ ธ์˜ค์ง€ ๋ชปํ•ฉ๋‹ˆ๋‹ค.

C#

์ž์„ธํ•œ ๋‚ด์šฉ์€ AI Applications C# API ์ฐธ๊ณ  ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

AI Applications์— ์ธ์ฆํ•˜๋ ค๋ฉด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ธฐ๋ณธ ์‚ฌ์šฉ์ž ์ธ์ฆ ์ •๋ณด๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋กœ์ปฌ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์˜ ์ธ์ฆ ์„ค์ •์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ๋งŒ๋“ค๊ธฐ

using Google.Cloud.DiscoveryEngine.V1;
using Google.LongRunning;

public sealed partial class GeneratedDataStoreServiceClientSnippets
{
    /// <summary>Snippet for CreateDataStore</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void CreateDataStoreRequestObject()
    {
        // Create client
        DataStoreServiceClient dataStoreServiceClient = DataStoreServiceClient.Create();
        // Initialize request argument(s)
        CreateDataStoreRequest request = new CreateDataStoreRequest
        {
            ParentAsCollectionName = CollectionName.FromProjectLocationCollection("[PROJECT]", "[LOCATION]", "[COLLECTION]"),
            DataStore = new DataStore(),
            DataStoreId = "",
            CreateAdvancedSiteSearch = false,
            CmekConfigNameAsCmekConfigName = CmekConfigName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
            SkipDefaultSchemaCreation = false,
        };
        // Make the request
        Operation<DataStore, CreateDataStoreMetadata> response = dataStoreServiceClient.CreateDataStore(request);

        // Poll until the returned long-running operation is complete
        Operation<DataStore, CreateDataStoreMetadata> completedResponse = response.PollUntilCompleted();
        // Retrieve the operation result
        DataStore result = completedResponse.Result;

        // Or get the name of the operation
        string operationName = response.Name;
        // This name can be stored, then the long-running operation retrieved later by name
        Operation<DataStore, CreateDataStoreMetadata> retrievedResponse = dataStoreServiceClient.PollOnceCreateDataStore(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            DataStore retrievedResult = retrievedResponse.Result;
        }
    }
}

๋ฌธ์„œ ๊ฐ€์ ธ์˜ค๊ธฐ

using Google.Cloud.DiscoveryEngine.V1;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;

public sealed partial class GeneratedDocumentServiceClientSnippets
{
    /// <summary>Snippet for ImportDocuments</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void ImportDocumentsRequestObject()
    {
        // Create client
        DocumentServiceClient documentServiceClient = DocumentServiceClient.Create();
        // Initialize request argument(s)
        ImportDocumentsRequest request = new ImportDocumentsRequest
        {
            ParentAsBranchName = BranchName.FromProjectLocationDataStoreBranch("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]"),
            InlineSource = new ImportDocumentsRequest.Types.InlineSource(),
            ErrorConfig = new ImportErrorConfig(),
            ReconciliationMode = ImportDocumentsRequest.Types.ReconciliationMode.Unspecified,
            UpdateMask = new FieldMask(),
            AutoGenerateIds = false,
            IdField = "",
            ForceRefreshContent = false,
        };
        // Make the request
        Operation<ImportDocumentsResponse, ImportDocumentsMetadata> response = documentServiceClient.ImportDocuments(request);

        // Poll until the returned long-running operation is complete
        Operation<ImportDocumentsResponse, ImportDocumentsMetadata> completedResponse = response.PollUntilCompleted();
        // Retrieve the operation result
        ImportDocumentsResponse result = completedResponse.Result;

        // Or get the name of the operation
        string operationName = response.Name;
        // This name can be stored, then the long-running operation retrieved later by name
        Operation<ImportDocumentsResponse, ImportDocumentsMetadata> retrievedResponse = documentServiceClient.PollOnceImportDocuments(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            ImportDocumentsResponse retrievedResult = retrievedResponse.Result;
        }
    }
}

Go

์ž์„ธํ•œ ๋‚ด์šฉ์€ AI Applications Go API ์ฐธ๊ณ  ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

AI Applications์— ์ธ์ฆํ•˜๋ ค๋ฉด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ธฐ๋ณธ ์‚ฌ์šฉ์ž ์ธ์ฆ ์ •๋ณด๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋กœ์ปฌ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์˜ ์ธ์ฆ ์„ค์ •์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ๋งŒ๋“ค๊ธฐ


package main

import (
	"context"

	discoveryengine "cloud.google.com/go/discoveryengine/apiv1"
	discoveryenginepb "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := discoveryengine.NewDataStoreClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &discoveryenginepb.CreateDataStoreRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#CreateDataStoreRequest.
	}
	op, err := c.CreateDataStore(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

๋ฌธ์„œ ๊ฐ€์ ธ์˜ค๊ธฐ


package main

import (
	"context"

	discoveryengine "cloud.google.com/go/discoveryengine/apiv1"
	discoveryenginepb "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := discoveryengine.NewDocumentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &discoveryenginepb.ImportDocumentsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb#ImportDocumentsRequest.
	}
	op, err := c.ImportDocuments(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Java

์ž์„ธํ•œ ๋‚ด์šฉ์€ AI Applications Java API ์ฐธ๊ณ  ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

AI Applications์— ์ธ์ฆํ•˜๋ ค๋ฉด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ธฐ๋ณธ ์‚ฌ์šฉ์ž ์ธ์ฆ ์ •๋ณด๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋กœ์ปฌ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์˜ ์ธ์ฆ ์„ค์ •์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ๋งŒ๋“ค๊ธฐ

import com.google.cloud.discoveryengine.v1.CollectionName;
import com.google.cloud.discoveryengine.v1.CreateDataStoreRequest;
import com.google.cloud.discoveryengine.v1.DataStore;
import com.google.cloud.discoveryengine.v1.DataStoreServiceClient;

public class SyncCreateDataStore {

  public static void main(String[] args) throws Exception {
    syncCreateDataStore();
  }

  public static void syncCreateDataStore() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (DataStoreServiceClient dataStoreServiceClient = DataStoreServiceClient.create()) {
      CreateDataStoreRequest request =
          CreateDataStoreRequest.newBuilder()
              .setParent(CollectionName.of("[PROJECT]", "[LOCATION]", "[COLLECTION]").toString())
              .setDataStore(DataStore.newBuilder().build())
              .setDataStoreId("dataStoreId929489618")
              .setCreateAdvancedSiteSearch(true)
              .setSkipDefaultSchemaCreation(true)
              .build();
      DataStore response = dataStoreServiceClient.createDataStoreAsync(request).get();
    }
  }
}

๋ฌธ์„œ ๊ฐ€์ ธ์˜ค๊ธฐ

import com.google.cloud.discoveryengine.v1.BranchName;
import com.google.cloud.discoveryengine.v1.DocumentServiceClient;
import com.google.cloud.discoveryengine.v1.ImportDocumentsRequest;
import com.google.cloud.discoveryengine.v1.ImportDocumentsResponse;
import com.google.cloud.discoveryengine.v1.ImportErrorConfig;
import com.google.protobuf.FieldMask;

public class SyncImportDocuments {

  public static void main(String[] args) throws Exception {
    syncImportDocuments();
  }

  public static void syncImportDocuments() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (DocumentServiceClient documentServiceClient = DocumentServiceClient.create()) {
      ImportDocumentsRequest request =
          ImportDocumentsRequest.newBuilder()
              .setParent(
                  BranchName.ofProjectLocationDataStoreBranchName(
                          "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[BRANCH]")
                      .toString())
              .setErrorConfig(ImportErrorConfig.newBuilder().build())
              .setUpdateMask(FieldMask.newBuilder().build())
              .setAutoGenerateIds(true)
              .setIdField("idField1629396127")
              .setForceRefreshContent(true)
              .build();
      ImportDocumentsResponse response = documentServiceClient.importDocumentsAsync(request).get();
    }
  }
}

Node.js

์ž์„ธํ•œ ๋‚ด์šฉ์€ AI Applications Node.js API ์ฐธ๊ณ  ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

AI Applications์— ์ธ์ฆํ•˜๋ ค๋ฉด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ธฐ๋ณธ ์‚ฌ์šฉ์ž ์ธ์ฆ ์ •๋ณด๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋กœ์ปฌ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์˜ ์ธ์ฆ ์„ค์ •์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ๋งŒ๋“ค๊ธฐ

/**
 * This snippet has been automatically generated and should be regarded as a code template only.
 * It will require modifications to work.
 * It may require correct/in-range values for request initialization.
 * TODO(developer): Uncomment these variables before running the sample.
 */
/**
 *  Resource name of the CmekConfig to use for protecting this DataStore.
 */
// const cmekConfigName = 'abc123'
/**
 *  DataStore without CMEK protections. If a default CmekConfig is set for
 *  the project, setting this field will override the default CmekConfig as
 *  well.
 */
// const disableCmek = true
/**
 *  Required. The parent resource name, such as
 *  `projects/{project}/locations/{location}/collections/{collection}`.
 */
// const parent = 'abc123'
/**
 *  Required. The DataStore google.cloud.discoveryengine.v1.DataStore  to
 *  create.
 */
// const dataStore = {}
/**
 *  Required. The ID to use for the
 *  DataStore google.cloud.discoveryengine.v1.DataStore, which will become
 *  the final component of the
 *  DataStore google.cloud.discoveryengine.v1.DataStore's resource name.
 *  This field must conform to RFC-1034 (https://tools.ietf.org/html/rfc1034)
 *  standard with a length limit of 63 characters. Otherwise, an
 *  INVALID_ARGUMENT error is returned.
 */
// const dataStoreId = 'abc123'
/**
 *  A boolean flag indicating whether user want to directly create an advanced
 *  data store for site search.
 *  If the data store is not configured as site
 *  search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will
 *  be ignored.
 */
// const createAdvancedSiteSearch = true
/**
 *  A boolean flag indicating whether to skip the default schema creation for
 *  the data store. Only enable this flag if you are certain that the default
 *  schema is incompatible with your use case.
 *  If set to true, you must manually create a schema for the data store before
 *  any documents can be ingested.
 *  This flag cannot be specified if `data_store.starting_schema` is specified.
 */
// const skipDefaultSchemaCreation = true

// Imports the Discoveryengine library
const {DataStoreServiceClient} = require('@google-cloud/discoveryengine').v1;

// Instantiates a client
const discoveryengineClient = new DataStoreServiceClient();

async function callCreateDataStore() {
  // Construct request
  const request = {
    parent,
    dataStore,
    dataStoreId,
  };

  // Run request
  const [operation] = await discoveryengineClient.createDataStore(request);
  const [response] = await operation.promise();
  console.log(response);
}

callCreateDataStore();

๋ฌธ์„œ ๊ฐ€์ ธ์˜ค๊ธฐ

/**
 * This snippet has been automatically generated and should be regarded as a code template only.
 * It will require modifications to work.
 * It may require correct/in-range values for request initialization.
 * TODO(developer): Uncomment these variables before running the sample.
 */
/**
 *  The Inline source for the input content for documents.
 */
// const inlineSource = {}
/**
 *  Cloud Storage location for the input content.
 */
// const gcsSource = {}
/**
 *  BigQuery input source.
 */
// const bigquerySource = {}
/**
 *  FhirStore input source.
 */
// const fhirStoreSource = {}
/**
 *  Spanner input source.
 */
// const spannerSource = {}
/**
 *  Cloud SQL input source.
 */
// const cloudSqlSource = {}
/**
 *  Firestore input source.
 */
// const firestoreSource = {}
/**
 *  AlloyDB input source.
 */
// const alloyDbSource = {}
/**
 *  Cloud Bigtable input source.
 */
// const bigtableSource = {}
/**
 *  Required. The parent branch resource name, such as
 *  `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
 *  Requires create/update permission.
 */
// const parent = 'abc123'
/**
 *  The desired location of errors incurred during the Import.
 */
// const errorConfig = {}
/**
 *  The mode of reconciliation between existing documents and the documents to
 *  be imported. Defaults to
 *  ReconciliationMode.INCREMENTAL google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL.
 */
// const reconciliationMode = {}
/**
 *  Indicates which fields in the provided imported documents to update. If
 *  not set, the default is to update all fields.
 */
// const updateMask = {}
/**
 *  Whether to automatically generate IDs for the documents if absent.
 *  If set to `true`,
 *  Document.id google.cloud.discoveryengine.v1.Document.id s are
 *  automatically generated based on the hash of the payload, where IDs may not
 *  be consistent during multiple imports. In which case
 *  ReconciliationMode.FULL google.cloud.discoveryengine.v1.ImportDocumentsRequest.ReconciliationMode.FULL 
 *  is highly recommended to avoid duplicate contents. If unset or set to
 *  `false`, Document.id google.cloud.discoveryengine.v1.Document.id s have
 *  to be specified using
 *  id_field google.cloud.discoveryengine.v1.ImportDocumentsRequest.id_field,
 *  otherwise, documents without IDs fail to be imported.
 *  Supported data sources:
 *  * GcsSource google.cloud.discoveryengine.v1.GcsSource.
 *  GcsSource.data_schema google.cloud.discoveryengine.v1.GcsSource.data_schema 
 *  must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
 *  * BigQuerySource google.cloud.discoveryengine.v1.BigQuerySource.
 *  BigQuerySource.data_schema google.cloud.discoveryengine.v1.BigQuerySource.data_schema 
 *  must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
 *  * SpannerSource google.cloud.discoveryengine.v1.SpannerSource.
 *  * CloudSqlSource google.cloud.discoveryengine.v1.CloudSqlSource.
 *  * FirestoreSource google.cloud.discoveryengine.v1.FirestoreSource.
 *  * BigtableSource google.cloud.discoveryengine.v1.BigtableSource.
 */
// const autoGenerateIds = true
/**
 *  The field indicates the ID field or column to be used as unique IDs of
 *  the documents.
 *  For GcsSource google.cloud.discoveryengine.v1.GcsSource  it is the key of
 *  the JSON field. For instance, `my_id` for JSON `{"my_id": "some_uuid"}`.
 *  For others, it may be the column name of the table where the unique ids are
 *  stored.
 *  The values of the JSON field or the table column are used as the
 *  Document.id google.cloud.discoveryengine.v1.Document.id s. The JSON field
 *  or the table column must be of string type, and the values must be set as
 *  valid strings conform to RFC-1034 (https://tools.ietf.org/html/rfc1034)
 *  with 1-63 characters. Otherwise, documents without valid IDs fail to be
 *  imported.
 *  Only set this field when
 *  auto_generate_ids google.cloud.discoveryengine.v1.ImportDocumentsRequest.auto_generate_ids 
 *  is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.
 *  If it is unset, a default value `_id` is used when importing from the
 *  allowed data sources.
 *  Supported data sources:
 *  * GcsSource google.cloud.discoveryengine.v1.GcsSource.
 *  GcsSource.data_schema google.cloud.discoveryengine.v1.GcsSource.data_schema 
 *  must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
 *  * BigQuerySource google.cloud.discoveryengine.v1.BigQuerySource.
 *  BigQuerySource.data_schema google.cloud.discoveryengine.v1.BigQuerySource.data_schema 
 *  must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
 *  * SpannerSource google.cloud.discoveryengine.v1.SpannerSource.
 *  * CloudSqlSource google.cloud.discoveryengine.v1.CloudSqlSource.
 *  * FirestoreSource google.cloud.discoveryengine.v1.FirestoreSource.
 *  * BigtableSource google.cloud.discoveryengine.v1.BigtableSource.
 */
// const idField = 'abc123'
/**
 *  Optional. Whether to force refresh the unstructured content of the
 *  documents.
 *  If set to `true`, the content part of the documents will be refreshed
 *  regardless of the update status of the referencing content.
 */
// const forceRefreshContent = true

// Imports the Discoveryengine library
const {DocumentServiceClient} = require('@google-cloud/discoveryengine').v1;

// Instantiates a client
const discoveryengineClient = new DocumentServiceClient();

async function callImportDocuments() {
  // Construct request
  const request = {
    parent,
  };

  // Run request
  const [operation] = await discoveryengineClient.importDocuments(request);
  const [response] = await operation.promise();
  console.log(response);
}

callImportDocuments();

Python

์ž์„ธํ•œ ๋‚ด์šฉ์€ AI Applications Python API ์ฐธ๊ณ  ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

AI Applications์— ์ธ์ฆํ•˜๋ ค๋ฉด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ธฐ๋ณธ ์‚ฌ์šฉ์ž ์ธ์ฆ ์ •๋ณด๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋กœ์ปฌ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์˜ ์ธ์ฆ ์„ค์ •์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ๋งŒ๋“ค๊ธฐ


from google.api_core.client_options import ClientOptions
from google.cloud import discoveryengine

# TODO(developer): Uncomment these variables before running the sample.
# project_id = "YOUR_PROJECT_ID"
# location = "YOUR_LOCATION" # Values: "global"
# data_store_id = "YOUR_DATA_STORE_ID"


def create_data_store_sample(
    project_id: str,
    location: str,
    data_store_id: str,
) -> str:
    #  For more information, refer to:
    # https://cloud.google.com/generative-ai-app-builder/docs/locations#specify_a_multi-region_for_your_data_store
    client_options = (
        ClientOptions(api_endpoint=f"{location}-discoveryengine.googleapis.com")
        if location != "global"
        else None
    )

    # Create a client
    client = discoveryengine.DataStoreServiceClient(client_options=client_options)

    # The full resource name of the collection
    # e.g. projects/{project}/locations/{location}/collections/default_collection
    parent = client.collection_path(
        project=project_id,
        location=location,
        collection="default_collection",
    )

    data_store = discoveryengine.DataStore(
        display_name="My Data Store",
        # Options: GENERIC, MEDIA, HEALTHCARE_FHIR
        industry_vertical=discoveryengine.IndustryVertical.GENERIC,
        # Options: SOLUTION_TYPE_RECOMMENDATION, SOLUTION_TYPE_SEARCH, SOLUTION_TYPE_CHAT, SOLUTION_TYPE_GENERATIVE_CHAT
        solution_types=[discoveryengine.SolutionType.SOLUTION_TYPE_SEARCH],
        # TODO(developer): Update content_config based on data store type.
        # Options: NO_CONTENT, CONTENT_REQUIRED, PUBLIC_WEBSITE
        content_config=discoveryengine.DataStore.ContentConfig.CONTENT_REQUIRED,
    )

    request = discoveryengine.CreateDataStoreRequest(
        parent=parent,
        data_store_id=data_store_id,
        data_store=data_store,
        # Optional: For Advanced Site Search Only
        # create_advanced_site_search=True,
    )

    # Make the request
    operation = client.create_data_store(request=request)

    print(f"Waiting for operation to complete: {operation.operation.name}")
    response = operation.result()

    # After the operation is complete,
    # get information from operation metadata
    metadata = discoveryengine.CreateDataStoreMetadata(operation.metadata)

    # Handle the response
    print(response)
    print(metadata)

    return operation.operation.name

๋ฌธ์„œ ๊ฐ€์ ธ์˜ค๊ธฐ

from google.api_core.client_options import ClientOptions
from google.cloud import discoveryengine

# TODO(developer): Uncomment these variables before running the sample.
# project_id = "YOUR_PROJECT_ID"
# location = "YOUR_LOCATION" # Values: "global"
# data_store_id = "YOUR_DATA_STORE_ID"

# Examples:
# - Unstructured documents
#   - `gs://bucket/directory/file.pdf`
#   - `gs://bucket/directory/*.pdf`
# - Unstructured documents with JSONL Metadata
#   - `gs://bucket/directory/file.json`
# - Unstructured documents with CSV Metadata
#   - `gs://bucket/directory/file.csv`
# gcs_uri = "YOUR_GCS_PATH"

#  For more information, refer to:
# https://cloud.google.com/generative-ai-app-builder/docs/locations#specify_a_multi-region_for_your_data_store
client_options = (
    ClientOptions(api_endpoint=f"{location}-discoveryengine.googleapis.com")
    if location != "global"
    else None
)

# Create a client
client = discoveryengine.DocumentServiceClient(client_options=client_options)

# The full resource name of the search engine branch.
# e.g. projects/{project}/locations/{location}/dataStores/{data_store_id}/branches/{branch}
parent = client.branch_path(
    project=project_id,
    location=location,
    data_store=data_store_id,
    branch="default_branch",
)

request = discoveryengine.ImportDocumentsRequest(
    parent=parent,
    gcs_source=discoveryengine.GcsSource(
        # Multiple URIs are supported
        input_uris=[gcs_uri],
        # Options:
        # - `content` - Unstructured documents (PDF, HTML, DOC, TXT, PPTX)
        # - `custom` - Unstructured documents with custom JSONL metadata
        # - `document` - Structured documents in the discoveryengine.Document format.
        # - `csv` - Unstructured documents with CSV metadata
        data_schema="content",
    ),
    # Options: `FULL`, `INCREMENTAL`
    reconciliation_mode=discoveryengine.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL,
)

# Make the request
operation = client.import_documents(request=request)

print(f"Waiting for operation to complete: {operation.operation.name}")
response = operation.result()

# After the operation is complete,
# get information from operation metadata
metadata = discoveryengine.ImportDocumentsMetadata(operation.metadata)

# Handle the response
print(response)
print(metadata)

Ruby

์ž์„ธํ•œ ๋‚ด์šฉ์€ AI Applications Ruby API ์ฐธ๊ณ  ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

AI Applications์— ์ธ์ฆํ•˜๋ ค๋ฉด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ธฐ๋ณธ ์‚ฌ์šฉ์ž ์ธ์ฆ ์ •๋ณด๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋กœ์ปฌ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์˜ ์ธ์ฆ ์„ค์ •์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ๋งŒ๋“ค๊ธฐ

require "google/cloud/discovery_engine/v1"

##
# Snippet for the create_data_store call in the DataStoreService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client#create_data_store.
#
def create_data_store
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::DiscoveryEngine::V1::DataStoreService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::DiscoveryEngine::V1::CreateDataStoreRequest.new

  # Call the create_data_store method.
  result = client.create_data_store request

  # The returned object is of type Gapic::Operation. You can use it to
  # check the status of an operation, cancel it, or wait for results.
  # Here is how to wait for a response.
  result.wait_until_done! timeout: 60
  if result.response?
    p result.response
  else
    puts "No response received."
  end
end

๋ฌธ์„œ ๊ฐ€์ ธ์˜ค๊ธฐ

require "google/cloud/discovery_engine/v1"

##
# Snippet for the import_documents call in the DocumentService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::DiscoveryEngine::V1::DocumentService::Client#import_documents.
#
def import_documents
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new

  # Call the import_documents method.
  result = client.import_documents request

  # The returned object is of type Gapic::Operation. You can use it to
  # check the status of an operation, cancel it, or wait for results.
  # Here is how to wait for a response.
  result.wait_until_done! timeout: 60
  if result.response?
    p result.response
  else
    puts "No response received."
  end
end

์ฃผ๊ธฐ์  ๋™๊ธฐํ™”๋กœ Cloud Storage์— ์—ฐ๊ฒฐ

๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๊ธฐ ์ „์— ์ˆ˜์ง‘ํ•  ๋ฐ์ดํ„ฐ ์ค€๋น„๋ฅผ ๊ฒ€ํ† ํ•˜์„ธ์š”.

๋‹ค์Œ ์ ˆ์ฐจ์—์„œ๋Š” Cloud Storage ์œ„์น˜๋ฅผ Vertex AI Search ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ์™€ ์—ฐ๊ฒฐํ•˜๋Š” ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ๋ฅผ ๋งŒ๋“œ๋Š” ๋ฐฉ๋ฒ•๊ณผ ๋งŒ๋“ค๋ ค๋Š” ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ํ•ด๋‹น ์œ„์น˜์— ํด๋” ๋˜๋Š” ํŒŒ์ผ์„ ์ง€์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ์˜ ํ•˜์œ„ ์š”์†Œ์ธ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ํ•ญ๋ชฉ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

๋ฐ์ดํ„ฐ๋Š” ์ฃผ๊ธฐ์ ์œผ๋กœ ํ•ญ๋ชฉ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์— ๋™๊ธฐํ™”๋ฉ๋‹ˆ๋‹ค. ๋งค์ผ, 3์ผ๋งˆ๋‹ค ๋˜๋Š” 5์ผ๋งˆ๋‹ค ๋™๊ธฐํ™”๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ฝ˜์†”

  1. Google Cloud ์ฝ˜์†”์—์„œ AI ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

    AI ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜

  2. ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

  3. ๋ฐ์ดํ„ฐ ์ €์žฅ์†Œ ๋งŒ๋“ค๊ธฐ๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  4. ์†Œ์Šค ํŽ˜์ด์ง€์—์„œ Cloud Storage๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  5. ๊ฐ€์ ธ์˜ฌ ๋ฐ์ดํ„ฐ์˜ ์œ ํ˜•์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  6. ์ฃผ๊ธฐ์ ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  7. ๋™๊ธฐํ™” ๋นˆ๋„๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. Vertex AI Search ์ปค๋„ฅํ„ฐ๊ฐ€ Cloud Storage ์œ„์น˜์™€ ๋™๊ธฐํ™”ํ•  ๋นˆ๋„์ž…๋‹ˆ๋‹ค. ๋นˆ๋„๋Š” ๋‚˜์ค‘์— ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  8. ๊ฐ€์ ธ์˜ฌ ํด๋” ๋˜๋Š” ํŒŒ์ผ ์„ ํƒ ์„น์…˜์—์„œ ํด๋” ๋˜๋Š” ํŒŒ์ผ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  9. ์ฐพ์•„๋ณด๊ธฐ๋ฅผ ํด๋ฆญํ•˜๊ณ  ์ˆ˜์ง‘์„ ์œ„ํ•ด ์ค€๋น„ํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ์„ ํƒํ•œ ๋‹ค์Œ ์„ ํƒ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค. ๋˜๋Š” gs:// ํ•„๋“œ์— ์œ„์น˜๋ฅผ ์ง์ ‘ ์ž…๋ ฅํ•ด๋„ ๋ฉ๋‹ˆ๋‹ค.

  10. ๊ณ„์†์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  11. ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ์˜ ๋ฆฌ์ „์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  12. ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ ์ด๋ฆ„์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

  13. ์„ ํƒ์‚ฌํ•ญ: ๊ตฌ์กฐํ™”๋˜์ง€ ์•Š์€ ๋ฌธ์„œ๋ฅผ ์„ ํƒํ•œ ๊ฒฝ์šฐ ๋ฌธ์„œ์˜ ํŒŒ์‹ฑ ๋ฐ ์ฒญํฌ ์ฒ˜๋ฆฌ ์˜ต์…˜์„ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํŒŒ์„œ๋ฅผ ๋น„๊ตํ•˜๋ ค๋ฉด ๋ฌธ์„œ ํŒŒ์‹ฑ์„ ์ฐธ๊ณ ํ•˜์„ธ์š”. ์ฒญํฌ ์ฒ˜๋ฆฌ์— ๊ด€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ RAG์šฉ ๋ฌธ์„œ ์ฒญํฌ ์ฒ˜๋ฆฌ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

    OCR ํŒŒ์„œ ๋ฐ ๋ ˆ์ด์•„์›ƒ ํŒŒ์„œ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ถ”๊ฐ€ ๋น„์šฉ์ด ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. Document AI ๊ธฐ๋Šฅ ๊ฐ€๊ฒฉ ์ฑ…์ •์„ ์ฐธ๊ณ ํ•˜์„ธ์š”.

    ํŒŒ์„œ๋ฅผ ์„ ํƒํ•˜๋ ค๋ฉด ๋ฌธ์„œ ์ฒ˜๋ฆฌ ์˜ต์…˜์„ ํŽผ์น˜๊ณ  ์‚ฌ์šฉํ•  ํŒŒ์„œ ์˜ต์…˜์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.

  14. ๋งŒ๋“ค๊ธฐ๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

    ๋ฐ์ดํ„ฐ๋ฅผ Cloud Storage ์œ„์น˜์™€ ์ฃผ๊ธฐ์ ์œผ๋กœ ๋™๊ธฐํ™”ํ•˜๋Š” ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ๋ฅผ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. gcs_store๋ผ๋Š” ํ•ญ๋ชฉ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋„ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค.

  15. ์ˆ˜์ง‘ ์ƒํƒœ๋ฅผ ํ™•์ธํ•˜๋ ค๋ฉด ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ ์ด๋ฆ„์„ ํด๋ฆญํ•œ ํ›„ ๋ฐ์ดํ„ฐ ํŽ˜์ด์ง€์—์„œ ์„ธ๋ถ€์ •๋ณด๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

    ๋ฐ์ดํ„ฐ ์ˆ˜์ง‘ ํ™œ๋™ ํƒญ. ๋ฐ์ดํ„ฐ ์ˆ˜์ง‘ ํ™œ๋™ ํƒญ์˜ ์ƒํƒœ ์—ด์ด ์ง„ํ–‰ ์ค‘์—์„œ ์„ฑ๊ณต์œผ๋กœ ๋ณ€๊ฒฝ๋˜๋ฉด ์ฒซ ๋ฒˆ์งธ ์ˆ˜์ง‘์ด ์™„๋ฃŒ๋œ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

    ๋ฐ์ดํ„ฐ ํฌ๊ธฐ์— ๋”ฐ๋ผ ์ˆ˜์ง‘์— ๋ช‡ ๋ถ„๋ถ€ํ„ฐ ๋ช‡ ์‹œ๊ฐ„๊นŒ์ง€ ๊ฑธ๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋ฐ์ดํ„ฐ ์†Œ์Šค๋ฅผ ์„ค์ •ํ•˜๊ณ  ๋ฐ์ดํ„ฐ๋ฅผ ์ฒ˜์Œ ๊ฐ€์ ธ์˜จ ํ›„์—๋Š” ์„ค์ • ์ค‘์— ์„ ํƒํ•œ ๋นˆ๋„๋กœ ํ•ด๋‹น ์†Œ์Šค์˜ ๋ฐ์ดํ„ฐ๊ฐ€ ๋™๊ธฐํ™”๋ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ์ปค๋„ฅํ„ฐ๊ฐ€ ์ƒ์„ฑ๋œ ํ›„ ์•ฝ 1์‹œ๊ฐ„ ํ›„์— ์ฒซ ๋ฒˆ์งธ ๋™๊ธฐํ™”๊ฐ€ ์ด๋ฃจ์–ด์ง‘๋‹ˆ๋‹ค. ์ดํ›„ ๋‹ค์Œ ๋™๊ธฐํ™”๊ฐ€ ์•ฝ 24์‹œ๊ฐ„, 72์‹œ๊ฐ„ ๋˜๋Š” 120์‹œ๊ฐ„ ํ›„์— ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ ๋‹จ๊ณ„

  • ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ์•ฑ์— ์—ฐ๊ฒฐํ•˜๋ ค๋ฉด ์•ฑ์„ ๋งŒ๋“ค๊ณ  ๋งž์ถค ์ถ”์ฒœ ์•ฑ ๋งŒ๋“ค๊ธฐ์˜ ๋‹จ๊ณ„๋ฅผ ๋”ฐ๋ผ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  • ์•ฑ๊ณผ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ์„ค์ •ํ•œ ํ›„ ์ถ”์ฒœ์„ ๋ฏธ๋ฆฌ ๋ณด๊ฑฐ๋‚˜ ๊ฐ€์ ธ์˜ค๋ ค๋ฉด ์ถ”์ฒœ ๊ฐ€์ ธ์˜ค๊ธฐ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ตฌ์กฐํ™”๋œ JSON ๋ฐ์ดํ„ฐ ์—…๋กœ๋“œ

API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ JSON ๋ฌธ์„œ ๋˜๋Š” ๊ฐ์ฒด๋ฅผ ์ง์ ‘ ์—…๋กœ๋“œํ•˜๋ ค๋ฉด ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๊ธฐ ์ „์— ์ˆ˜์ง‘ํ•  ๋ฐ์ดํ„ฐ ์ค€๋น„๋ฅผ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

REST

๋ช…๋ น์ค„์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ค๊ณ  ๊ตฌ์กฐํ™”๋œ JSON ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๋ ค๋ฉด ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

  1. ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

    curl -X POST \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "Content-Type: application/json" \
    -H "X-Goog-User-Project: PROJECT_ID" \
    "https://discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores?dataStoreId=DATA_STORE_ID" \
    -d '{
      "displayName": "DATA_STORE_DISPLAY_NAME",
      "industryVertical": "GENERIC",
      "solutionTypes": ["SOLUTION_TYPE_RECOMMENDATION"]
    }'
    

    ๋‹ค์Œ์„ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค.

    • PROJECT_ID: Google Cloud ํ”„๋กœ์ ํŠธ์˜ ID์ž…๋‹ˆ๋‹ค.
    • DATA_STORE_ID: ๋งŒ๋“ค๋ ค๋Š” ์ถ”์ฒœ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ID์ž…๋‹ˆ๋‹ค. ์ด ID๋Š” ์†Œ๋ฌธ์ž, ์ˆซ์ž, ๋ฐ‘์ค„, ํ•˜์ดํ”ˆ๋งŒ ํฌํ•จํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    • DATA_STORE_DISPLAY_NAME: ๋งŒ๋“ค๋ ค๋Š” ์ถ”์ฒœ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ํ‘œ์‹œ ์ด๋ฆ„์ž…๋‹ˆ๋‹ค.
  2. ์„ ํƒ์‚ฌํ•ญ: ์ž์ฒด ์Šคํ‚ค๋งˆ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์Šคํ‚ค๋งˆ๋ฅผ ์ œ๊ณตํ•˜๋ฉด ์ผ๋ฐ˜์ ์œผ๋กœ ๋” ๋‚˜์€ ๊ฒฐ๊ณผ๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์Šคํ‚ค๋งˆ ์ œ๊ณต ๋˜๋Š” ์ž๋™ ๊ฐ์ง€๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

    curl -X PATCH \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "Content-Type: application/json" \
    "https://discoveryengine.googleapis.com/v1beta/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/schemas/default_schema" \
    -d '{
      "structSchema": JSON_SCHEMA_OBJECT
    }'
    

    ๋‹ค์Œ์„ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค.

    • PROJECT_ID: Google Cloud ํ”„๋กœ์ ํŠธ์˜ ID์ž…๋‹ˆ๋‹ค.
    • DATA_STORE_ID: ์ถ”์ฒœ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์˜ ID์ž…๋‹ˆ๋‹ค.
    • JSON_SCHEMA_OBJECT: JSON ๊ฐ์ฒด๋กœ ๋œ JSON ์Šคํ‚ค๋งˆ์ž…๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

      {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "keyPropertyMapping": "title"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string",
              "keyPropertyMapping": "category"
            }
          },
          "uri": {
            "type": "string",
            "keyPropertyMapping": "uri"
          }
        }
      }
      
  3. ์ •์˜๋œ ์Šคํ‚ค๋งˆ๋ฅผ ์ค€์ˆ˜ํ•˜๋Š” ๊ตฌ์กฐํ™”๋œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.

    ๋ฐ์ดํ„ฐ๋ฅผ ์—…๋กœ๋“œํ•  ๋•Œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๋ช‡ ๊ฐ€์ง€ ๋ฐฉ๋ฒ•์ด ์žˆ์Šต๋‹ˆ๋‹ค.

    • JSON ๋ฌธ์„œ๋ฅผ ์—…๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค.

      curl -X POST \
      -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      -H "Content-Type: application/json" \
      "https://discoveryengine.googleapis.com/v1beta/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/documents?documentId=DOCUMENT_ID" \
      -d '{
        "jsonData": "JSON_DOCUMENT_STRING"
      }'
      

      JSON_DOCUMENT_STRING์„ ๋‹จ์ผ ๋ฌธ์ž์—ด ํ˜•์‹์œผ๋กœ ์ง€์ •๋œ JSON ๋ฌธ์„œ๋กœ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค. ์ด์ „ ๋‹จ๊ณ„์—์„œ ์ œ๊ณตํ•œ JSON ์Šคํ‚ค๋งˆ๋ฅผ ์ค€์ˆ˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

      ```none
      { \"title\": \"test title\", \"categories\": [\"cat_1\", \"cat_2\"], \"uri\": \"test uri\"}
      ```
      
    • JSON ๊ฐ์ฒด๋ฅผ ์—…๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค.

      curl -X POST \
      -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      -H "Content-Type: application/json" \
      "https://discoveryengine.googleapis.com/v1beta/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/documents?documentId=DOCUMENT_ID" \
      -d '{
        "structData": JSON_DOCUMENT_OBJECT
      }'
      

      JSON_DOCUMENT_OBJECT๋ฅผ JSON ๊ฐ์ฒด ํ˜•์‹์œผ๋กœ ์ง€์ •๋œ JSON ๋ฌธ์„œ๋กœ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค. ์ด์ „ ๋‹จ๊ณ„์—์„œ ์ œ๊ณตํ•œ JSON ์Šคํ‚ค๋งˆ๋ฅผ ์ค€์ˆ˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

      ```json
      {
        "title": "test title",
        "categories": [
          "cat_1",
          "cat_2"
        ],
        "uri": "test uri"
      }
      ```
      
    • JSON ๋ฌธ์„œ๋กœ ์—…๋ฐ์ดํŠธํ•ฉ๋‹ˆ๋‹ค.

      curl -X PATCH \
      -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      -H "Content-Type: application/json" \
      "https://discoveryengine.googleapis.com/v1beta/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/documents/DOCUMENT_ID" \
      -d '{
        "jsonData": "JSON_DOCUMENT_STRING"
      }'
      
    • JSON ๊ฐ์ฒด๋กœ ์—…๋ฐ์ดํŠธํ•ฉ๋‹ˆ๋‹ค.

      curl -X PATCH \
      -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      -H "Content-Type: application/json" \
      "https://discoveryengine.googleapis.com/v1beta/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/documents/DOCUMENT_ID" \
      -d '{
        "structData": JSON_DOCUMENT_OBJECT
      }'
      

๋‹ค์Œ ๋‹จ๊ณ„

  • ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ์•ฑ์— ์—ฐ๊ฒฐํ•˜๋ ค๋ฉด ์•ฑ์„ ๋งŒ๋“ค๊ณ  ๋งž์ถค ์ถ”์ฒœ ์•ฑ ๋งŒ๋“ค๊ธฐ์˜ ๋‹จ๊ณ„๋ฅผ ๋”ฐ๋ผ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  • ์•ฑ ๋ฐ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ์„ค์ •ํ•œ ํ›„ ์ถ”์ฒœ์ด ํ‘œ์‹œ๋˜๋Š” ๋ฐฉ์‹์„ ๋ฏธ๋ฆฌ๋ณด๋ ค๋ฉด ์ถ”์ฒœ ๊ฐ€์ ธ์˜ค๊ธฐ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

Terraform์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด ๋งŒ๋“ค๊ธฐ

Terraform์„ ์‚ฌ์šฉํ•˜์—ฌ ๋นˆ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋นˆ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“  ํ›„ Google Cloud ์ฝ˜์†” ๋˜๋Š” API ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด์— ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Terraform ๊ตฌ์„ฑ์„ ์ ์šฉํ•˜๊ฑฐ๋‚˜ ์‚ญ์ œํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๊ธฐ๋ณธ Terraform ๋ช…๋ น์–ด๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

Terraform์„ ์‚ฌ์šฉํ•˜์—ฌ ๋นˆ ๋ฐ์ดํ„ฐ ์Šคํ† ์–ด๋ฅผ ๋งŒ๋“ค๋ ค๋ฉด google_discovery_engine_data_store๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.