Skip to content

Commit f8f7545

Browse files
hoonjicopybara-github
authored andcommitted
Makes runSse use ADK Event type
PiperOrigin-RevId: 812565394
1 parent f46142e commit f8f7545

File tree

4 files changed

+32
-12
lines changed

4 files changed

+32
-12
lines changed

karma.conf.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/**
2+
* @license
3+
* Copyright 2025 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
module.exports = function (config) {
219
config.set({
320
basePath: '',

package-lock.json

Lines changed: 11 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/components/chat/chat.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import {URLUtil} from '../../../utils/url-util';
4444
import {AgentRunRequest} from '../../core/models/AgentRunRequest';
4545
import {EvalCase} from '../../core/models/Eval';
4646
import {Session, SessionState} from '../../core/models/Session';
47-
import {LlmResponse} from '../../core/models/types';
47+
import {Event as AdkEvent} from '../../core/models/types';
4848
import {AGENT_SERVICE, AgentService} from '../../core/services/agent.service';
4949
import {ARTIFACT_SERVICE, ArtifactService} from '../../core/services/artifact.service';
5050
import {AUDIO_SERVICE, AudioService} from '../../core/services/audio.service';
@@ -459,7 +459,7 @@ export class ChatComponent implements OnInit, AfterViewInit, OnDestroy {
459459
let index = this.eventMessageIndexArray.length - 1;
460460
this.streamingTextMessage = null;
461461
this.agentService.runSse(req).subscribe({
462-
next: async (chunkJson: LlmResponse) => {
462+
next: async (chunkJson: AdkEvent) => {
463463
if (chunkJson.error) {
464464
this.openSnackBar(chunkJson.error, 'OK');
465465
return;

src/app/core/models/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export interface LlmRequest {
5555
}
5656

5757
export interface LlmResponse {
58-
id?: number;
5958
content: GenAiContent;
6059
error?: string;
6160
errorMessage?: string;
@@ -66,9 +65,11 @@ export interface EventActions {
6665
message?: string;
6766
functionCall?: FunctionCall;
6867
functionResponse?: FunctionResponse;
68+
finishReason?: string;
6969
}
7070

7171
export interface Event extends LlmResponse {
72+
id?: string;
7273
author?: string
7374
invocationId?: string;
7475
actions?: EventActions;

0 commit comments

Comments
 (0)