Skip to content

Commit

Permalink
fix for issue #633 adding instructions for additional artifact for Op… (
Browse files Browse the repository at this point in the history
#634)

fixes the documentation to add dependency for compiling 

```java
OpenAiChatModel model = OpenAiChatModel.withApiKey(apiKey);
```
  • Loading branch information
sshaaf committed Feb 13, 2024
1 parent 197b4af commit 3e43248
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/docs/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,22 @@ implementation 'dev.langchain4j:langchain4j:0.27.1'

The easiest way to get started is with the OpenAI integration.

Langchain4j has multiple integrations with LLMs. Depending on the integration/s, the artifact/s must be specified as a project dependency. In this case, we should also add the OpenAI dependency as that will be used in the following example.

```xml
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-open-ai</artifactId>
<version>0.27.1</version>
</dependency>
```

- For Gradle project `build.gradle`

```groovy
implementation 'dev.langchain4j:langchain4j-open-ai:0.27.1'
```

First, import your OpenAI API key.
It's recommended to store your API keys in environment variables to reduce the risk of exposing them publicly.
```java
Expand Down

0 comments on commit 3e43248

Please sign in to comment.