Skip to content

Commit 71e62b1

Browse files
hoonjicopybara-github
authored andcommitted
Makes runSse use ADK Event type
PiperOrigin-RevId: 813042405
1 parent a984903 commit 71e62b1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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)