bobbai00 commented on code in PR #9432:
URL: https://github.com/apache/texera/pull/9432#discussion_r4577325471
##########
frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal/react-step-detail-modal.component.ts:
##########
@@ -27,6 +27,30 @@ import { NzDescriptionsComponent,
NzDescriptionsItemComponent } from "ng-zorro-a
import { NzTagComponent } from "ng-zorro-antd/tag";
import { NzCollapseComponent, NzCollapsePanelComponent } from
"ng-zorro-antd/collapse";
+/**
+ * A content part of an input message. The agent backend tags each part with a
`type` and
+ * fills only the fields for that kind, so every field but the tag is optional
here and the
+ * modal reads them by name. Tool-call arguments arrive under `args` or
`input`; a tool
+ * result arrives under `result`, `output`, or `content`.
+ */
+interface MessagePart {
Review Comment:
**Must fix:**
These interfaces re-declare the SDK type this feature already imports:
[`agent-types.ts`](https://github.com/apache/texera/blob/cc1f201596936a12e79f6243cdc38bef3f73c767/frontend/src/app/workspace/service/agent/agent-types.ts#L20-L23)
re-exports `ModelMessage`, and agent-service builds `inputMessages` with it
([`texera-agent.ts:540`](https://github.com/apache/texera/blob/cc1f201596936a12e79f6243cdc38bef3f73c767/agent-service/src/agent/texera-agent.ts#L540)).
The copy is looser: `toolCallId` and `toolName` become optional (hence the new
fallbacks), and it adds `args`, `result` and part `content`, which neither ai 5
nor ai 7 defines. Since `inputMessages` stays `any[]` ([line
66](https://github.com/apache/texera/blob/cc1f201596936a12e79f6243cdc38bef3f73c767/frontend/src/app/workspace/service/agent/agent-types.ts#L66)),
the template's calls are still unchecked. Type it as `ModelMessage[]` and
narrow on `type` to `TextPart`, `ToolCallPart` and `ToolResultPart`; the last
one's `toolName
` also replaces `buildToolCallNameMap`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]