Skip to content

Commit c2d8213

Browse files
committed
OLS-2722: address code-rabbit comments
1 parent 6d94fd0 commit c2d8213

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ with the particular component:
283283
{
284284
"type": "ols.tool-ui",
285285
"properties": {
286-
"id": "my-obs/my-tool",
286+
"id": "my-mcp/my-tool",
287287
"component": {
288288
"$codeRef": "MyToolUI"
289289
}
@@ -303,7 +303,7 @@ type MyTool = {
303303
// ...
304304
};
305305

306-
export const MyToolUI React.FC<{ tool: MyTool }> = ({ tool }) => {
306+
export const MyToolUI: React.FC<{ tool: MyTool }> = ({ tool }) => {
307307
// component implementation
308308
}
309309
```

src/components/OlsToolUIs.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ export const OlsToolUIs: React.FC<OlsUIToolsProps> = ({ entryIndex }) => {
2828
s.plugins?.ols?.getIn(['chatHistory', entryIndex, 'tools']),
2929
);
3030

31+
if (!toolsData) {
32+
return null;
33+
}
34+
3135
const olsToolsWithUI = toolsData
3236
.map((value) => {
3337
const tool = value.toJS() as Tool;

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ export type ReferencedDoc = {
2828
};
2929

3030
export type Tool = {
31-
args: { [key: string]: string };
31+
args: { [key: string]: unknown };
3232
content: string;
3333
name: string;
3434
status: 'error' | 'success' | 'truncated';
3535
uiResourceUri?: string;
3636
serverName?: string;
3737
structuredContent?: Record<string, unknown>;
38-
olsToolUiID: string;
38+
olsToolUiID?: string;
3939
};
4040

4141
export type OlsToolUIComponent = React.ComponentType<{ tool: Tool }>;

0 commit comments

Comments
 (0)