Skip to content

Commit

Permalink
Merge branch 'feat/stream-realtime' of github.com:nakasyou/generative…
Browse files Browse the repository at this point in the history
…-ai-js into feat/stream-realtime
  • Loading branch information
nakasyou committed Dec 14, 2024
2 parents bc5a651 + e37b359 commit 8d05413
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions src/models/generative-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,23 +288,25 @@ export class GenerativeModel {
* ```
*/
connectLive(config: Omit<BidiGenerateContentSetup, 'model'> = {}, connectionOptions: LiveConnectionOptions = {}): Promise<LiveSession> {
return connect({
requestOptions: this._requestOptions,
apiKey: this.apiKey,
setup: {
...config,
generationConfig: {
...(config.generationConfig ?? {}),
...(this.generationConfig as LiveGenerationConfig)
return connect(
{
requestOptions: this._requestOptions,
apiKey: this.apiKey,
setup: {
...config,
generationConfig: {
...config.generationConfig,
...(this.generationConfig as LiveGenerationConfig),
},
model: `models/${this.model}`,
...(config.tools || this.tools
? {
tools: [...config.tools, ...this.tools],
}
: {}),
},
model: `models/${this.model}`,
...((config.tools || this.tools) ? {
tools: [
...(config.tools ?? []),
...(this.tools ?? [])
]
} : {})
}
}, connectionOptions);
},
connectionOptions,
);
}
}

0 comments on commit 8d05413

Please sign in to comment.