@fencyai/react 0.1.83 → 0.1.85
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.
- package/dist/chat/Chat.d.ts +10 -4
- package/dist/chat/MentionInput.d.ts +6 -9
- package/dist/hooks/useListMemories/index.d.ts +2 -0
- package/dist/hooks/useListMemoryTypes/index.d.ts +2 -0
- package/dist/hooks/usePaginatedQuery/index.d.ts +51 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.js +3382 -3419
- package/dist/types/ListMemoriesPage.d.ts +7 -0
- package/dist/types/ListMemoriesParams.d.ts +12 -0
- package/dist/types/ListMemoriesResult.d.ts +9 -0
- package/dist/types/ListMemoryTypesPage.d.ts +7 -0
- package/dist/types/{ListFilesParams.d.ts → ListMemoryTypesParams.d.ts} +1 -1
- package/dist/types/ListMemoryTypesResult.d.ts +9 -0
- package/dist/types/UseListMemories.d.ts +10 -0
- package/dist/types/UseListMemoryTypes.d.ts +10 -0
- package/dist/types/UseListMemoryTypesProps.d.ts +3 -0
- package/dist/types/index.d.ts +5 -13
- package/package.json +4 -4
- package/dist/hooks/useCreateFiles/index.d.ts +0 -3
- package/dist/hooks/useListFiles/index.d.ts +0 -3
- package/dist/hooks/useSearchFiles/index.d.ts +0 -2
- package/dist/hooks/useWebsites/index.d.ts +0 -3
- package/dist/types/CreateFileParams.d.ts +0 -9
- package/dist/types/CreateWebsiteParams.d.ts +0 -5
- package/dist/types/ListFilesPage.d.ts +0 -8
- package/dist/types/ListFilesResult.d.ts +0 -9
- package/dist/types/SearchFilesParams.d.ts +0 -6
- package/dist/types/UseCreateFiles.d.ts +0 -6
- package/dist/types/UseCreateFilesProps.d.ts +0 -6
- package/dist/types/UseListFiles.d.ts +0 -10
- package/dist/types/UseListFilesProps.d.ts +0 -3
- package/dist/types/UseSearchFiles.d.ts +0 -6
- package/dist/types/UseWebsites.d.ts +0 -6
- package/dist/types/UseWebsitesProps.d.ts +0 -5
package/dist/chat/Chat.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import { MentionInputProps } from './MentionInput';
|
|
3
|
-
type ChatProps = MentionInputProps & {
|
|
1
|
+
type ChatProps = {
|
|
4
2
|
height?: string;
|
|
5
|
-
|
|
3
|
+
fetchListMemoryTypesClientSecret: () => Promise<{
|
|
4
|
+
clientSecret: string;
|
|
5
|
+
}>;
|
|
6
|
+
fetchListMemoriesClientSecret: () => Promise<{
|
|
7
|
+
clientSecret: string;
|
|
8
|
+
}>;
|
|
9
|
+
fetchCreateAgentTaskClientSecret: () => Promise<{
|
|
10
|
+
clientSecret: string;
|
|
11
|
+
}>;
|
|
6
12
|
};
|
|
7
13
|
export declare const Chat: React.FC<ChatProps>;
|
|
8
14
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PubMemoryDto, PubMemoryTypeDto } from '@fencyai/js/lib/openapi';
|
|
1
2
|
import { default as React } from 'react';
|
|
2
3
|
export type TransformedOption = {
|
|
3
4
|
type: 'option' | 'category';
|
|
@@ -6,15 +7,11 @@ export type TransformedOption = {
|
|
|
6
7
|
};
|
|
7
8
|
export interface MentionInputProps {
|
|
8
9
|
onChange: (value: string) => void;
|
|
9
|
-
|
|
10
|
+
onMemoryTypeChange: (memoryTypeId: string | null) => void;
|
|
11
|
+
onTitleQueryChange: (titleQuery: string) => void;
|
|
12
|
+
onMentionChange: (memoryIds: string[]) => void;
|
|
10
13
|
onChangeMentionPlaceholders: (valueWithPlaceholders: string) => void;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
label: string;
|
|
14
|
-
}[]>;
|
|
15
|
-
fetchCategories: () => Promise<{
|
|
16
|
-
id: string;
|
|
17
|
-
label: string;
|
|
18
|
-
}[]>;
|
|
14
|
+
memoryTypes: PubMemoryTypeDto[];
|
|
15
|
+
memories: PubMemoryDto[];
|
|
19
16
|
}
|
|
20
17
|
export declare const MentionInput: React.FC<MentionInputProps>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ApiError } from '@fencyai/js';
|
|
2
|
+
import { PaginationDto } from '@fencyai/js/lib/openapi';
|
|
3
|
+
export interface PaginatedParams {
|
|
4
|
+
fetchClientSecret: () => Promise<{
|
|
5
|
+
clientSecret: string;
|
|
6
|
+
}>;
|
|
7
|
+
}
|
|
8
|
+
export interface PaginatedPage<TItem> {
|
|
9
|
+
items: TItem[];
|
|
10
|
+
hasNextPage: boolean;
|
|
11
|
+
hasPreviousPage: boolean;
|
|
12
|
+
pagination: PaginationDto;
|
|
13
|
+
}
|
|
14
|
+
export type PaginatedResult<TItem> = {
|
|
15
|
+
type: 'success';
|
|
16
|
+
page: PaginatedPage<TItem>;
|
|
17
|
+
} | {
|
|
18
|
+
type: 'error';
|
|
19
|
+
error: ApiError;
|
|
20
|
+
};
|
|
21
|
+
export interface UsePaginatedQueryProps {
|
|
22
|
+
pageSize?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface UsePaginatedQuery<TItem, TParams extends PaginatedParams> {
|
|
25
|
+
fetchFirstPage: (params: TParams) => Promise<PaginatedResult<TItem>>;
|
|
26
|
+
fetchNextPage: (params: TParams) => Promise<PaginatedResult<TItem>>;
|
|
27
|
+
fetchPreviousPage: (params: TParams) => Promise<PaginatedResult<TItem>>;
|
|
28
|
+
refetchCurrentPage: () => Promise<PaginatedResult<TItem>>;
|
|
29
|
+
currentPage: PaginatedPage<TItem> | null;
|
|
30
|
+
}
|
|
31
|
+
export interface ApiResponse<TItem> {
|
|
32
|
+
type: 'success' | 'error';
|
|
33
|
+
items?: TItem[];
|
|
34
|
+
pagination?: PaginationDto;
|
|
35
|
+
error?: ApiError;
|
|
36
|
+
}
|
|
37
|
+
export interface FetchFunction<TItem, TRequest = {}> {
|
|
38
|
+
(options: {
|
|
39
|
+
pk: string;
|
|
40
|
+
clientSecret: string;
|
|
41
|
+
request: TRequest & {
|
|
42
|
+
limit: number;
|
|
43
|
+
pagination: {
|
|
44
|
+
nextPageToken?: string;
|
|
45
|
+
previousPageToken?: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
baseUrl?: string;
|
|
49
|
+
}): Promise<ApiResponse<TItem>>;
|
|
50
|
+
}
|
|
51
|
+
export declare function usePaginatedQuery<TItem, TParams extends PaginatedParams = PaginatedParams, TRequest = {}>(fetchFn: FetchFunction<TItem, TRequest>, props?: UsePaginatedQueryProps): UsePaginatedQuery<TItem, TParams>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
export { useBasicChatCompletions } from './hooks/useBasicChatCompletions';
|
|
2
|
-
export { useCreateFiles } from './hooks/useCreateFiles';
|
|
3
2
|
export { useFencyEventSource } from './hooks/useFencyEventSource';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
3
|
+
export { useListMemories } from './hooks/useListMemories';
|
|
4
|
+
export { useListMemoryTypes } from './hooks/useListMemoryTypes';
|
|
5
|
+
export { usePaginatedQuery } from './hooks/usePaginatedQuery';
|
|
6
6
|
export { useStream } from './hooks/useStream';
|
|
7
7
|
export { useStreamingChatCompletions } from './hooks/useStreamingChatCompletions';
|
|
8
8
|
export { useStructuredChatCompletions } from './hooks/useStructuredChatCompletions';
|
|
9
|
-
export { useWebsites } from './hooks/useWebsites';
|
|
10
|
-
export { ChatResponse } from './chat/ChatResponse';
|
|
11
9
|
export { Chat } from './chat/Chat';
|
|
10
|
+
export { ChatResponse } from './chat/ChatResponse';
|
|
12
11
|
export { MentionInput } from './chat/MentionInput';
|
|
13
12
|
export { MentionPopover } from './chat/MentionPopover';
|
|
14
13
|
export { FencyProvider } from './provider/FencyProvider';
|