Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
HamaWhiteGG committed Jun 1, 2023
1 parent 9c3802a commit 7894792
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ This library is aimed at assisting in the development of those types of applicat
Looking for the Python version? Check out [LangChain](https://github.com/hwchase17/langchain).

## Examples
Here's a simple [example](https://sourcegraph.com/github.com/HamaWhiteGG/langchain-java@main/-/blob/langchain-core/src/test/java/com/hw/langchain/llms/openai/OpenAiTest.java?L34:10&popover=pinned) of using langchain-java to interact with OpenAI:
Here's a simple example of using langchain-java to interact with OpenAI:

```java
@Test
void testOpenAiCall() {
OpenAI openAI = OpenAI.builder()
.proxy(ProxyUtils.http("127.0.0.1", 1087))
@Test
void testOpenAICall() {
OpenAI llm = OpenAI.builder()
.openaiProxy(ProxyUtils.http("127.0.0.1", 1087))
.maxTokens(10)
.build()
.init();

assertThat(openAI.call("Say foo:")).isEqualTo("\n\nFoo!");
}
assertThat(llm.call("Say foo:")).isEqualTo("\n\nFoo!");
}
```

## Run Test from Source
Expand Down

0 comments on commit 7894792

Please sign in to comment.