클라이언트 라이브러리는 Agent Platform API를 호출하는 최적화된 개발자 환경을 제공합니다. 클라이언트 라이브러리는 지원되는 각 언어의 고유한 규칙을 사용하며 작성해야 하는 상용구 코드를 줄입니다. 다음 가이드에서는 라이브러리를 설치하고 로컬 개발 환경에서 이를 사용하기 위한 인증을 설정하는 방법을 설명합니다.
시작하기 전에
- 계정에 로그인합니다. Google Cloud 를 처음 사용하는 경우 Google Cloud, 계정을 만들고 Google 제품의 실제 성능을 평가해 보세요. 신규 고객에게는 워크로드를 실행, 테스트, 배포하는 데 사용할 수 있는 $300의 무료 크레딧이 제공됩니다.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
Enable the Agent Platform API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
Enable the Agent Platform API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
로컬 셸을 사용하는 경우 사용자 계정에 대한 로컬 인증 사용자 인증 정보를 만듭니다.
gcloud auth application-default login
Cloud Shell을 사용하는 경우 이 작업을 수행할 필요는 없습니다.
인증 오류가 반환되고 외부 ID 공급업체(IdP)를 사용하는 경우 제휴 ID로 gcloud CLI에 로그인했는지 확인합니다.
클라이언트 라이브러리
Agent Platform은 다음 언어로 클라이언트 라이브러리를 제공합니다. 사용할 언어를 선택합니다.
C#
다음 명령어를 실행하여 프로젝트 파일에 Google.Cloud.AIPlatform.V1 패키지 참조를 추가합니다.
dotnet add package Google.Cloud.AIPlatform.V1
코드 샘플 사용해 보기
개별 코드 샘플을 보거나 가져오려면 dotnet-aiplatform GitHub 저장소로 이동합니다.
클라이언트 라이브러리 문서
자세한 내용은 Agent Platform .NET 클라이언트 라이브러리 문서를 참조하세요.
자바
Maven을 사용하는 경우 종속 항목에 다음을 추가합니다.
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-aiplatform</artifactId>
<version>3.35.0</version>
</dependency>
Gradle을 사용하는 경우 종속 항목에 다음을 추가합니다.
compile 'com.google.cloud:google-cloud-aiplatform:3.35.0'
SBT를 사용하는 경우 종속 항목에 다음을 추가합니다.
libraryDependencies += "com.google.cloud" % "google-cloud-aiplatform" % "3.35.0"
코드 샘플 사용해 보기
개별 코드 샘플을 보거나 가져오려면 java-aiplatform GitHub 저장소로 이동합니다.
클라이언트 라이브러리 문서
자세한 내용은 자바용 Agent Platform 클라이언트 라이브러리 문서를 참조하세요.
Node.js
라이브러리를 설치하기 전에 Node.js 개발을 위한 환경을 준비합니다.
환경에서 다음 명령어를 실행하여 클라이언트 라이브러리를 설치합니다.
npm install @google-cloud/aiplatform
클라이언트 라이브러리 문서
자세한 내용은 Node.js 용 Agent Platform 클라이언트 라이브러리 문서를 참조하세요.
Python
Gemini Enterprise Agent Platform Python 클라이언트 라이브러리는 Python용 Agent Platform SDK를 설치할 때 설치됩니다.
자세한 내용은 Python용 Agent Platform SDK 설치를 참조하세요.
Go
라이브러리를 설치하기 전에 Go 개발을 위한 환경을 준비합니다.
사용 가능한 패키지 검토
사용 가능한 Agent Platform API Go 패키지를 검토하여 프로젝트 요구에 가장 적합한 패키지를 확인합니다.
패키지 cloud.google.com/go/vertexai (권장)
vertexai는 일반적인 기능에 대한 액세스를 제공하는 인간이 작성한 패키지입니다.이 패키지는 Agent Platform API를 사용하여 빌드하는 대부분의 개발자에게 시작점으로 권장됩니다. 이 패키지에 아직 포함되지 않은 기능을 이용하려면 자동 생성된
aiplatform을 사용하세요.패키지 cloud.google.com/go/aiplatform
aiplatform은 자동 생성된 패키지입니다.이 패키지는 인간이 작성한
vertexai패키지에서 아직 제공하지 않는 Agent Platform API 기능에 액세스해야 하는 프로젝트를 대상으로 합니다.
설치
패키지 cloud.google.com/go/vertexai (권장)
다음 명령어를 실행하여 환경에 이 패키지를 설치합니다.
go get cloud.google.com/go/vertexai패키지 cloud.google.com/go/aiplatform
다음 명령어를 실행하여 환경에 이 패키지를 설치합니다.
go get cloud.google.com/go/aiplatform
샘플
패키지 cloud.google.com/go/vertexai (권장)
이 패키지를 사용한 샘플은 최상위
vertexai디렉터리의golang-samplesGitHub 저장소에서 확인할 수 있습니다.패키지 cloud.google.com/go/aiplatform
이 패키지를 사용한 샘플은 최상위
aiplatform디렉터리의golang-samplesGitHub 저장소에서 확인할 수 있습니다.
클라이언트 라이브러리 문서
라이브러리에 대한 자세한 내용은 Go용 Agent Platform 클라이언트 라이브러리 문서를 참조하세요.
패키지 cloud.google.com/go/vertexai (권장)
- Gemini Enterprise Agent Platform
cloud.google.com/go/vertexaiAPI 참조
- Gemini Enterprise Agent Platform