Skip to content

Commit

Permalink
Fixed twilio and langchain4j conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriOndrusek committed Jul 8, 2024
1 parent 1268997 commit 8ce3614
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.twilio.constant.EnumConstants;
import com.twilio.http.HttpClient;
import com.twilio.http.IRequest;
import com.twilio.http.NetworkHttpClient;
import com.twilio.http.Request;
import com.twilio.http.TwilioRestClient;
Expand Down Expand Up @@ -80,8 +81,10 @@ public TwilioRestClient restClient() {
Optional<String> wireMockUrl = ConfigProvider.getConfig().getOptionalValue("wiremock.url", String.class);
if (wireMockUrl.isPresent()) {
HttpClient client = new NetworkHttpClient() {

@Override
public com.twilio.http.Response makeRequest(Request originalRequest) {
public <T extends IRequest> com.twilio.http.Response makeRequest(T r) {
Request originalRequest = (Request) r;
String url = originalRequest.getUrl();

Request modified = new Request(originalRequest.getMethod(),
Expand Down
22 changes: 22 additions & 0 deletions poms/bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1808,11 +1808,33 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-langchain4j-chat</artifactId>
<version>${camel.version}</version>
<!-- Required until quarkus upgrades to the same version of langchain4j -->
<exclusions>
<exclusion>
<artifactId>langchain4j-core</artifactId>
<groupId>dev.langchain4j</groupId>
</exclusion>
<exclusion>
<artifactId>langchain4j</artifactId>
<groupId>dev.langchain4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-langchain4j-core</artifactId>
<version>${camel.version}</version>
<!-- Required until quarkus upgrades to the same version of langchain4j -->
<exclusions>
<exclusion>
<artifactId>langchain4j-core</artifactId>
<groupId>dev.langchain4j</groupId>
</exclusion>
<exclusion>
<artifactId>langchain4j</artifactId>
<groupId>dev.langchain4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
Expand Down
20 changes: 20 additions & 0 deletions poms/bom/src/main/generated/flattened-full-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1745,11 +1745,31 @@
<groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>camel-langchain4j-chat</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>4.7.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<exclusions>
<exclusion>
<groupId>dev.langchain4j</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>langchain4j-core</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
<exclusion>
<groupId>dev.langchain4j</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>langchain4j</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>camel-langchain4j-core</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>4.7.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<exclusions>
<exclusion>
<groupId>dev.langchain4j</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>langchain4j-core</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
<exclusion>
<groupId>dev.langchain4j</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>langchain4j</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
Expand Down
20 changes: 20 additions & 0 deletions poms/bom/src/main/generated/flattened-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1745,11 +1745,31 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-langchain4j-chat</artifactId>
<version>4.7.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-core</artifactId>
</exclusion>
<exclusion>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-langchain4j-core</artifactId>
<version>4.7.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-core</artifactId>
</exclusion>
<exclusion>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
Expand Down
20 changes: 20 additions & 0 deletions poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1745,11 +1745,31 @@
<groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>camel-langchain4j-chat</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>4.7.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<exclusions>
<exclusion>
<groupId>dev.langchain4j</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>langchain4j-core</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
<exclusion>
<groupId>dev.langchain4j</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>langchain4j</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>camel-langchain4j-core</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>4.7.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<exclusions>
<exclusion>
<groupId>dev.langchain4j</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>langchain4j-core</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
<exclusion>
<groupId>dev.langchain4j</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>langchain4j</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
Expand Down

0 comments on commit 8ce3614

Please sign in to comment.