

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 為您的使用者設定 Amazon Q Developer
<a name="studio-updated-amazon-q-admin-guide-set-up"></a>

Amazon Q Developer 是生成式 AI 對話助理。您可以在新網域或現有網域內設定 Amazon Q Developer。使用下列資訊來設定 Amazon Q Developer。

透過 Amazon Q Developer，您的使用者可以：
+ 接收有關獨立或與其他 AWS 服務結合使用 SageMaker AI step-by-step指導。
+ 取得範例程式碼以開始使用 ML 任務，例如資料準備、訓練、推論和 MLOps。
+ 接收故障診斷協助，以偵錯並解決執行程式碼時遇到的錯誤。

**注意**  
無論您使用免費方案還是專業方案訂閱，Studio 中的 Amazon Q Developer 都不會使用使用者內容來改善服務。對於 IDE 層級遙測共用，Amazon Q 可能會追蹤您使用者的用量，例如提出的問題數量，以及接受還是拒絕建議。此遙測資料不包含個人可識別資訊，例如使用者的 IP 位址。如需資料保護和選擇退出指示的詳細資訊，請參閱[在 IDE 中選擇退出資料共用](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/opt-out-IDE.html)。

您可以使用專業方案或免費方案訂閱來設定 Amazon Q Developer。專業方案是一種付費訂閱服務，其中提供更高的用量限制和其他功能。如需方案之間差異的詳細資訊，請參閱[了解 Amazon Q Developer 的服務層](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/q-tiers.html)。

如需訂閱 Amazon Q Developer 專業方案的相關資訊，請參閱[訂閱 Amazon Q Developer 專業方案](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/q-admin-setup-subscribe-general.html)。

## Amazon Q Developer 免費方案的設定指示：
<a name="studio-updated-amazon-q-developer-free-tier-set-up"></a>

若要設定 Amazon Q Developer 免費方案，請使用下列程序：

**設定 Amazon Q Developer 免費方案**

1. 將下列政策新增至您已用來建立 JupyterLab 或程式碼編輯器空間的 IAM 角色：

------
#### [ JSON ]

****  

   ```
   {
   	"Version":"2012-10-17",		 	 	 
   	"Statement": [
   		{
   			"Effect": "Allow",
   			"Action": [
   				"q:SendMessage"
   			],
   			"Resource": [
   				"*"
   			]
   		},
   		{
   			"Sid": "AmazonQDeveloperPermissions",
   			"Effect": "Allow",
   			"Action": [
   				"codewhisperer:GenerateRecommendations"
   			],
   			"Resource": "*"
   		}
   	]
   }
   ```

------

1. 導覽至 Amazon SageMaker Studio。

1. 開啟您的 JupyterLab 或程式碼編輯器空間。

1. 導覽至**啟動器**，然後選擇**終端機**。

1. 在 JupyterLab 中，執行下列動作：

   1. 指定 `restart-jupyter-server`。

   1. 重新啟動您的瀏覽器並導覽回 Amazon SageMaker Studio。

## Amazon Q Developer 專業方案的設定指示：
<a name="studio-updated-amazon-q-developer-pro-set-up"></a>

**先決條件**  
若要設定 Amazon Q Pro，您必須具有下列先決條件：  
為您組織設定的 Amazon SageMaker AI 網域，其中 IAM Identity Center 設定為存取方法。
Amazon Q Developer 專業方案訂閱。

如果您要更新已為組織設定的網域，則需要更新該網域，才能使用 Amazon Q Developer。您可以使用 AWS 管理主控台 或 AWS Command Line Interface 來更新網域。

您必須使用 Amazon Q Developer 設定檔的 ARN。您可以在 [Q Developer 設定](https://console.aws.amazon.com/amazonq/developer/settings)頁面上找到 Q 設定檔 ARN。

您可以使用下列 AWS Command Line Interface 命令來更新您的網域：

```
aws --region AWS 區域 sagemaker update-domain --domain-id domain-id --domain-settings-for-update "AmazonQSettings={Status=ENABLED,QProfileArn=Q-Profile-ARN}"           
```

您也可以使用下列程序來更新 AWS 管理主控台內的網域。

1. 導覽至 [Amazon SageMaker AI](https://console.aws.amazon.com/sagemaker) 主控台。

1. 選擇網域。

1. 選取**應用程式組態**。

1. 針對 **Amazon Q Developer for SageMaker AI 應用程式**，選擇**編輯**。

1. 選取**在此網域上啟用 Amazon Q Developer**。

1. 提供 Q 設定檔 ARN。

1. 選擇**提交**。

您必須使用 Amazon Q Developer 設定檔的 ARN。您可以在 [Amazon Q Developer](https://console.aws.amazon.com/amazonq/developer) 主控台的 **Amazon Q 帳戶詳細資訊**頁面上找到 Q 設定檔的 ARN。

**為組織設定**是 Amazon SageMaker AI 網域的進階設定，可讓您使用 IAM Identity Center。如需如何設定網域的相關資訊，以及設定 IAM Identity Center 的相關資訊，請參閱[使用 Amazon SageMaker AI 的自訂設定](onboard-custom.md)。

在新網域中設定 Amazon Q Developer 時，您可以從本機電腦使用 AWS 管理主控台 或下列 AWS Command Line Interface 命令：

```
                    
aws --region AWS 區域 sagemaker create-domain --domain-id domain-id --domain-name "example-domain-name" --vpc-id example-vpc-id --subnet-ids example-subnet-ids --auth-mode SSO --default-user-settings "ExecutionRole=arn:aws:iam::111122223333:role/IAM-role",--domain-settings "AmazonQSettings={status=ENABLED,qProfileArn=Q-profile-ARN" --query example-domain-ARN--output text
```

您可以使用下列 AWS CLI 命令來停用 Amazon Q Developer：

```
aws --region AWS 區域 sagemaker update-domain --domain-id domain-id --domain-settings-for-update "AmazonQSettings={Status=DISABLED,QProfileArn=Q-Profile-ARN}"           
```

我們建議您使用最新版的 AWS Command Line Interface。如需更新 的資訊 AWS CLI，請參閱[安裝或更新至最新版本的 AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)。

如果您需要在 Amazon Q Developer 與 VPC 之間建立連線，請參閱[為 Amazon Q 建立介面 VPC 端點](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/vpc-interface-endpoints.html#vpc-endpoint-create)。

**注意**  
Amazon Q Developer 有下列限制：  
它不支援共用空間。
Amazon Q Developer 會偵測程式碼建議是否可能與公開可用的程式碼太相似。參考追蹤器可以使用儲存庫 URL 和授權標記建議，或將其篩選掉。這可讓您在採用之前檢閱參考的程式碼及其用法。系統會記錄所有參考以供您稍後檢閱，來確保您的程式碼流程不會受到干擾，而且您可以繼續編碼，而不會中斷。  
如需程式碼參考的詳細資訊，請參閱[使用程式碼參考 - Amazon Q Developer](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/code-reference.html) 和 [AI 編碼助理 - Amazon Q Developer 常見問答集](https://aws.amazon.com/q/developer/faqs/?refid=255ccf7b-4a76-4dcb-9b07-68709e2b636b#:~:text=Can%20I%20prevent%20Amazon%20Q%20Developer%20from%20recommending%20code%20with%20code%20references%3F)。
Amazon Q 會處理美國東部 (維吉尼亞北部) AWS 區域內的所有使用者互動資料。如需 Amazon Q 如何處理資料及其支援的 AWS 區域 的詳細資訊，請參閱 [Amazon Q Developer 支援的區域](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/regions.html)。
Amazon Q 僅在 Amazon SageMaker Studio 內運作。Amazon SageMaker Studio Classic 內不支援它。
在 JupyterLab 上，Amazon Q 可在 SageMaker AI Distribution 映像 2.0 版及更新版本內運作。在程式碼編輯器上，Amazon Q 可在 SageMaker AI Distribution 映像 2.2.1 版及更新版本內運作。
JupyterLab 中的 Amazon Q Developer 可在 Jupyter AI 延伸模組內運作。使用 Amazon Q 時，您無法在延伸模組內使用其他 3P 模型。

## 中的 Amazon Q 自訂 Amazon SageMaker AI
<a name="q-customizations-in-sagemaker"></a>

如果使用 Amazon Q Developer 專業方案，您可以選擇建立*自訂*。透過自訂，Amazon Q Developer 會根據您公司的程式碼庫提供建議。如果您在 Amazon Q Developer 中建立自訂，則這些自訂會變成可用，讓您用於 Amazon SageMaker Studio 的 JupyterLab 和程式碼編輯器。如需設定自訂的詳細資訊，請參閱《Amazon Q Developer 使用者指南》**中的[自訂建議](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/customizations.html)。