Skip to content

Commit 6dc7f85

Browse files
authored
Refactor: replace Lombok annotations with explicit getters and setters and remove lombok dependencies (#140)
<!-- Thank you so much for your contribution! Please fill in all the sections below. Please open the PR as a draft initially. Once it is reviewed and approved, we will ask you to add documentation and examples. Please note that PRs with breaking changes or without tests will be rejected. Please note that PRs will be reviewed based on the priority of the issues they address. We ask for your patience. We are doing our best to review your PR as quickly as possible. Please refrain from pinging and asking when it will be reviewed. Thank you for understanding! --> ## Issue <!-- Please specify the ID of the issue this PR is addressing. For example: "Closes #1234" or "Fixes #1234" --> Fixes #[1636](langchain4j/langchain4j#1636) ## Change <!-- Please describe the changes you made. --> - Replaced Lombok annotations with explicit getters and setters. - Removed Lombok dependencies. ## 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/or integration tests for my change - [ ] The tests cover both positive and negative cases - [x] I have manually run all the unit and integration tests in the module I have added/changed, 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 an example in the [examples repo](https://github.com/langchain4j/langchain4j-examples) (only for "big" features) ## Checklist for adding new Spring Boot starter <!-- Please double-check the following points and mark them like this: [X] --> - [ ] I have added my new starter in the root `pom.xml` - [ ] I have added a `org.springframework.boot.autoconfigure.AutoConfiguration.imports` file in the `langchain4j-{integration}-spring-boot-starter/src/main/resources/META-INF/spring/` directory
1 parent 18b0174 commit 6dc7f85

File tree

18 files changed

+783
-95
lines changed

18 files changed

+783
-95
lines changed

langchain4j-anthropic-spring-boot-starter/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@
3232
<optional>true</optional>
3333
</dependency>
3434

35-
<!-- should be listed before spring-boot-configuration-processor -->
36-
<dependency>
37-
<groupId>org.projectlombok</groupId>
38-
<artifactId>lombok</artifactId>
39-
<scope>provided</scope>
40-
</dependency>
41-
4235
<!-- needed to generate automatic metadata about available config properties -->
4336
<dependency>
4437
<groupId>org.springframework.boot</groupId>

langchain4j-anthropic-spring-boot-starter/src/main/java/dev/langchain4j/anthropic/spring/ChatModelProperties.java

Lines changed: 168 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
package dev.langchain4j.anthropic.spring;
22

33
import dev.langchain4j.model.chat.request.ToolChoice;
4-
import lombok.Getter;
5-
import lombok.Setter;
64

75
import java.time.Duration;
86
import java.util.List;
97

10-
@Getter
11-
@Setter
128
class ChatModelProperties {
139

1410
String baseUrl;
@@ -32,4 +28,172 @@ class ChatModelProperties {
3228
Integer maxRetries;
3329
Boolean logRequests;
3430
Boolean logResponses;
31+
32+
public String getBaseUrl() {
33+
return baseUrl;
34+
}
35+
36+
public void setBaseUrl(String baseUrl) {
37+
this.baseUrl = baseUrl;
38+
}
39+
40+
public String getApiKey() {
41+
return apiKey;
42+
}
43+
44+
public void setApiKey(String apiKey) {
45+
this.apiKey = apiKey;
46+
}
47+
48+
public String getVersion() {
49+
return version;
50+
}
51+
52+
public void setVersion(String version) {
53+
this.version = version;
54+
}
55+
56+
public String getBeta() {
57+
return beta;
58+
}
59+
60+
public void setBeta(String beta) {
61+
this.beta = beta;
62+
}
63+
64+
public String getModelName() {
65+
return modelName;
66+
}
67+
68+
public void setModelName(String modelName) {
69+
this.modelName = modelName;
70+
}
71+
72+
public Double getTemperature() {
73+
return temperature;
74+
}
75+
76+
public void setTemperature(Double temperature) {
77+
this.temperature = temperature;
78+
}
79+
80+
public Double getTopP() {
81+
return topP;
82+
}
83+
84+
public void setTopP(Double topP) {
85+
this.topP = topP;
86+
}
87+
88+
public Integer getTopK() {
89+
return topK;
90+
}
91+
92+
public void setTopK(Integer topK) {
93+
this.topK = topK;
94+
}
95+
96+
public Integer getMaxTokens() {
97+
return maxTokens;
98+
}
99+
100+
public void setMaxTokens(Integer maxTokens) {
101+
this.maxTokens = maxTokens;
102+
}
103+
104+
public List<String> getStopSequences() {
105+
return stopSequences;
106+
}
107+
108+
public void setStopSequences(List<String> stopSequences) {
109+
this.stopSequences = stopSequences;
110+
}
111+
112+
public ToolChoice getToolChoice() {
113+
return toolChoice;
114+
}
115+
116+
public void setToolChoice(ToolChoice toolChoice) {
117+
this.toolChoice = toolChoice;
118+
}
119+
120+
public Boolean getCacheSystemMessages() {
121+
return cacheSystemMessages;
122+
}
123+
124+
public void setCacheSystemMessages(Boolean cacheSystemMessages) {
125+
this.cacheSystemMessages = cacheSystemMessages;
126+
}
127+
128+
public Boolean getCacheTools() {
129+
return cacheTools;
130+
}
131+
132+
public void setCacheTools(Boolean cacheTools) {
133+
this.cacheTools = cacheTools;
134+
}
135+
136+
public String getThinkingType() {
137+
return thinkingType;
138+
}
139+
140+
public void setThinkingType(String thinkingType) {
141+
this.thinkingType = thinkingType;
142+
}
143+
144+
public Integer getThinkingBudgetTokens() {
145+
return thinkingBudgetTokens;
146+
}
147+
148+
public void setThinkingBudgetTokens(Integer thinkingBudgetTokens) {
149+
this.thinkingBudgetTokens = thinkingBudgetTokens;
150+
}
151+
152+
public Boolean getReturnThinking() {
153+
return returnThinking;
154+
}
155+
156+
public void setReturnThinking(Boolean returnThinking) {
157+
this.returnThinking = returnThinking;
158+
}
159+
160+
public Boolean getSendThinking() {
161+
return sendThinking;
162+
}
163+
164+
public void setSendThinking(Boolean sendThinking) {
165+
this.sendThinking = sendThinking;
166+
}
167+
168+
public Duration getTimeout() {
169+
return timeout;
170+
}
171+
172+
public void setTimeout(Duration timeout) {
173+
this.timeout = timeout;
174+
}
175+
176+
public Integer getMaxRetries() {
177+
return maxRetries;
178+
}
179+
180+
public void setMaxRetries(Integer maxRetries) {
181+
this.maxRetries = maxRetries;
182+
}
183+
184+
public Boolean getLogRequests() {
185+
return logRequests;
186+
}
187+
188+
public void setLogRequests(Boolean logRequests) {
189+
this.logRequests = logRequests;
190+
}
191+
192+
public Boolean getLogResponses() {
193+
return logResponses;
194+
}
195+
196+
public void setLogResponses(Boolean logResponses) {
197+
this.logResponses = logResponses;
198+
}
35199
}
Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
package dev.langchain4j.anthropic.spring;
22

3-
import lombok.Getter;
4-
import lombok.Setter;
53
import org.springframework.boot.context.properties.ConfigurationProperties;
64
import org.springframework.boot.context.properties.NestedConfigurationProperty;
75

8-
@Getter
9-
@Setter
106
@ConfigurationProperties(prefix = Properties.PREFIX)
117
public class Properties {
128

@@ -17,4 +13,20 @@ public class Properties {
1713

1814
@NestedConfigurationProperty
1915
ChatModelProperties streamingChatModel;
16+
17+
public ChatModelProperties getChatModel() {
18+
return chatModel;
19+
}
20+
21+
public void setChatModel(ChatModelProperties chatModel) {
22+
this.chatModel = chatModel;
23+
}
24+
25+
public ChatModelProperties getStreamingChatModel() {
26+
return streamingChatModel;
27+
}
28+
29+
public void setStreamingChatModel(ChatModelProperties streamingChatModel) {
30+
this.streamingChatModel = streamingChatModel;
31+
}
2032
}

langchain4j-azure-ai-search-spring-boot-starter/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@
3333
<optional>true</optional>
3434
</dependency>
3535

36-
<!-- should be listed before spring-boot-configuration-processor -->
37-
<dependency>
38-
<groupId>org.projectlombok</groupId>
39-
<artifactId>lombok</artifactId>
40-
<scope>provided</scope>
41-
</dependency>
42-
4336
<!-- needed to generate automatic metadata about available config properties -->
4437
<dependency>
4538
<groupId>org.springframework.boot</groupId>
Lines changed: 81 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
package dev.langchain4j.azure.aisearch.spring;
22

33
import dev.langchain4j.rag.content.retriever.azure.search.AzureAiSearchQueryType;
4-
import lombok.Getter;
5-
import lombok.Setter;
64
import org.springframework.boot.context.properties.ConfigurationProperties;
75
import org.springframework.boot.context.properties.NestedConfigurationProperty;
86

9-
@Getter
10-
@Setter
7+
118
@ConfigurationProperties(prefix = Properties.PREFIX)
129
public class Properties {
1310

@@ -19,8 +16,22 @@ public class Properties {
1916
@NestedConfigurationProperty
2017
NestedProperties embeddingStore;
2118

22-
@Getter
23-
@Setter
19+
public NestedProperties getContentRetriever() {
20+
return contentRetriever;
21+
}
22+
23+
public void setContentRetriever(NestedProperties contentRetriever) {
24+
this.contentRetriever = contentRetriever;
25+
}
26+
27+
public NestedProperties getEmbeddingStore() {
28+
return embeddingStore;
29+
}
30+
31+
public void setEmbeddingStore(NestedProperties embeddingStore) {
32+
this.embeddingStore = embeddingStore;
33+
}
34+
2435
public static class NestedProperties {
2536
String endpoint;
2637
String apiKey;
@@ -30,5 +41,69 @@ public static class NestedProperties {
3041
Integer maxResults = 3;
3142
Double minScore;
3243
AzureAiSearchQueryType queryType;
44+
45+
public String getEndpoint() {
46+
return endpoint;
47+
}
48+
49+
public void setEndpoint(String endpoint) {
50+
this.endpoint = endpoint;
51+
}
52+
53+
public String getApiKey() {
54+
return apiKey;
55+
}
56+
57+
public void setApiKey(String apiKey) {
58+
this.apiKey = apiKey;
59+
}
60+
61+
public Integer getDimensions() {
62+
return dimensions;
63+
}
64+
65+
public void setDimensions(Integer dimensions) {
66+
this.dimensions = dimensions;
67+
}
68+
69+
public Boolean getCreateOrUpdateIndex() {
70+
return createOrUpdateIndex;
71+
}
72+
73+
public void setCreateOrUpdateIndex(Boolean createOrUpdateIndex) {
74+
this.createOrUpdateIndex = createOrUpdateIndex;
75+
}
76+
77+
public String getIndexName() {
78+
return indexName;
79+
}
80+
81+
public void setIndexName(String indexName) {
82+
this.indexName = indexName;
83+
}
84+
85+
public Integer getMaxResults() {
86+
return maxResults;
87+
}
88+
89+
public void setMaxResults(Integer maxResults) {
90+
this.maxResults = maxResults;
91+
}
92+
93+
public Double getMinScore() {
94+
return minScore;
95+
}
96+
97+
public void setMinScore(Double minScore) {
98+
this.minScore = minScore;
99+
}
100+
101+
public AzureAiSearchQueryType getQueryType() {
102+
return queryType;
103+
}
104+
105+
public void setQueryType(AzureAiSearchQueryType queryType) {
106+
this.queryType = queryType;
107+
}
33108
}
34109
}

langchain4j-easy-rag-spring-boot-starter/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@
3232
<optional>true</optional>
3333
</dependency>
3434

35-
<!-- should be listed before spring-boot-configuration-processor -->
36-
<dependency>
37-
<groupId>org.projectlombok</groupId>
38-
<artifactId>lombok</artifactId>
39-
<scope>provided</scope>
40-
</dependency>
41-
4235
<!-- needed to generate automatic metadata about available config properties -->
4336
<dependency>
4437
<groupId>org.springframework.boot</groupId>

0 commit comments

Comments
 (0)