Skip to content

Commit 15c3fa4

Browse files
committed
improvement(google-chat): validate tools, set optional fields to advanced mode
1 parent 8d7d484 commit 15c3fa4

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

apps/sim/blocks/blocks/google_chat.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,23 @@ export const GoogleChatBlock: BlockConfig<GoogleChatResponse> = {
7070
type: 'short-input',
7171
placeholder: 'Optional thread key for threaded replies',
7272
condition: { field: 'operation', value: 'send_message' },
73+
mode: 'advanced',
7374
},
7475
{
7576
id: 'filter',
7677
title: 'Filter',
7778
type: 'short-input',
7879
placeholder: 'e.g., spaceType = "SPACE"',
7980
condition: { field: 'operation', value: 'list_spaces' },
81+
mode: 'advanced',
8082
},
8183
{
8284
id: 'pageSize',
8385
title: 'Max Results',
8486
type: 'short-input',
8587
placeholder: 'Maximum spaces to return (default 100)',
8688
condition: { field: 'operation', value: 'list_spaces' },
89+
mode: 'advanced',
8790
},
8891
],
8992
tools: {
@@ -137,7 +140,7 @@ export const GoogleChatBlock: BlockConfig<GoogleChatResponse> = {
137140
threadName: { type: 'string', description: 'Thread resource name' },
138141
text: { type: 'string', description: 'Message text that was sent' },
139142
createTime: { type: 'string', description: 'Message creation timestamp' },
140-
spaces: { type: 'json', description: 'Array of Google Chat space objects' },
143+
spaces: { type: 'json', description: 'Array of Google Chat space objects (name, displayName, spaceType, singleUserBotDm, threaded, type)' },
141144
nextPageToken: { type: 'string', description: 'Token for next page of results' },
142145
},
143146
}

apps/sim/tools/google_chat/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ import { sendMessageTool } from './send_message'
33

44
export const googleChatSendMessageTool = sendMessageTool
55
export const googleChatListSpacesTool = listSpacesTool
6+
export * from './types'

apps/sim/tools/google_chat/list_spaces.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export const listSpacesTool: ToolConfig<GoogleChatListSpacesParams, GoogleChatRe
5757
method: 'GET',
5858
headers: (params) => ({
5959
Authorization: `Bearer ${params.accessToken}`,
60-
'Content-Type': 'application/json',
6160
}),
6261
},
6362

@@ -78,7 +77,7 @@ export const listSpacesTool: ToolConfig<GoogleChatListSpacesParams, GoogleChatRe
7877
outputs: {
7978
spaces: {
8079
type: 'json',
81-
description: 'Array of Google Chat space objects',
80+
description: 'Array of Google Chat space objects (name, displayName, spaceType, singleUserBotDm, threaded, type)',
8281
},
8382
nextPageToken: {
8483
type: 'string',

0 commit comments

Comments
 (0)