Google Vertex AI Embeddings의 기능 및 구성 옵션에 대한 자세한 문서는 API reference를 참조하세요.
Overview
Integration details
| Provider | Package |
|---|---|
| langchain-google-vertexai |
Setup
Google Vertex AI Embeddings 모델에 액세스하려면 다음이 필요합니다:- Google Cloud 계정 생성
langchain-google-vertexaiintegration package 설치
Credentials
Google Cloud로 이동하여 계정을 생성하세요. 완료한 후 GOOGLE_APPLICATION_CREDENTIALS 환경 변수를 설정하세요: 자세한 내용은 다음을 참조하세요: cloud.google.com/docs/authentication/application-default-credentials#GAC googleapis.dev/python/google-auth/latest/reference/google.auth.html#module-google.auth 선택사항: 노트북 환경 인증 (Colab 전용) Google Colab에서 이 노트북을 실행하는 경우, 아래 셀을 실행하여 환경을 인증하세요.Installation
LangChain Google Vertex AI Embeddings integration은langchain-google-vertexai package에 있습니다:
Instantiation
이제 모델 객체를 인스턴스화하고 embedding을 생성할 수 있습니다:지원되는 모델 목록을 확인하세요
Indexing and Retrieval
Embedding 모델은 데이터 인덱싱과 나중에 검색하는 과정 모두에서 retrieval-augmented generation (RAG) 플로우에 자주 사용됩니다. 자세한 지침은 RAG tutorials를 참조하세요. 아래에서는 위에서 초기화한embeddings 객체를 사용하여 데이터를 인덱싱하고 검색하는 방법을 확인할 수 있습니다. 이 예제에서는 InMemoryVectorStore에서 샘플 문서를 인덱싱하고 검색합니다.
Direct Usage
내부적으로 vectorstore와 retriever 구현은embeddings.embed_documents(...)와 embeddings.embed_query(...)를 호출하여 from_texts 및 retrieval invoke 작업에 사용되는 텍스트에 대한 embedding을 생성합니다.
이러한 메서드를 직접 호출하여 자신의 사용 사례에 맞는 embedding을 얻을 수 있습니다.
Embed single texts
embed_query를 사용하여 단일 텍스트 또는 문서를 embedding할 수 있습니다:
Embed multiple texts
embed_documents를 사용하여 여러 텍스트를 embedding할 수 있습니다:
API reference
Google Vertex AI Embeddings의 기능 및 구성 옵션에 대한 자세한 문서는 API reference를 참조하세요.
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.