Skip to content

Commit

Permalink
Merge pull request #695 from openchatai/fix-query-params
Browse files Browse the repository at this point in the history
feat: Add query_params to message payload
  • Loading branch information
ah7255703 committed Mar 12, 2024
2 parents 619a976 + 5cf28b4 commit c739924
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions copilot-widget/lib/contexts/messageHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type UserMessageType = {
session_id: string;
headers: Record<string, string>;
bot_token: string;
query_params: Record<string, string>;
};

export type BotMessageType<TData = Record<string, unknown>> = {
Expand Down
3 changes: 2 additions & 1 deletion copilot-widget/lib/contexts/statefulMessageHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ function useChatLoading() {

function useSendMessage() {
const { __handler } = useMessageHandler();
const { headers, token } = useConfigData();
const { headers, token, queryParams } = useConfigData();
const socket = useSocket();

function send(content: string) {
__handler.handleTextMessage(
{
headers: headers ?? {},
query_params: queryParams ?? {},
content,
bot_token: token,
},
Expand Down
2 changes: 1 addition & 1 deletion copilot-widget/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@openchatai/copilot-widget",
"private": false,
"version": "2.8.4",
"version": "2.8.5",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@hookform/resolvers": "^3.3.1",
"@kbox-labs/react-echarts": "^1.0.3",
"@openchatai/copilot-widget": "^2.8.4",
"@openchatai/copilot-widget": "^2.8.5",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-avatar": "^1.0.4",
Expand Down
8 changes: 4 additions & 4 deletions dashboard/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dashboard/public/pilot.js

Large diffs are not rendered by default.

0 comments on commit c739924

Please sign in to comment.