Skip to content

Commit

Permalink
Document VertexAI authentication (langchain4j#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
langchain4j authored Jan 9, 2024
1 parent 9a71a4c commit 45a1133
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@
/**
* Represents a Google Vertex AI Gemini language model with a chat completion interface, such as gemini-pro.
* See details <a href="https://cloud.google.com/vertex-ai/docs/generative-ai/model-reference/gemini">here</a>.
* <br>
* Please follow these steps before using this model:
* <br>
* 1. <a href="https://github.com/googleapis/java-aiplatform?tab=readme-ov-file#authentication">Authentication</a>
* <br>
* When developing locally, you can use one of:
* <br>
* a) <a href="https://github.com/googleapis/google-cloud-java?tab=readme-ov-file#local-developmenttesting">Google Cloud SDK</a>
* <br>
* b) <a href="https://github.com/googleapis/google-cloud-java?tab=readme-ov-file#using-a-service-account-recommended">Service account</a>
* When using service account, ensure that <code>GOOGLE_APPLICATION_CREDENTIALS</code> environment variable points to your JSON service account key.
* <br>
* 2. <a href="https://github.com/googleapis/java-aiplatform?tab=readme-ov-file#authorization">Authorization</a>
* <br>
* 3. <a href="https://github.com/googleapis/java-aiplatform?tab=readme-ov-file#prerequisites">Prerequisites</a>
*/
public class VertexAiGeminiChatModel implements ChatLanguageModel {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@
/**
* Represents a Google Vertex AI language model with a chat completion interface, such as chat-bison.
* See details <a href="https://cloud.google.com/vertex-ai/docs/generative-ai/chat/chat-prompts">here</a>.
* <br>
* Please follow these steps before using this model:
* <br>
* 1. <a href="https://github.com/googleapis/java-aiplatform?tab=readme-ov-file#authentication">Authentication</a>
* <br>
* When developing locally, you can use one of:
* <br>
* a) <a href="https://github.com/googleapis/google-cloud-java?tab=readme-ov-file#local-developmenttesting">Google Cloud SDK</a>
* <br>
* b) <a href="https://github.com/googleapis/google-cloud-java?tab=readme-ov-file#using-a-service-account-recommended">Service account</a>
* When using service account, ensure that <code>GOOGLE_APPLICATION_CREDENTIALS</code> environment variable points to your JSON service account key.
* <br>
* 2. <a href="https://github.com/googleapis/java-aiplatform?tab=readme-ov-file#authorization">Authorization</a>
* <br>
* 3. <a href="https://github.com/googleapis/java-aiplatform?tab=readme-ov-file#prerequisites">Prerequisites</a>
*/
public class VertexAiChatModel implements ChatLanguageModel {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@
/**
* Represents a Google Vertex AI embedding model, such as textembedding-gecko.
* See details <a href="https://cloud.google.com/vertex-ai/docs/generative-ai/embeddings/get-text-embeddings">here</a>.
* <br>
* Please follow these steps before using this model:
* <br>
* 1. <a href="https://github.com/googleapis/java-aiplatform?tab=readme-ov-file#authentication">Authentication</a>
* <br>
* When developing locally, you can use one of:
* <br>
* a) <a href="https://github.com/googleapis/google-cloud-java?tab=readme-ov-file#local-developmenttesting">Google Cloud SDK</a>
* <br>
* b) <a href="https://github.com/googleapis/google-cloud-java?tab=readme-ov-file#using-a-service-account-recommended">Service account</a>
* When using service account, ensure that <code>GOOGLE_APPLICATION_CREDENTIALS</code> environment variable points to your JSON service account key.
* <br>
* 2. <a href="https://github.com/googleapis/java-aiplatform?tab=readme-ov-file#authorization">Authorization</a>
* <br>
* 3. <a href="https://github.com/googleapis/java-aiplatform?tab=readme-ov-file#prerequisites">Prerequisites</a>
*/
public class VertexAiEmbeddingModel implements EmbeddingModel {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@
/**
* Represents a Google Vertex AI language model with a text interface, such as text-bison.
* See details <a href="https://cloud.google.com/vertex-ai/docs/generative-ai/text/text-overview">here</a>.
* <br>
* Please follow these steps before using this model:
* <br>
* 1. <a href="https://github.com/googleapis/java-aiplatform?tab=readme-ov-file#authentication">Authentication</a>
* <br>
* When developing locally, you can use one of:
* <br>
* a) <a href="https://github.com/googleapis/google-cloud-java?tab=readme-ov-file#local-developmenttesting">Google Cloud SDK</a>
* <br>
* b) <a href="https://github.com/googleapis/google-cloud-java?tab=readme-ov-file#using-a-service-account-recommended">Service account</a>
* When using service account, ensure that <code>GOOGLE_APPLICATION_CREDENTIALS</code> environment variable points to your JSON service account key.
* <br>
* 2. <a href="https://github.com/googleapis/java-aiplatform?tab=readme-ov-file#authorization">Authorization</a>
* <br>
* 3. <a href="https://github.com/googleapis/java-aiplatform?tab=readme-ov-file#prerequisites">Prerequisites</a>
*/
public class VertexAiLanguageModel implements LanguageModel {

Expand Down

0 comments on commit 45a1133

Please sign in to comment.