File tree 4 files changed +10
-4
lines changed
api/resources/empathicVoice/resources/chat/client
4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ src/wrapper
19
19
src/index.ts
20
20
21
21
# EVI WebSocket
22
+ src/core/fetcher/Supplier.ts
22
23
src/Client.ts
23
24
src/api/resources/empathicVoice/client/Client.ts
24
25
src/api/resources/empathicVoice/resources/chat/index.ts
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " hume" ,
3
- "version" : " 0.8.3 " ,
3
+ "version" : " 0.8.4 " ,
4
4
"private" : false ,
5
5
"repository" : " https://github.com/HumeAI/hume-typescript-sdk" ,
6
6
"main" : " ./index.js" ,
Original file line number Diff line number Diff line change
1
+ import * as environments from '../../../../../../environments' ;
1
2
import * as core from '../../../../../../core' ;
2
3
import qs from 'qs' ;
3
4
import { ChatSocket } from './Socket' ;
4
5
5
6
export declare namespace Chat {
6
7
interface Options {
8
+ environment ?: core . Supplier < environments . HumeEnvironment | string > ;
7
9
apiKey ?: core . Supplier < string | undefined > ;
8
10
accessToken ?: core . Supplier < string | undefined > ;
9
11
}
@@ -58,7 +60,10 @@ export class Chat {
58
60
}
59
61
60
62
const socket = new core . ReconnectingWebSocket (
61
- `wss://api.hume.ai/v0/evi/chat?${ qs . stringify ( queryParams ) } ` ,
63
+ `wss://${ (
64
+ core . Supplier . get ( this . _options . environment ) ??
65
+ environments . HumeEnvironment . Production
66
+ ) . replace ( 'https://' , '' ) } /v0/evi/chat?${ qs . stringify ( queryParams ) } `,
62
67
[ ] ,
63
68
{
64
69
debug : args . debug ?? false ,
Original file line number Diff line number Diff line change 1
- export type Supplier < T > = T | Promise < T > | ( ( ) => T | Promise < T > ) ;
1
+ export type Supplier < T > = T | ( ( ) => T ) ;
2
2
3
3
export const Supplier = {
4
- get : async < T > ( supplier : Supplier < T > ) : Promise < T > => {
4
+ get : < T > ( supplier : Supplier < T > ) : T => {
5
5
if ( typeof supplier === 'function' ) {
6
6
return ( supplier as ( ) => T ) ( ) ;
7
7
} else {
You can’t perform that action at this time.
0 commit comments