Skip to content

Commit 1071f75

Browse files
authored
fix: support realtime AI model overrides (#94)
1 parent 5f148a3 commit 1071f75

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

__tests__/call.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ describe('call API', () => {
144144
session: '<session id>',
145145
}),
146146
).rejects.toThrowError(
147-
`Stream error code 16: GetCallStats failed with error: "call report not found for cid:default:${callId} session_id:<session id>"`,
147+
`Stream error code 16: GetCallStats failed with error: "call session not found"`,
148148
);
149149
});
150150

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"@openapitools/openapi-generator-cli": "^2.7.0",
5050
"@rollup/plugin-replace": "^5.0.2",
5151
"@rollup/plugin-typescript": "^11.1.4",
52-
"@stream-io/openai-realtime-api": "~0.1.0",
52+
"@stream-io/openai-realtime-api": "~0.1.3",
5353
"@types/uuid": "^9.0.4",
5454
"@typescript-eslint/eslint-plugin": "^6.4.0",
5555
"dotenv": "^16.3.1",
@@ -76,7 +76,7 @@
7676
"uuid": "^9.0.1"
7777
},
7878
"peerDependencies": {
79-
"@stream-io/openai-realtime-api": "~0.1.0"
79+
"@stream-io/openai-realtime-api": "~0.1.3"
8080
},
8181
"peerDependenciesMeta": {
8282
"@stream-io/openai-realtime-api": {

src/StreamVideoClient.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import { StreamCall } from './StreamCall';
33
import type { StreamClient } from './StreamClient';
44
import type { ApiConfig } from './types';
55
import type {
6-
RealtimeClient,
76
createRealtimeClient,
7+
RealtimeAPIModel,
8+
RealtimeClient,
89
} from '@stream-io/openai-realtime-api';
910

1011
export class StreamVideoClient extends VideoApi {
@@ -26,7 +27,8 @@ export class StreamVideoClient extends VideoApi {
2627
call: StreamCall;
2728
agentUserId: string;
2829
openAiApiKey: string;
29-
validityInSeconds: number;
30+
model?: RealtimeAPIModel;
31+
validityInSeconds?: number;
3032
}): Promise<RealtimeClient> => {
3133
let doCreateRealtimeClient: typeof createRealtimeClient;
3234

@@ -55,6 +57,7 @@ export class StreamVideoClient extends VideoApi {
5557
streamApiKey: this.apiConfig.apiKey,
5658
streamUserToken: token,
5759
openAiApiKey: options.openAiApiKey,
60+
model: options.model,
5861
});
5962

6063
await realtimeClient.connect();

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,10 +488,10 @@
488488
resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz"
489489
integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==
490490

491-
"@stream-io/openai-realtime-api@~0.1.0":
492-
version "0.1.0"
493-
resolved "https://registry.yarnpkg.com/@stream-io/openai-realtime-api/-/openai-realtime-api-0.1.0.tgz#d14db921e96dbbb5e3a71c566f920f8040ca5b55"
494-
integrity sha512-oT6lvxH0rl+lwQLSLFz3UJRFjh/JoqbpE6GCDvOf8Jw05wmslPhrozSqdt8VkCUap+fkPI8LUPfRCWc+HgJp9Q==
491+
"@stream-io/openai-realtime-api@~0.1.3":
492+
version "0.1.3"
493+
resolved "https://registry.yarnpkg.com/@stream-io/openai-realtime-api/-/openai-realtime-api-0.1.3.tgz#4a77eac5e58b4d7980958820690687a0edf3986d"
494+
integrity sha512-kB3BMW2CYAHF+SrswUvaJmwVlOOK3MZYBW9oR4Q9HGpzS0gEGP/feGsqt5M37/0gJ6A5mOoBA26TcnHmaA39dA==
495495
dependencies:
496496
"@openai/realtime-api-beta" openai/openai-realtime-api-beta#a5cb94824f625423858ebacb9f769226ca98945f
497497
ws "^8.18.0"

0 commit comments

Comments
 (0)