Skip to content

Commit 8a96a87

Browse files
Merge pull request #416 from Workgrid/ask-prompting-update
2 parents d8bf15c + ad31173 commit 8a96a87

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

packages/workgrid-client-react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@workgrid/client-react",
3-
"version": "0.0.6",
3+
"version": "0.0.7",
44
"main": "dist/client-react.js",
55
"types": "dist/client-react.d.ts",
66
"files": [
@@ -21,7 +21,7 @@
2121
},
2222
"dependencies": {
2323
"@testing-library/react-hooks": "^5.1.0",
24-
"@workgrid/client": "^0.0.8",
24+
"@workgrid/client": "^0.0.9",
2525
"react-query": "^3.12.2"
2626
},
2727
"devDependencies": {

packages/workgrid-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@workgrid/client",
3-
"version": "0.0.8",
3+
"version": "0.0.9",
44
"main": "dist/client.js",
55
"types": "dist/client.d.ts",
66
"files": [

packages/workgrid-client/src/client.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,18 @@ setTypedMutationDefaults('notificationDetailViewed', (client) => ({
617617
// askApi
618618
// ================================================================================================================================
619619

620+
/** @beta */
621+
export type PromptResponse = {
622+
botId: string
623+
botAliasId: string
624+
appId?: string
625+
type: string
626+
}
620627
/** @beta */
621628
export type AskResponse = {
622629
actions?: string[]
623630
suggestions?: string[]
631+
prompt?: PromptResponse
624632
text: string
625633
}
626634

@@ -634,7 +642,7 @@ export interface Queries {
634642
utterance: string
635643
channel: string
636644
locale: string
637-
id?: string
645+
appId?: string
638646
botId?: string
639647
botAliasId?: string
640648
}
@@ -645,11 +653,11 @@ export interface Queries {
645653

646654
setTypedQueryDefaults('ask', (client) => ({
647655
queryFn: async (context) => {
648-
const { spaceId, utterance, channel, locale, botId, botAliasId } = context.queryKey[1]
656+
const { spaceId, utterance, channel, locale, botId, botAliasId, appId } = context.queryKey[1]
649657

650658
const response = await client.httpClient.post(
651659
'/v2/ask',
652-
{ utterance, channel, locale, ...(botId ? { botId, botAliasId } : null) },
660+
{ utterance, channel, locale, ...(botId ? { botId, botAliasId } : null), ...(appId ? { appId } : null) },
653661
{
654662
headers: { 'x-workgrid-space': spaceId },
655663
}

0 commit comments

Comments
 (0)