이 문서 페이지에서는 Gemini 지원을 사용하여 LookML 프로젝트에서 측정기준, 측정기준 그룹, 측정항목을 만드는 방법을 설명합니다. 작성된 프롬프트에 대한 응답으로 LookML 코드 제안을 생성하는 것은 Looker (원본) 및 Looker (Google Cloud 핵심 서비스) 인스턴스에서 사용할 수 있는 Looker의 Gemini 기능입니다.
요청에 따라 Gemini는 다른 뷰 파일의 필드를 참조하는 LookML을 제안할 수 있습니다. 제안된 LookML을 파일에 추가한 후 파일을 저장하고 LookML 검사기를 실행합니다. 모델 파일에 include 문을 추가해야 하는 경우 LookML 검사기에 오류가 표시됩니다.
Explore에서 이 LookML을 확인하려면 새 coordinates 필드와 함께 이 필드를 기반으로 한 longitude 및 latitude 필드를 선택하면 됩니다. Gemini가 type:location을 사용하여 측정기준을 만들었으므로 Explore 결과에는 지도에서 좌표를 볼 수 있는 하이퍼링크가 포함됩니다.
오늘의 총 매출 측정항목 만들기
다음은 Gemini에 오늘의 모든 주문 합계에 대한 새 측정항목을 만들도록 요청하는 측정항목 만들기 옵션을 사용하는 프롬프트입니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[],[],null,["# Write LookML with Gemini assistance\n\n\u003cbr /\u003e\n\n|\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis documentation page describes how to use Gemini assistance to create dimensions, dimension groups, and measures, in a LookML project. Generating LookML code suggestions in response to written prompts is a Gemini in Looker feature that is available in Looker (original) and Looker (Google Cloud core) instances.\n\n[Gemini in Looker](/looker/docs/overview-gemini) provides generative AI-powered assistance to help you work with your data.\n\nLearn [how and when Gemini\nfor Google Cloud uses your data](/gemini/docs/discover/data-governance).\n\nThis page is intended for Looker developers.\n\nBefore you begin\n----------------\n\nTo use Gemini in the Looker IDE, note the following requirements:\n\n- Gemini in Looker must be enabled for your Looker instance:\n - For Looker (original), the instance must be running Looker 25.2 or later, and the instance must be enabled for Gemini in Looker in the Admin settings. For detailed enablement instructions, see the [Admin settings --- Gemini in Looker](/looker/docs/admin-panel-platform-gil) documentation page.\n - For [Looker (Google Cloud core)](/looker/docs/overview-gemini) the instance must be enabled for Gemini in Looker in the Google Cloud console. For detailed enablement instructions, see the [Administer Gemini on your Looker (Google Cloud core) instance](/looker/docs/looker-core-admin-gemini) documentation page.\n- You must be assigned a Looker role that contains the [`develop`](/looker/docs/admin-panel-users-roles#develop) permission for at least one model in a LookML project.\n- You must be assigned the Looker [**Gemini**](/looker/docs/admin-panel-users-roles#gemini) role.\n\nUse Gemini in the Looker IDE\n----------------------------\n\n| As an early-stage technology, Gemini for Google Cloud\n| products can generate output that seems plausible but is factually incorrect. We recommend that you\n| validate all output from Gemini for Google Cloud products before you use it.\n| For more information, see\n| [Gemini for Google Cloud and responsible AI](/gemini/docs/discover/responsible-ai).\n\nTo use Gemini for creating LookML in your Looker project, follow these steps:\n\n1. On your Looker instance, enable [Development Mode](/looker/docs/dev-mode-prod-mode#development_mode).\n2. [Open your project in the Looker IDE](/looker/docs/looker-ide#accessing-ide).\n3. Use the IDE [file browser](/looker/docs/ide-folders) to open a LookML view file in which you want to insert LookML.\n4. Select the **Help me code** icon from the side panel selector.\n\n5. With the the **Help me code** panel open, click to place your cursor on a line in your LookML view file. Based on the type of LookML file and where your cursor is placed in the file, Gemini provides appropriate options to guide you, such as **Create a dimension** or **Create a measure**.\n\n6. Select one of the following options from the **Help me code** panel:\n\n | **Note:** If you don't see all of these options, make sure that you are in a view file and that your cursor is placed at a location in the file where a dimension, dimension group, or measure is supported.\n - **Create a [dimension group](/looker/docs/reference/param-field-dimension-group)**\n - **Create a [dimension](/looker/docs/reference/param-field-dimension)**\n - **Create a [measure](/looker/docs/reference/param-field-measure)**\n - **Other code suggestion** : You can use the **other code suggestion** option if you want to try out different LookML elements. Remember that Gemini is an early-stage technology, so validate and test all output before deploying it.\n7. In the **Help me code** panel text field, use conversational language to describe the dimension, dimension group, or measure that you want to create. See the [Tips for using Gemini in the Looker IDE](#tips) and [Sample prompts](#samples) sections on this page for guidance.\n\n8. Press **Enter** or click the **Submit** icon to send your request to Gemini. Gemini will respond with suggested code.\n\n9. With the suggested code, you can do the following:\n\n - Hold your pointer over the **Insert** button to preview the suggested LookML in your file. You can move your cursor to a different line in your file to preview it in a different location before inserting the LookML in the file.\n - Click the **Edit** button to manually change the suggested LookML.\n - Click the **Insert** button to insert the LookML into your file at the location of your cursor.\n - Provide feedback about the suggested code by selecting the thumbs up icon (**This response was helpful** ) or thumbs down icon (**This response was not what I expected**).\n - Click the **New code suggestion** link to start over and enter a new prompt for Gemini.\n\n10. Click **Save Changes** in your LookML file.\n\n11. Verify the LookML by doing the following:\n\n - Use the [LookML Validator](/looker/docs/lookml-validation) to verify your LookML.\n - [Test your LookML in an Explore](/looker/docs/looker-ide#testing_the_fields_in_the_explore).\n\nTips for using Gemini in the Looker IDE\n---------------------------------------\n\nHere are some tips for using Gemini in the Looker IDE:\n\n- For best results, write your prompts in American English. See the [Gemini for Google Cloud limitations](/gemini/docs/discover/responsible-ai#gemini-limitations) documentation for more information.\n- The **Help me code** panel does not retain context from a previous prompt in the conversation and does not retain prompts across logins and refreshes.\n- When you use LookML that was suggested by Gemini, always validate your LookML with the [LookML Validator](/looker/docs/lookml-validation), and [test your new fields in an Explore](/looker/docs/looker-ide#testing_the_fields_in_the_explore).\n- Depending on your request, Gemini may suggest LookML that references fields in other view files. When you add suggested LookML to your file, save the file and run the LookML Validator. The LookML Validator will display errors if you need to add [`include`](/looker/docs/reference/param-model-include) statements to your model file.\n\nSample prompts\n--------------\n\nTo give you some ideas, here are some example prompts and their results:\n\n- [Create a dimension using longitude and latitude](#create-dimension)\n- [Create a measure for today's total sales](#create-measure)\n\n### Create a dimension using longitude and latitude\n\nHere is a prompt using the **Create a dimension** option that asks Gemini to create a new dimension based on the `longitude` and `latitude` fields that are defined in the view file:\n\n`show coordinates with longitude and latitude`\n\nGemini returns this suggested code: \n\n dimension: coordinates {\n type: location\n sql_latitude: ${TABLE}.latitude ;;\n sql_longitude: ${TABLE}.longitude ;;\n }\n\nYou can verify this LookML in an Explore by selecting the new `coordinates` field, along with the `longitude` and `latitude` fields it's based on. Because Gemini created the dimension using [`type:location`](/looker/docs/reference/param-dimension-filter-parameter-types#location), the Explore results include a hyperlink to view the coordinates on a map:\n\n### Create a measure for today's total sales\n\nHere is a prompt using the **Create a measure** option that asks Gemini to create a new measure for the sum of all of today's orders:\n\n`show the total sale price of today's orders`\n\nGemini returns this suggested code: \n\n measure: todays_orders {\n type: sum\n sql: ${basic_order_items.sale_price} ;;\n filters: [basic_order_items.created_at_date: \"today\"]\n }\n\nProvide feedback\n----------------\n\nYou can provide feedback for the generated LookML in the **Help me code** panel. If the generated LookML looks correct, click the thumb_up thumbs-up icon. If the generated LookML looks incorrect or isn't what you expected, click the thumb_down thumbs-down icon.\n| **Note:** Gemini in Looker is in preview with limited support. We encourage you to share your feedback to help us improve. To report bugs or issues, reach out to [Looker Support](/looker/docs/best-practices/looker-support-details) and be sure to include the following details:\n|\n| - A clear description of the problem and the expected behavior\n| - Steps to reproduce the issue\n| - Any additional relevant details\n\nRelated resources\n-----------------\n\n- [Learn more about Gemini for Google Cloud](/gemini/docs/overview)\n- [Learn more about Gemini in Looker](/looker/docs/overview-gemini)"]]