Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/update view message dialog #3994

Merged
merged 7 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
check-latest: false
cache: 'pnpm'
- run: npm i -g pnpm
cache-dependency-path: 'pnpm-lock.yaml'
- run: pnpm install
- run: ./node_modules/.bin/cypress install
- run: pnpm lint
- run: pnpm build
- name: Install dependencies
- name: Cypress install
run: pnpm cypress install
- name: Install dependencies (Cypress Action)
uses: cypress-io/github-action@v6
with:
working-directory: ./
Expand Down
10 changes: 5 additions & 5 deletions packages/components/nodes/tools/ExaSearch/ExaSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ExaSearch_Tools implements INode {
constructor() {
this.label = 'Exa Search'
this.name = 'exaSearch'
this.version = 1.0
this.version = 1.1
this.type = 'ExaSearch'
this.icon = 'exa.svg'
this.category = 'Tools'
Expand Down Expand Up @@ -58,8 +58,8 @@ class ExaSearch_Tools implements INode {
name: 'neural'
},
{
label: 'magic',
name: 'magic',
label: 'auto',
name: 'auto',
description: 'decides between keyword and neural'
}
],
Expand Down Expand Up @@ -200,7 +200,7 @@ class ExaSearch_Tools implements INode {
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
const description = nodeData.inputs?.description as string
const numResults = nodeData.inputs?.numResults as string
const type = nodeData.inputs?.type as string
const type = nodeData.inputs?.type as 'keyword' | 'neural' | 'auto' | undefined
const useAutoprompt = nodeData.inputs?.useAutoprompt as boolean
const category = nodeData.inputs?.category as string
const includeDomains = nodeData.inputs?.includeDomains as string
Expand All @@ -219,7 +219,7 @@ class ExaSearch_Tools implements INode {
numResults: numResults ? parseFloat(numResults) : undefined,
type: type || undefined,
useAutoprompt: useAutoprompt || undefined,
category: category || undefined,
category: (category as any) || undefined,
includeDomains: includeDomains ? includeDomains.split(',') : undefined,
excludeDomains: excludeDomains ? excludeDomains.split(',') : undefined,
startCrawlDate: startCrawlDate || undefined,
Expand Down
60 changes: 46 additions & 14 deletions packages/ui/src/ui-component/dialog/ViewMessagesDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,14 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
getChatmessageApi.request(dialogProps.chatflow.id, {
startDate: updatedDate,
endDate: endDate,
chatType: chatTypeFilter.length ? chatTypeFilter : undefined
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
getStatsApi.request(dialogProps.chatflow.id, {
startDate: updatedDate,
endDate: endDate,
chatType: chatTypeFilter.length ? chatTypeFilter : undefined
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
}

Expand All @@ -189,12 +191,14 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
getChatmessageApi.request(dialogProps.chatflow.id, {
endDate: updatedDate,
startDate: startDate,
chatType: chatTypeFilter.length ? chatTypeFilter : undefined
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
getStatsApi.request(dialogProps.chatflow.id, {
endDate: updatedDate,
startDate: startDate,
chatType: chatTypeFilter.length ? chatTypeFilter : undefined
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
}

Expand All @@ -203,12 +207,14 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
getChatmessageApi.request(dialogProps.chatflow.id, {
chatType: chatTypes.length ? chatTypes : undefined,
startDate: startDate,
endDate: endDate
endDate: endDate,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
getStatsApi.request(dialogProps.chatflow.id, {
chatType: chatTypes.length ? chatTypes : undefined,
startDate: startDate,
endDate: endDate
endDate: endDate,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
}

Expand Down Expand Up @@ -282,12 +288,14 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
getChatmessageApi.request(chatflowid, {
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
startDate: startDate,
endDate: endDate
endDate: endDate,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
getStatsApi.request(chatflowid, {
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
startDate: startDate,
endDate: endDate
endDate: endDate,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
} catch (error) {
console.error(error)
Expand Down Expand Up @@ -427,8 +435,18 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
)
}
})
getChatmessageApi.request(chatflowid)
getStatsApi.request(chatflowid) // update stats
getChatmessageApi.request(chatflowid, {
startDate: startDate,
endDate: endDate,
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
getStatsApi.request(chatflowid, {
startDate: startDate,
endDate: endDate,
chatType: chatTypeFilter.length ? chatTypeFilter : undefined,
feedbackType: feedbackTypeFilter.length ? feedbackTypeFilter : undefined
})
} catch (error) {
enqueueSnackbar({
message: typeof error.response.data === 'object' ? error.response.data.message : error.response.data,
Expand Down Expand Up @@ -689,8 +707,14 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {

useEffect(() => {
if (dialogProps.chatflow) {
getChatmessageApi.request(dialogProps.chatflow.id)
getStatsApi.request(dialogProps.chatflow.id)
getChatmessageApi.request(dialogProps.chatflow.id, {
startDate: startDate,
endDate: endDate
})
getStatsApi.request(dialogProps.chatflow.id, {
startDate: startDate,
endDate: endDate
})
}

return () => {
Expand Down Expand Up @@ -720,8 +744,16 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
if (dialogProps.chatflow) {
// when the filter is cleared fetch all messages
if (feedbackTypeFilter.length === 0) {
getChatmessageApi.request(dialogProps.chatflow.id)
getStatsApi.request(dialogProps.chatflow.id)
getChatmessageApi.request(dialogProps.chatflow.id, {
startDate: startDate,
endDate: endDate,
chatType: chatTypeFilter.length ? chatTypeFilter : undefined
})
getStatsApi.request(dialogProps.chatflow.id, {
startDate: startDate,
endDate: endDate,
chatType: chatTypeFilter.length ? chatTypeFilter : undefined
})
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down