Skip to content

Commit

Permalink
Fix AzureOpenAiStreamingChatModel constructor get or default new Toke…
Browse files Browse the repository at this point in the history
…nizer (langchain4j#1282)

## Issue
I found during unit testing

## Change
`AzureOpenAiStreamingChatModel` constructor get or default new Tokenizer
Referenced `OpenAiStreamingChatModel`

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [ ] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [ ] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
  • Loading branch information
Kugaaa authored Jun 26, 2024
1 parent f381e47 commit 7e95f6d
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import reactor.core.publisher.Flux;

import java.time.Duration;
import java.util.Collection;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -236,7 +235,7 @@ private AzureOpenAiStreamingChatModel(String deploymentName,
List<ChatModelListener> listeners) {

this.deploymentName = getOrDefault(deploymentName, "gpt-35-turbo");
this.tokenizer = tokenizer;
this.tokenizer = getOrDefault(tokenizer, AzureOpenAiTokenizer::new);
this.maxTokens = maxTokens;
this.temperature = getOrDefault(temperature, 0.7);
this.topP = topP;
Expand Down

0 comments on commit 7e95f6d

Please sign in to comment.