Ignore:
Timestamp:
2021-08-03T14:36:14+12:00 (3 years ago)
Author:
davidb
Message:

Add setup file and ANT configuration tasks to allow including the API key and other properties

Location:
gs3-extensions/atea-nlp-tools/trunk/src/koreromaori-proxy
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/atea-nlp-tools/trunk/src/koreromaori-proxy

    • Property svn:ignore set to
      build
  • gs3-extensions/atea-nlp-tools/trunk/src/koreromaori-proxy/src/main/java/org/atea/nlptools/koreromaoriinterface/services/ReoTuhituhiApiService.java

    r35239 r35240  
    2525    private final ExecutorService threadPool;
    2626    private final Gson jsonSerialiser;
     27    private final String apiEndpoint;
     28    private final String apiKey;
    2729
    28     public ReoTuhituhiApiService(Gson jsonSerialiser)
     30    public ReoTuhituhiApiService(Gson jsonSerialiser, String apiEndpoint, String apiKey)
    2931    {
    3032        this.jsonSerialiser = jsonSerialiser;
     33        this.apiEndpoint = apiEndpoint;
     34        this.apiKey = apiKey;
    3135
    3236        threadPool = java.util.concurrent.Executors.newFixedThreadPool(3);
     
    8791        throws Exception
    8892    {
    89         // TODO: Use servlet param for URL
    90         // TODO: Use servlet param for API key
    9193        String jsonResponse = HttpRequestService
    92             .post("https://asr.koreromaori.io/transcribe_with_metadata")
    93             .authorization("Basic ")
     94            .post(apiEndpoint)
     95            .authorization("Basic " + apiKey)
    9496            .send(audioStream)
    9597            .body();
Note: See TracChangeset for help on using the changeset viewer.