@fencyai/react 0.1.84 → 0.1.86

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,8 +1,14 @@
1
- import { ChatResponseProps } from './ChatResponse';
2
- import { MentionInputProps } from './MentionInput';
3
- type ChatProps = MentionInputProps & {
1
+ type ChatProps = {
4
2
  height?: string;
5
- response: ChatResponseProps;
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
- onMentionChange: (mentionedIds: string[]) => void;
10
+ onMemoryTypeChange: (memoryTypeId: string | null) => void;
11
+ onTitleQueryChange: (titleQuery: string) => void;
12
+ onMentionChange: (memoryIds: string[]) => void;
10
13
  onChangeMentionPlaceholders: (valueWithPlaceholders: string) => void;
11
- fetchOptions: (query: string) => Promise<{
12
- id: string;
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,2 @@
1
+ import { UseListMemories } from '../../types/UseListMemories';
2
+ export declare function useListMemories(): UseListMemories;
@@ -34,11 +34,11 @@ export interface ApiResponse<TItem> {
34
34
  pagination?: PaginationDto;
35
35
  error?: ApiError;
36
36
  }
37
- export interface FetchFunction<TItem> {
37
+ export interface FetchFunction<TItem, TRequest = {}> {
38
38
  (options: {
39
39
  pk: string;
40
40
  clientSecret: string;
41
- request: {
41
+ request: TRequest & {
42
42
  limit: number;
43
43
  pagination: {
44
44
  nextPageToken?: string;
@@ -48,4 +48,4 @@ export interface FetchFunction<TItem> {
48
48
  baseUrl?: string;
49
49
  }): Promise<ApiResponse<TItem>>;
50
50
  }
51
- export declare function usePaginatedQuery<TItem, TParams extends PaginatedParams = PaginatedParams>(fetchFn: FetchFunction<TItem>, props?: UsePaginatedQueryProps): UsePaginatedQuery<TItem, TParams>;
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,5 +1,6 @@
1
1
  export { useBasicChatCompletions } from './hooks/useBasicChatCompletions';
2
2
  export { useFencyEventSource } from './hooks/useFencyEventSource';
3
+ export { useListMemories } from './hooks/useListMemories';
3
4
  export { useListMemoryTypes } from './hooks/useListMemoryTypes';
4
5
  export { usePaginatedQuery } from './hooks/usePaginatedQuery';
5
6
  export { useStream } from './hooks/useStream';