Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 3e6f55f

Browse files
🌿 Fern Regeneration -- December 4, 2023 (#32)
* SDK regeneration * update manual code with renames * fix readme --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: dsinghvi <[email protected]>
1 parent 68ba363 commit 3e6f55f

30 files changed

+435
-353
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ method on `CreateTranscriptParameters` until you have specified the mandatory
116116
audioUrl variable.
117117

118118
```java
119-
import com.assemblyai.api.CreateTranscriptParams;
119+
import com.assemblyai.api.TranscriptParams;
120120

121-
CreateTranscriptParameters params = CreateTranscriptParameters.builder()
121+
TranscriptParams params = TranscriptParams.builder()
122122
.audioUrl("https://...")
123123
.build();
124124
```

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ publishing {
4747
maven(MavenPublication) {
4848
groupId = 'com.assemblyai'
4949
artifactId = 'assemblyai-java'
50-
version = '0.0.5-beta5'
50+
version = '0.0.5-beta8'
5151
from components.java
5252
}
5353
}

sample-app/src/main/java/sample/App.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import com.assemblyai.api.AssemblyAI;
44
import com.assemblyai.api.RealtimeTranscriber;
55
import com.assemblyai.api.Transcriber;
6-
import com.assemblyai.api.resources.transcript.requests.CreateTranscriptParameters;
7-
import com.assemblyai.api.resources.transcript.requests.TranscriptWordSearchRequest;
6+
import com.assemblyai.api.resources.transcripts.requests.TranscriptParams;
7+
import com.assemblyai.api.resources.transcripts.requests.TranscriptsWordSearchRequest;
88
import com.assemblyai.api.types.ParagraphsResponse;
99
import com.assemblyai.api.types.SentencesResponse;
1010
import com.assemblyai.api.types.SubtitleFormat;
@@ -44,7 +44,7 @@ public static void main(String... args) throws IOException {
4444
String vtt = aai.transcript().getSubtitles(transcript.getId(), SubtitleFormat.VTT);
4545
System.out.println("Get transcript vtt. " + vtt);
4646

47-
WordSearchResponse search = aai.transcript().wordSearch(transcript.getId(), TranscriptWordSearchRequest.builder()
47+
WordSearchResponse search = aai.transcript().wordSearch(transcript.getId(), TranscriptsWordSearchRequest.builder()
4848
.words("NBC")
4949
.build());
5050
System.out.println("Search transcript. " + search);
@@ -56,12 +56,12 @@ public static void main(String... args) throws IOException {
5656
UploadedFile uploadedFile = aai.files().upload(Files.readAllBytes(file.toPath()));
5757
System.out.println("Uploaded file" + uploadedFile);
5858

59-
transcript = aai.transcript().create(CreateTranscriptParameters.builder()
59+
transcript = aai.transcript().create(TranscriptParams.builder()
6060
.audioUrl("https://storage.googleapis.com/aai-docs-samples/nbc.mp3")
6161
.build(), true);
6262
System.out.println("Created and polled transcript " + transcript);
6363

64-
transcript = aai.transcript().create(CreateTranscriptParameters.builder()
64+
transcript = aai.transcript().create(TranscriptParams.builder()
6565
.audioUrl("https://storage.googleapis.com/aai-docs-samples/nbc.mp3")
6666
.build());
6767
System.out.println("Created transcript " + transcript);

src/main/java/com/assemblyai/api/AssemblyAI.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import com.assemblyai.api.resources.files.FilesClient;
99
import com.assemblyai.api.resources.lemur.LemurClient;
1010
import com.assemblyai.api.resources.realtime.RealtimeClient;
11-
import com.assemblyai.api.resources.transcript.TranscriptClient;
1211
import java.util.function.Supplier;
1312

1413
public class AssemblyAI {

src/main/java/com/assemblyai/api/PollingTranscriptClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package com.assemblyai.api;
22

33
import com.assemblyai.api.core.ClientOptions;
4-
import com.assemblyai.api.resources.transcript.TranscriptClient;
5-
import com.assemblyai.api.resources.transcript.requests.CreateTranscriptParameters;
4+
import com.assemblyai.api.resources.transcripts.TranscriptsClient;
5+
import com.assemblyai.api.resources.transcripts.requests.TranscriptParams;
66
import com.assemblyai.api.types.Transcript;
77

8-
public class PollingTranscriptClient extends TranscriptClient {
8+
public class PollingTranscriptClient extends TranscriptsClient {
99

1010
private final Transcriber transcriber;
1111

@@ -17,7 +17,7 @@ public PollingTranscriptClient(ClientOptions clientOptions, Transcriber transcri
1717
/**
1818
* Create a transcript from an audio or video file that is accessible via a URL.
1919
*/
20-
public Transcript create(CreateTranscriptParameters request, boolean poll) {
20+
public Transcript create(TranscriptParams request, boolean poll) {
2121
return transcriber.transcribe(request.getAudioUrl(), request, poll);
2222
}
2323

src/main/java/com/assemblyai/api/Transcriber.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.assemblyai.api;
22

33
import com.assemblyai.api.core.Environment;
4-
import com.assemblyai.api.resources.transcript.requests.CreateTranscriptParameters;
5-
import com.assemblyai.api.types.CreateTranscriptOptionalParameters;
6-
import com.assemblyai.api.types.ICreateTranscriptOptionalParameters;
4+
import com.assemblyai.api.resources.transcripts.requests.TranscriptParams;
5+
import com.assemblyai.api.types.ITranscriptOptionalParams;
76
import com.assemblyai.api.types.Transcript;
7+
import com.assemblyai.api.types.TranscriptOptionalParams;
88
import com.assemblyai.api.types.TranscriptStatus;
99
import com.assemblyai.api.types.UploadedFile;
1010
import java.io.File;
@@ -24,14 +24,14 @@ public final class Transcriber {
2424
* Polls until transcription is done.
2525
*/
2626
public Transcript transcribe(String url) {
27-
return transcribe(url, CreateTranscriptOptionalParameters.builder().build(), true);
27+
return transcribe(url, TranscriptOptionalParams.builder().build(), true);
2828
}
2929

3030
/**
3131
* Transcribes an audio file whose location can be specified via a URL.
3232
* Polls until transcription is done.
3333
*/
34-
public Transcript transcribe(String url, CreateTranscriptOptionalParameters transcriptRequest) {
34+
public Transcript transcribe(String url, TranscriptOptionalParams transcriptRequest) {
3535
return transcribe(url, transcriptRequest, true);
3636
}
3737

@@ -40,9 +40,9 @@ public Transcript transcribe(String url, CreateTranscriptOptionalParameters tran
4040
*/
4141
public Transcript transcribe(
4242
String url,
43-
ICreateTranscriptOptionalParameters transcriptRequest,
43+
ITranscriptOptionalParams transcriptRequest,
4444
boolean poll) {
45-
CreateTranscriptParameters createTranscript = CreateTranscriptParameters.builder()
45+
TranscriptParams createTranscript = TranscriptParams.builder()
4646
.audioUrl(url)
4747
.languageCode(transcriptRequest.getLanguageCode())
4848
.punctuate(transcriptRequest.getPunctuate())
@@ -91,21 +91,21 @@ public Transcript transcribe(
9191
* Polls until transcription is done.
9292
*/
9393
public Transcript transcribe(File data) throws IOException {
94-
return transcribe(data, CreateTranscriptOptionalParameters.builder().build(), true);
94+
return transcribe(data, TranscriptOptionalParams.builder().build(), true);
9595
}
9696

9797
/**
9898
* Transcribes an audio file whose location can be specified via a filepath.
9999
* Polls until transcription is done.
100100
*/
101-
public Transcript transcribe(File data, CreateTranscriptOptionalParameters transcriptRequest) throws IOException {
101+
public Transcript transcribe(File data, TranscriptOptionalParams transcriptRequest) throws IOException {
102102
return transcribe(data, transcriptRequest, true);
103103
}
104104

105105
/**
106106
* Transcribes an audio file whose location can be specified via a filepath.
107107
*/
108-
public Transcript transcribe(File data, CreateTranscriptOptionalParameters transcriptRequest, boolean poll)
108+
public Transcript transcribe(File data, TranscriptOptionalParams transcriptRequest, boolean poll)
109109
throws IOException {
110110
UploadedFile uploadedFile = this.client.files().upload(Files.readAllBytes(data.toPath()));
111111
return transcribe(uploadedFile.getUploadUrl(), transcriptRequest, poll);

src/main/java/com/assemblyai/api/core/ClientOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private ClientOptions(
2929
"X-Fern-SDK-Name",
3030
"com.assemblyai.fern:api-sdk",
3131
"X-Fern-SDK-Version",
32-
"0.0.5-beta5",
32+
"0.0.5-beta8",
3333
"X-Fern-Language",
3434
"JAVA"));
3535
this.headerSuppliers = headerSuppliers;

src/main/java/com/assemblyai/api/resources/lemur/LemurClient.java

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
import com.assemblyai.api.core.ClientOptions;
88
import com.assemblyai.api.core.ObjectMappers;
99
import com.assemblyai.api.core.RequestOptions;
10-
import com.assemblyai.api.resources.lemur.requests.LemurQuestionAnswerParameters;
11-
import com.assemblyai.api.resources.lemur.requests.LemurSummaryParameters;
12-
import com.assemblyai.api.resources.lemur.requests.LemurTaskParameters;
10+
import com.assemblyai.api.resources.lemur.requests.LemurQuestionAnswerParams;
11+
import com.assemblyai.api.resources.lemur.requests.LemurSummaryParams;
12+
import com.assemblyai.api.resources.lemur.requests.LemurTaskParams;
1313
import com.assemblyai.api.types.LemurActionItemsResponse;
14-
import com.assemblyai.api.types.LemurBaseParameters;
14+
import com.assemblyai.api.types.LemurBaseParams;
1515
import com.assemblyai.api.types.LemurQuestionAnswerResponse;
1616
import com.assemblyai.api.types.LemurSummaryResponse;
1717
import com.assemblyai.api.types.LemurTaskResponse;
@@ -32,19 +32,12 @@ public LemurClient(ClientOptions clientOptions) {
3232
}
3333

3434
/**
35-
* Custom Summary allows you to distill a piece of audio into a few impactful sentences. You can give the model context to obtain more targeted results while outputting the results in a variety of formats described in human language.
36-
*/
37-
public LemurSummaryResponse summary() {
38-
return summary(LemurSummaryParameters.builder().build());
39-
}
40-
41-
/**
42-
* Custom Summary allows you to distill a piece of audio into a few impactful sentences. You can give the model context to obtain more targeted results while outputting the results in a variety of formats described in human language.
35+
* Use the LeMUR task endpoint to input your own LLM prompt.
4336
*/
44-
public LemurSummaryResponse summary(LemurSummaryParameters request, RequestOptions requestOptions) {
37+
public LemurTaskResponse task(LemurTaskParams request, RequestOptions requestOptions) {
4538
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
4639
.newBuilder()
47-
.addPathSegments("lemur/v3/generate/summary")
40+
.addPathSegments("lemur/v3/generate/task")
4841
.build();
4942
RequestBody body;
5043
try {
@@ -63,7 +56,7 @@ public LemurSummaryResponse summary(LemurSummaryParameters request, RequestOptio
6356
Response response =
6457
clientOptions.httpClient().newCall(okhttpRequest).execute();
6558
if (response.isSuccessful()) {
66-
return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), LemurSummaryResponse.class);
59+
return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), LemurTaskResponse.class);
6760
}
6861
throw new ApiError(
6962
response.code(),
@@ -73,21 +66,27 @@ public LemurSummaryResponse summary(LemurSummaryParameters request, RequestOptio
7366
}
7467
}
7568

69+
/**
70+
* Use the LeMUR task endpoint to input your own LLM prompt.
71+
*/
72+
public LemurTaskResponse task(LemurTaskParams request) {
73+
return task(request, null);
74+
}
75+
7676
/**
7777
* Custom Summary allows you to distill a piece of audio into a few impactful sentences. You can give the model context to obtain more targeted results while outputting the results in a variety of formats described in human language.
7878
*/
79-
public LemurSummaryResponse summary(LemurSummaryParameters request) {
80-
return summary(request, null);
79+
public LemurSummaryResponse summary() {
80+
return summary(LemurSummaryParams.builder().build());
8181
}
8282

8383
/**
84-
* Question &amp; Answer allows you to ask free-form questions about a single transcript or a group of transcripts. The questions can be any whose answers you find useful, such as judging whether a caller is likely to become a customer or whether all items on a meeting's agenda were covered.
84+
* Custom Summary allows you to distill a piece of audio into a few impactful sentences. You can give the model context to obtain more targeted results while outputting the results in a variety of formats described in human language.
8585
*/
86-
public LemurQuestionAnswerResponse questionAnswer(
87-
LemurQuestionAnswerParameters request, RequestOptions requestOptions) {
86+
public LemurSummaryResponse summary(LemurSummaryParams request, RequestOptions requestOptions) {
8887
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
8988
.newBuilder()
90-
.addPathSegments("lemur/v3/generate/question-answer")
89+
.addPathSegments("lemur/v3/generate/summary")
9190
.build();
9291
RequestBody body;
9392
try {
@@ -106,7 +105,7 @@ public LemurQuestionAnswerResponse questionAnswer(
106105
Response response =
107106
clientOptions.httpClient().newCall(okhttpRequest).execute();
108107
if (response.isSuccessful()) {
109-
return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), LemurQuestionAnswerResponse.class);
108+
return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), LemurSummaryResponse.class);
110109
}
111110
throw new ApiError(
112111
response.code(),
@@ -117,26 +116,20 @@ public LemurQuestionAnswerResponse questionAnswer(
117116
}
118117

119118
/**
120-
* Question &amp; Answer allows you to ask free-form questions about a single transcript or a group of transcripts. The questions can be any whose answers you find useful, such as judging whether a caller is likely to become a customer or whether all items on a meeting's agenda were covered.
121-
*/
122-
public LemurQuestionAnswerResponse questionAnswer(LemurQuestionAnswerParameters request) {
123-
return questionAnswer(request, null);
124-
}
125-
126-
/**
127-
* Use LeMUR to generate a list of Action Items from a transcript
119+
* Custom Summary allows you to distill a piece of audio into a few impactful sentences. You can give the model context to obtain more targeted results while outputting the results in a variety of formats described in human language.
128120
*/
129-
public LemurActionItemsResponse actionItems() {
130-
return actionItems(LemurBaseParameters.builder().build());
121+
public LemurSummaryResponse summary(LemurSummaryParams request) {
122+
return summary(request, null);
131123
}
132124

133125
/**
134-
* Use LeMUR to generate a list of Action Items from a transcript
126+
* Question &amp; Answer allows you to ask free-form questions about a single transcript or a group of transcripts. The questions can be any whose answers you find useful, such as judging whether a caller is likely to become a customer or whether all items on a meeting's agenda were covered.
135127
*/
136-
public LemurActionItemsResponse actionItems(LemurBaseParameters request, RequestOptions requestOptions) {
128+
public LemurQuestionAnswerResponse questionAnswer(
129+
LemurQuestionAnswerParams request, RequestOptions requestOptions) {
137130
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
138131
.newBuilder()
139-
.addPathSegments("lemur/v3/generate/action-items")
132+
.addPathSegments("lemur/v3/generate/question-answer")
140133
.build();
141134
RequestBody body;
142135
try {
@@ -155,7 +148,7 @@ public LemurActionItemsResponse actionItems(LemurBaseParameters request, Request
155148
Response response =
156149
clientOptions.httpClient().newCall(okhttpRequest).execute();
157150
if (response.isSuccessful()) {
158-
return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), LemurActionItemsResponse.class);
151+
return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), LemurQuestionAnswerResponse.class);
159152
}
160153
throw new ApiError(
161154
response.code(),
@@ -166,19 +159,26 @@ public LemurActionItemsResponse actionItems(LemurBaseParameters request, Request
166159
}
167160

168161
/**
169-
* Use LeMUR to generate a list of Action Items from a transcript
162+
* Question &amp; Answer allows you to ask free-form questions about a single transcript or a group of transcripts. The questions can be any whose answers you find useful, such as judging whether a caller is likely to become a customer or whether all items on a meeting's agenda were covered.
170163
*/
171-
public LemurActionItemsResponse actionItems(LemurBaseParameters request) {
172-
return actionItems(request, null);
164+
public LemurQuestionAnswerResponse questionAnswer(LemurQuestionAnswerParams request) {
165+
return questionAnswer(request, null);
166+
}
167+
168+
/**
169+
* Use LeMUR to generate a list of action items from a transcript
170+
*/
171+
public LemurActionItemsResponse actionItems() {
172+
return actionItems(LemurBaseParams.builder().build());
173173
}
174174

175175
/**
176-
* Use your own prompt to run a Custom Task to handle your specialized task.
176+
* Use LeMUR to generate a list of action items from a transcript
177177
*/
178-
public LemurTaskResponse task(LemurTaskParameters request, RequestOptions requestOptions) {
178+
public LemurActionItemsResponse actionItems(LemurBaseParams request, RequestOptions requestOptions) {
179179
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
180180
.newBuilder()
181-
.addPathSegments("lemur/v3/generate/task")
181+
.addPathSegments("lemur/v3/generate/action-items")
182182
.build();
183183
RequestBody body;
184184
try {
@@ -197,7 +197,7 @@ public LemurTaskResponse task(LemurTaskParameters request, RequestOptions reques
197197
Response response =
198198
clientOptions.httpClient().newCall(okhttpRequest).execute();
199199
if (response.isSuccessful()) {
200-
return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), LemurTaskResponse.class);
200+
return ObjectMappers.JSON_MAPPER.readValue(response.body().string(), LemurActionItemsResponse.class);
201201
}
202202
throw new ApiError(
203203
response.code(),
@@ -208,10 +208,10 @@ public LemurTaskResponse task(LemurTaskParameters request, RequestOptions reques
208208
}
209209

210210
/**
211-
* Use your own prompt to run a Custom Task to handle your specialized task.
211+
* Use LeMUR to generate a list of action items from a transcript
212212
*/
213-
public LemurTaskResponse task(LemurTaskParameters request) {
214-
return task(request, null);
213+
public LemurActionItemsResponse actionItems(LemurBaseParams request) {
214+
return actionItems(request, null);
215215
}
216216

217217
/**

0 commit comments

Comments
 (0)