@eloquentai/chat-sdk 0.16.2 → 0.16.4-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
+ import { default as React } from 'react';
1
2
  import { Message, MessageData } from '../../type';
2
- import { EloquentAiApiClient } from '../../lib/eloquent-ai-api-client';
3
+ import { BootResponse, EloquentAiApiClient } from '../../lib/eloquent-ai-api-client';
3
4
  export interface Conversation {
4
5
  id: string;
5
6
  }
@@ -9,13 +10,11 @@ export interface UseMessageEventsProps {
9
10
  externalId?: string | null;
10
11
  deviceId: string;
11
12
  apiClient: EloquentAiApiClient | null;
13
+ chatSettings: BootResponse["chat_settings"] | null;
12
14
  setMessages: React.Dispatch<React.SetStateAction<Message[]>>;
13
15
  currentConversation: Conversation | null;
14
16
  setCurrentConversation: React.Dispatch<React.SetStateAction<Conversation | null>>;
15
17
  setChatOpen?: React.Dispatch<React.SetStateAction<boolean>>;
16
- appSyncUrl?: string | null;
17
- appSyncRegion?: string | null;
18
- appSyncApiKey?: string | null;
19
18
  }
20
19
  export interface UseMessageEventsReturn {
21
20
  onCleanMessages: () => void;
@@ -24,4 +23,4 @@ export interface UseMessageEventsReturn {
24
23
  /**
25
24
  * Hook to handle message events like sending and cleaning
26
25
  */
27
- export declare function useMessageEvents({ appId, userId, externalId, deviceId, apiClient, setMessages, currentConversation, setCurrentConversation, setChatOpen, appSyncUrl, appSyncRegion, appSyncApiKey, }: UseMessageEventsProps): UseMessageEventsReturn;
26
+ export declare function useMessageEvents({ appId, userId, externalId, deviceId, apiClient, chatSettings, setMessages, currentConversation, setCurrentConversation, }: UseMessageEventsProps): UseMessageEventsReturn;
@@ -1,17 +1,9 @@
1
+ import { BootResponse } from '../../lib/eloquent-ai-api-client.ts';
1
2
  import { ConversationResponse } from './validations';
2
3
  type UseRealTimeEventsProps = {
3
4
  conversationId?: string;
4
5
  onReceiveMessage: (response: ConversationResponse) => void;
5
- appSyncUrl?: string | null;
6
- appSyncRegion?: string | null;
7
- appSyncApiKey?: string | null;
8
- };
9
- export declare function useRealTimeEvents({ conversationId, onReceiveMessage, appSyncUrl, appSyncRegion, appSyncApiKey, }: UseRealTimeEventsProps): {
10
- sendEventMessage: (options: {
11
- conversationId: string;
12
- deviceId: string;
13
- userId: string;
14
- message: string;
15
- }) => Promise<void>;
6
+ chatSettings: BootResponse["chat_settings"] | null;
16
7
  };
8
+ export declare function useRealTimeEvents({ conversationId, onReceiveMessage, chatSettings, }: UseRealTimeEventsProps): void;
17
9
  export {};
@@ -16,9 +16,6 @@ export interface UseSdkInitializationReturn {
16
16
  } | null;
17
17
  messages: Message[];
18
18
  isReady: boolean;
19
- appSyncUrl: string | null;
20
- appSyncRegion: string | null;
21
- appSyncApiKey: string | null;
22
19
  }
23
20
  /**
24
21
  * Hook to handle SDK initialization for the EloquentAI Chat SDK