Skip to content

Commit 18c4258

Browse files
authored
improve readme (#2)
1 parent d65b679 commit 18c4258

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

README.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
# Hume TypeScript Library
2-
3-
[![npm shield](https://img.shields.io/npm/v/@fern-api/hume)](https://www.npmjs.com/package/@fern-api/hume)
4-
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://github.com/fern-api/fern)
5-
6-
The Hume Node.js library provides access to the Hume API from JavaScript/TypeScript.
1+
<div align="center">
2+
<img src="https://storage.googleapis.com/hume-public-logos/hume/hume-banner.png">
3+
<h1>Hume AI TypeScript SDK</h1>
4+
5+
<p>
6+
<strong>Integrate Hume APIs directly into your Node application or frontend</strong>
7+
</p>
8+
9+
<br>
10+
<div>
11+
<a href="https://www.npmjs.com/package/@fern-api/hume"><img src="https://img.shields.io/npm/v/@fern-api/hume">
12+
<a href="https://buildwithfern.com/"><img src="https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen">
13+
</div>
14+
<br>
15+
</div>
716

817
## Documentation
918

@@ -25,7 +34,7 @@ The SDK exports a batch client which you can use to hit our REST APIs.
2534
import { HumeBatchClient } from "@fern-api/hume";
2635

2736
const client = new HumeBatchClient({
28-
apiKey: "<your-api-key",
37+
apiKey: "YOUR_API_KEY",
2938
});
3039

3140
const job = await client.submitJob({
@@ -47,21 +56,23 @@ The SDK exports a streaming client which you can use to hit our WebSocket APIs.
4756
import { HumeStreamingClient } from "@fern-api/hume";
4857

4958
const client = new HumeStreamingClient({
50-
apiKey: "<your-api-key",
59+
apiKey: "YOUR_API_KEY",
5160
});
5261

5362
const stream = await client.connect({
5463
configs: {
55-
face: {},
64+
language: {},
5665
},
57-
listeners: {
58-
message: (response) => {
59-
console.log(response.?burst);
60-
},
66+
onMessage: (response) => {
67+
if (response.language != null) {
68+
console.log(response.language.predictions);
69+
}
6170
},
6271
});
6372

64-
stream.sendFile(...);
73+
stream.sendText({
74+
text: "Mary had a little lamb,"
75+
});
6576
```
6677

6778
## Errors

src/wrapper/HumeBatchClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import * as Hume from "../api";
33
import { Job } from "./Job";
44

55
export class HumeBatchClient extends FernClient {
6-
public async submitJob(request: Hume.BaseRequest = {}): Promise<Job> {
7-
const { jobId } = await super.submitJob(request);
6+
public async submitJob(request: Hume.BaseRequest = {}, requestOptions?: FernClient.RequestOptions): Promise<Job> {
7+
const { jobId } = await super.submitJob(request, requestOptions);
88
return new Job(jobId, this);
99
}
1010
}

0 commit comments

Comments
 (0)