adding Marker to parse effectively pdf
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.aiteacher.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.client.JdkClientHttpRequestFactory;
|
||||
import org.springframework.web.client.RestClient;
|
||||
|
||||
import java.net.http.HttpClient;
|
||||
|
||||
@Configuration
|
||||
public class MarkerConfig {
|
||||
|
||||
@Value("${app.marker.base-url:http://localhost:8000}")
|
||||
private String markerBaseUrl;
|
||||
|
||||
@Bean
|
||||
RestClient markerRestClient() {
|
||||
// Use the JDK HTTP client with no timeout — Marker conversions can take several minutes.
|
||||
HttpClient httpClient = HttpClient.newBuilder()
|
||||
.build();
|
||||
JdkClientHttpRequestFactory factory = new JdkClientHttpRequestFactory(httpClient);
|
||||
// No read timeout set: JDK HTTP client defaults to no deadline.
|
||||
|
||||
return RestClient.builder()
|
||||
.baseUrl(markerBaseUrl)
|
||||
.requestFactory(factory)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user