@fencyai/react 0.1.106 → 0.1.108
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/assets/index.css +1 -1
- package/dist/chat/AgentTaskProgress.d.ts +3 -2
- package/dist/chat/ChatResponse.d.ts +3 -2
- package/dist/chat/ChatResponseComplete.d.ts +3 -2
- package/dist/hooks/useFencyEventSource/index.d.ts +1 -0
- package/dist/hooks/usePaginatedQuery/index.d.ts +10 -4
- package/dist/index.d.ts +1 -5
- package/dist/index.js +567 -1178
- package/dist/types/FencyContext.d.ts +3 -2
- package/dist/types/UseAgentTasksProps.d.ts +5 -4
- package/dist/types/UseStreamProps.d.ts +3 -2
- package/dist/types/index.d.ts +0 -24
- package/package.json +7 -4
- package/dist/chat/Chat.d.ts +0 -20
- package/dist/chat/MentionCategory.d.ts +0 -5
- package/dist/chat/MentionInput.d.ts +0 -24
- package/dist/chat/MentionOption.d.ts +0 -5
- package/dist/chat/MentionPopover.d.ts +0 -14
- package/dist/chat/hooks/useKeyboardNavigation.d.ts +0 -10
- package/dist/hooks/useListMemoryTypes/index.d.ts +0 -2
- package/dist/hooks/useSearchMemories/index.d.ts +0 -2
- package/dist/types/AiModel.d.ts +0 -2
- package/dist/types/BasicChatCompletion.d.ts +0 -8
- package/dist/types/BasicChatCompletionData.d.ts +0 -5
- package/dist/types/BasicChatCompletionResponse.d.ts +0 -9
- package/dist/types/CreateBasicChatCompletionParams.d.ts +0 -10
- package/dist/types/CreateClaudeChatCompletionParams.d.ts +0 -9
- package/dist/types/CreateGeminiChatCompletionParams.d.ts +0 -9
- package/dist/types/CreateGenericChatCompletionParams.d.ts +0 -14
- package/dist/types/CreateOpenAiChatCompletionParams.d.ts +0 -7
- package/dist/types/CreateStreamingChatCompletionParams.d.ts +0 -10
- package/dist/types/CreateStreamingChatCompletionResponse.d.ts +0 -9
- package/dist/types/CreateStructuredChatCompletionParams.d.ts +0 -12
- package/dist/types/ListMemoryTypesPage.d.ts +0 -7
- package/dist/types/ListMemoryTypesParams.d.ts +0 -5
- package/dist/types/ListMemoryTypesResult.d.ts +0 -9
- package/dist/types/SearchMemoriesParams.d.ts +0 -7
- package/dist/types/SearchMemoriesResult.d.ts +0 -8
- package/dist/types/StreamingChatCompletion.d.ts +0 -23
- package/dist/types/StreamingChatCompletionData.d.ts +0 -5
- package/dist/types/StructuredChatCompletion.d.ts +0 -9
- package/dist/types/StructuredChatCompletionData.d.ts +0 -7
- package/dist/types/StructuredChatCompletionResponse.d.ts +0 -10
- package/dist/types/UseBasicChatCompletions.d.ts +0 -8
- package/dist/types/UseListMemoryTypes.d.ts +0 -10
- package/dist/types/UseListMemoryTypesProps.d.ts +0 -3
- package/dist/types/UseSearchMemories.d.ts +0 -5
- package/dist/types/UseStreamingChatCompletions.d.ts +0 -8
- package/dist/types/UseStreamingChatCompletionsProps.d.ts +0 -12
- package/dist/types/UseStructuredChatCompletions.d.ts +0 -9
|
@@ -8,7 +8,8 @@ export interface FencyContext {
|
|
|
8
8
|
loading: boolean;
|
|
9
9
|
error: Error | null;
|
|
10
10
|
activeStream: StreamCache | null;
|
|
11
|
-
getOrCreateStream: (
|
|
12
|
-
|
|
11
|
+
getOrCreateStream: (fetchTokens: () => Promise<{
|
|
12
|
+
clientToken: string;
|
|
13
|
+
streamToken: string;
|
|
13
14
|
}>, maxAge?: number) => Promise<Stream>;
|
|
14
15
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { AgentTaskProgressItemUpdated, StreamNotFound, StreamTimeout } from './StreamData';
|
|
2
2
|
import { StreamError } from './StreamError';
|
|
3
3
|
export interface UseAgentTasksProps {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
fetchCreateStreamTokens: () => Promise<{
|
|
5
|
+
clientToken: string;
|
|
6
|
+
streamToken: string;
|
|
6
7
|
}>;
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
fetchClientToken: () => Promise<{
|
|
9
|
+
clientToken: string;
|
|
9
10
|
}>;
|
|
10
11
|
onAgentTaskProgressItemUpdated?: (streamData: AgentTaskProgressItemUpdated) => void;
|
|
11
12
|
onAgentTaskCompleted?: (streamId: string) => void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ChatCompletionStreamCompleted, NewChatCompletionStreamChunk, StreamNotFound, StreamTimeout, FileUploadCompleted, FileTextContentReady, WebsiteHtmlContentReady, WebsiteTextContentReady, FileSearchIndexReady, AgentTaskProgressItemUpdated } from './StreamData';
|
|
2
2
|
import { StreamError } from './StreamError';
|
|
3
3
|
export interface UseStreamProps {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
fetchTokens: () => Promise<{
|
|
5
|
+
clientToken: string;
|
|
6
|
+
streamToken: string;
|
|
6
7
|
}>;
|
|
7
8
|
onNewChatCompletionStreamChunk?: (streamData: NewChatCompletionStreamChunk) => void;
|
|
8
9
|
onChatCompletionStreamCompleted?: (stream: ChatCompletionStreamCompleted) => void;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,24 +1,5 @@
|
|
|
1
1
|
export * from './FencyContext';
|
|
2
2
|
export * from './FencyProviderProps';
|
|
3
|
-
export * from './CreateClaudeChatCompletionParams';
|
|
4
|
-
export * from './CreateGeminiChatCompletionParams';
|
|
5
|
-
export * from './CreateOpenAiChatCompletionParams';
|
|
6
|
-
export * from './BasicChatCompletion';
|
|
7
|
-
export * from './BasicChatCompletionData';
|
|
8
|
-
export * from './BasicChatCompletionResponse';
|
|
9
|
-
export * from './CreateBasicChatCompletionParams';
|
|
10
|
-
export * from './UseBasicChatCompletions';
|
|
11
|
-
export * from './CreateStreamingChatCompletionParams';
|
|
12
|
-
export * from './CreateStreamingChatCompletionResponse';
|
|
13
|
-
export * from './StreamingChatCompletion';
|
|
14
|
-
export * from './StreamingChatCompletionData';
|
|
15
|
-
export * from './UseStreamingChatCompletions';
|
|
16
|
-
export * from './UseStreamingChatCompletionsProps';
|
|
17
|
-
export * from './CreateStructuredChatCompletionParams';
|
|
18
|
-
export * from './StructuredChatCompletion';
|
|
19
|
-
export * from './StructuredChatCompletionData';
|
|
20
|
-
export * from './StructuredChatCompletionResponse';
|
|
21
|
-
export * from './UseStructuredChatCompletions';
|
|
22
3
|
export * from './CreateStreamResponse';
|
|
23
4
|
export * from './StreamError';
|
|
24
5
|
export * from './UseStream';
|
|
@@ -29,8 +10,3 @@ export * from './StreamingAgentTask';
|
|
|
29
10
|
export * from './StreamingAgentTaskData';
|
|
30
11
|
export * from './UseAgentTasks';
|
|
31
12
|
export * from './UseAgentTasksProps';
|
|
32
|
-
export * from './ListMemoryTypesPage';
|
|
33
|
-
export * from './ListMemoryTypesParams';
|
|
34
|
-
export * from './ListMemoryTypesResult';
|
|
35
|
-
export * from './UseListMemoryTypes';
|
|
36
|
-
export * from './UseListMemoryTypesProps';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fencyai/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.108",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "staklau <steinaageklaussen@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -31,8 +31,11 @@
|
|
|
31
31
|
"dev": "vite build --watch",
|
|
32
32
|
"prepublishOnly": "npm run build"
|
|
33
33
|
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@microsoft/fetch-event-source": "^2.0.1"
|
|
36
|
+
},
|
|
34
37
|
"devDependencies": {
|
|
35
|
-
"@fencyai/js": "^0.1.
|
|
38
|
+
"@fencyai/js": "^0.1.108",
|
|
36
39
|
"@types/jest": "^29.5.11",
|
|
37
40
|
"@types/node": "^20.10.5",
|
|
38
41
|
"@types/react": "^18.2.45",
|
|
@@ -47,7 +50,7 @@
|
|
|
47
50
|
},
|
|
48
51
|
"peerDependencies": {
|
|
49
52
|
"@emotion/is-prop-valid": "^1.3.0",
|
|
50
|
-
"@fencyai/js": "^0.1.
|
|
53
|
+
"@fencyai/js": "^0.1.108",
|
|
51
54
|
"@radix-ui/react-popover": "^1.1.15",
|
|
52
55
|
"motion": "^11.15.0",
|
|
53
56
|
"react": ">=16.8.0",
|
|
@@ -62,5 +65,5 @@
|
|
|
62
65
|
"optional": false
|
|
63
66
|
}
|
|
64
67
|
},
|
|
65
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "b6e2b8dfa4bb130b0f57dc2d4decbb08c5f91850"
|
|
66
69
|
}
|
package/dist/chat/Chat.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
type ChatProps = {
|
|
2
|
-
height?: string;
|
|
3
|
-
fetchListMemoryTypesClientSecret: () => Promise<{
|
|
4
|
-
clientSecret: string;
|
|
5
|
-
}>;
|
|
6
|
-
fetchSearchMemoriesClientSecret: () => Promise<{
|
|
7
|
-
clientSecret: string;
|
|
8
|
-
}>;
|
|
9
|
-
fetchCreateAgentTaskClientSecret: () => Promise<{
|
|
10
|
-
clientSecret: string;
|
|
11
|
-
}>;
|
|
12
|
-
fetchCreateStreamClientSecret: () => Promise<{
|
|
13
|
-
clientSecret: string;
|
|
14
|
-
}>;
|
|
15
|
-
fetchGetDownloadLinkClientSecret: (fileId: string) => Promise<{
|
|
16
|
-
clientSecret: string;
|
|
17
|
-
}>;
|
|
18
|
-
};
|
|
19
|
-
export declare const Chat: React.FC<ChatProps>;
|
|
20
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { PubMemoryDto, PubMemoryTypeDto } from '@fencyai/js';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
|
-
export type TransformedOption = {
|
|
4
|
-
type: 'option' | 'category';
|
|
5
|
-
id: string;
|
|
6
|
-
label: string;
|
|
7
|
-
};
|
|
8
|
-
export interface MentionInputProps {
|
|
9
|
-
onChange: (value: string) => void;
|
|
10
|
-
onMemoryTypeChange: (memoryTypeId: string | null) => void;
|
|
11
|
-
onTitleQueryChange: (titleQuery: string) => void;
|
|
12
|
-
onMentionChange: (memoryIds: string[]) => void;
|
|
13
|
-
onChangeMentionPlaceholders: (valueWithPlaceholders: string, memories: {
|
|
14
|
-
id: string;
|
|
15
|
-
label: string;
|
|
16
|
-
}[]) => void;
|
|
17
|
-
onSubmit?: (value: string, valueWithPlaceholders: string, memories: {
|
|
18
|
-
id: string;
|
|
19
|
-
label: string;
|
|
20
|
-
}[]) => void;
|
|
21
|
-
memoryTypes: PubMemoryTypeDto[];
|
|
22
|
-
memories: PubMemoryDto[];
|
|
23
|
-
}
|
|
24
|
-
export declare const MentionInput: React.FC<MentionInputProps>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { TransformedOption } from './MentionInput';
|
|
2
|
-
interface MentionPopoverProps {
|
|
3
|
-
isOpen: boolean;
|
|
4
|
-
options: TransformedOption[];
|
|
5
|
-
highlightedIndex: number;
|
|
6
|
-
onSelect: (index: number) => void;
|
|
7
|
-
caretElement: HTMLElement | null;
|
|
8
|
-
query: string;
|
|
9
|
-
isInCategory: boolean;
|
|
10
|
-
categoryName: string | null;
|
|
11
|
-
onResetQuery: () => void;
|
|
12
|
-
}
|
|
13
|
-
export declare const MentionPopover: React.FC<MentionPopoverProps>;
|
|
14
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface UseKeyboardNavigationProps {
|
|
2
|
-
onArrowDown: () => void;
|
|
3
|
-
onArrowUp: () => void;
|
|
4
|
-
onEnter: () => void;
|
|
5
|
-
onEscape: () => void;
|
|
6
|
-
}
|
|
7
|
-
export declare function useKeyboardNavigation({ onArrowDown, onArrowUp, onEnter, onEscape, }: UseKeyboardNavigationProps): {
|
|
8
|
-
handleKeyDown: (e: React.KeyboardEvent) => boolean;
|
|
9
|
-
};
|
|
10
|
-
export {};
|
package/dist/types/AiModel.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CreateClaudeChatCompletionParams } from './CreateClaudeChatCompletionParams';
|
|
2
|
-
import { CreateGeminiChatCompletionParams } from './CreateGeminiChatCompletionParams';
|
|
3
|
-
import { CreateOpenAiChatCompletionParams } from './CreateOpenAiChatCompletionParams';
|
|
4
|
-
import { CreateGenericChatCompletionParams } from './CreateGenericChatCompletionParams';
|
|
5
|
-
export interface CreateBasicChatCompletionParams {
|
|
6
|
-
openai?: CreateOpenAiChatCompletionParams;
|
|
7
|
-
gemini?: CreateGeminiChatCompletionParams;
|
|
8
|
-
claude?: CreateClaudeChatCompletionParams;
|
|
9
|
-
generic?: CreateGenericChatCompletionParams;
|
|
10
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AnthropicModel, ClaudeChatCompletionMessage } from '@fencyai/js';
|
|
2
|
-
export interface CreateClaudeChatCompletionParams {
|
|
3
|
-
model: AnthropicModel;
|
|
4
|
-
messages: Array<ClaudeChatCompletionMessage>;
|
|
5
|
-
systemPrompt?: string;
|
|
6
|
-
temperature?: number;
|
|
7
|
-
topP?: number;
|
|
8
|
-
topK?: number;
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { GeminiModel, GeminiChatCompletionMessage } from '@fencyai/js';
|
|
2
|
-
export interface CreateGeminiChatCompletionParams {
|
|
3
|
-
model: GeminiModel;
|
|
4
|
-
messages: Array<GeminiChatCompletionMessage>;
|
|
5
|
-
systemPrompt?: string;
|
|
6
|
-
temperature?: number;
|
|
7
|
-
topP?: number;
|
|
8
|
-
topK?: number;
|
|
9
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ChatCompletionMessage, CreateClaudeChatCompletionRequestParams, CreateGeminiChatCompletionRequestParams, CreateOpenAiChatCompletionRequestParams } from '@fencyai/js';
|
|
2
|
-
import { AiModel } from './AiModel';
|
|
3
|
-
export interface CreateGenericChatCompletionParams {
|
|
4
|
-
model: AiModel;
|
|
5
|
-
messages: Array<ChatCompletionMessage>;
|
|
6
|
-
temperature?: number;
|
|
7
|
-
topP?: number;
|
|
8
|
-
topK?: number;
|
|
9
|
-
}
|
|
10
|
-
export declare const toSpecificChatCompletionParams: (openai?: CreateOpenAiChatCompletionRequestParams, gemini?: CreateGeminiChatCompletionRequestParams, claude?: CreateClaudeChatCompletionRequestParams, generic?: CreateGenericChatCompletionParams) => {
|
|
11
|
-
openai?: CreateOpenAiChatCompletionRequestParams;
|
|
12
|
-
gemini?: CreateGeminiChatCompletionRequestParams;
|
|
13
|
-
claude?: CreateClaudeChatCompletionRequestParams;
|
|
14
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CreateOpenAiChatCompletionParams } from './CreateOpenAiChatCompletionParams';
|
|
2
|
-
import { CreateGeminiChatCompletionParams } from './CreateGeminiChatCompletionParams';
|
|
3
|
-
import { CreateClaudeChatCompletionParams } from './CreateClaudeChatCompletionParams';
|
|
4
|
-
import { CreateGenericChatCompletionParams } from './CreateGenericChatCompletionParams';
|
|
5
|
-
export interface CreateStreamingChatCompletionParams {
|
|
6
|
-
openai?: CreateOpenAiChatCompletionParams;
|
|
7
|
-
gemini?: CreateGeminiChatCompletionParams;
|
|
8
|
-
claude?: CreateClaudeChatCompletionParams;
|
|
9
|
-
generic?: CreateGenericChatCompletionParams;
|
|
10
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ZodType } from 'zod';
|
|
2
|
-
import { CreateOpenAiChatCompletionParams } from './CreateOpenAiChatCompletionParams';
|
|
3
|
-
import { CreateGeminiChatCompletionParams } from './CreateGeminiChatCompletionParams';
|
|
4
|
-
import { CreateClaudeChatCompletionParams } from './CreateClaudeChatCompletionParams';
|
|
5
|
-
import { CreateGenericChatCompletionParams } from './CreateGenericChatCompletionParams';
|
|
6
|
-
export interface CreateStructuredChatCompletionParams<T extends ZodType> {
|
|
7
|
-
openai?: CreateOpenAiChatCompletionParams;
|
|
8
|
-
gemini?: CreateGeminiChatCompletionParams;
|
|
9
|
-
claude?: CreateClaudeChatCompletionParams;
|
|
10
|
-
generic?: CreateGenericChatCompletionParams;
|
|
11
|
-
responseFormat: T;
|
|
12
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ApiError } from '@fencyai/js';
|
|
2
|
-
import { CreateClaudeChatCompletionParams } from './CreateClaudeChatCompletionParams';
|
|
3
|
-
import { CreateGenericChatCompletionParams } from './CreateGenericChatCompletionParams';
|
|
4
|
-
import { CreateGeminiChatCompletionParams } from './CreateGeminiChatCompletionParams';
|
|
5
|
-
import { CreateOpenAiChatCompletionParams } from './CreateOpenAiChatCompletionParams';
|
|
6
|
-
import { NewChatCompletionStreamChunk } from './StreamData';
|
|
7
|
-
import { StreamingChatCompletionData } from './StreamingChatCompletionData';
|
|
8
|
-
export interface StreamingChatCompletion {
|
|
9
|
-
triggeredAt: string;
|
|
10
|
-
streamId: string;
|
|
11
|
-
prompt: {
|
|
12
|
-
openai?: CreateOpenAiChatCompletionParams;
|
|
13
|
-
gemini?: CreateGeminiChatCompletionParams;
|
|
14
|
-
claude?: CreateClaudeChatCompletionParams;
|
|
15
|
-
generic?: CreateGenericChatCompletionParams;
|
|
16
|
-
};
|
|
17
|
-
data: StreamingChatCompletionData | null;
|
|
18
|
-
error: ApiError | null;
|
|
19
|
-
response: string;
|
|
20
|
-
chunks: NewChatCompletionStreamChunk[];
|
|
21
|
-
loading: boolean;
|
|
22
|
-
doneStreaming: boolean;
|
|
23
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ApiError } from '@fencyai/js';
|
|
2
|
-
import { ZodType } from 'zod';
|
|
3
|
-
import { StructuredChatCompletionData } from './StructuredChatCompletionData';
|
|
4
|
-
export interface StructuredChatCompletion<T extends ZodType> {
|
|
5
|
-
triggeredAt: string;
|
|
6
|
-
data: StructuredChatCompletionData<T> | null;
|
|
7
|
-
error: ApiError | null;
|
|
8
|
-
loading: boolean;
|
|
9
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ApiError } from '@fencyai/js';
|
|
2
|
-
import { ZodType } from 'zod';
|
|
3
|
-
import { StructuredChatCompletionData } from './StructuredChatCompletionData';
|
|
4
|
-
export type StructuredChatCompletionResponse<T extends ZodType> = {
|
|
5
|
-
type: 'success';
|
|
6
|
-
data: StructuredChatCompletionData<T>;
|
|
7
|
-
} | {
|
|
8
|
-
type: 'error';
|
|
9
|
-
error: ApiError;
|
|
10
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BasicChatCompletion } from './BasicChatCompletion';
|
|
2
|
-
import { CreateBasicChatCompletionParams } from './CreateBasicChatCompletionParams';
|
|
3
|
-
import { BasicChatCompletionResponse } from './BasicChatCompletionResponse';
|
|
4
|
-
export interface UseBasicChatCompletions {
|
|
5
|
-
chatCompletions: BasicChatCompletion[];
|
|
6
|
-
createBasicChatCompletion: (params: CreateBasicChatCompletionParams) => Promise<BasicChatCompletionResponse>;
|
|
7
|
-
latest: BasicChatCompletion | null;
|
|
8
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ListMemoryTypesPage } from './ListMemoryTypesPage';
|
|
2
|
-
import { ListMemoryTypesParams } from './ListMemoryTypesParams';
|
|
3
|
-
import { ListMemoryTypesResult } from './ListMemoryTypesResult';
|
|
4
|
-
export interface UseListMemoryTypes {
|
|
5
|
-
listFirstPage: (params: ListMemoryTypesParams) => Promise<ListMemoryTypesResult>;
|
|
6
|
-
listNextPage: (params: ListMemoryTypesParams) => Promise<ListMemoryTypesResult>;
|
|
7
|
-
listPreviousPage: (params: ListMemoryTypesParams) => Promise<ListMemoryTypesResult>;
|
|
8
|
-
refetchCurrentPage: () => Promise<ListMemoryTypesResult>;
|
|
9
|
-
currentPage: ListMemoryTypesPage | null;
|
|
10
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CreateStreamingChatCompletionParams } from './CreateStreamingChatCompletionParams';
|
|
2
|
-
import { CreateStreamingChatCompletionResponse } from './CreateStreamingChatCompletionResponse';
|
|
3
|
-
import { StreamingChatCompletion } from './StreamingChatCompletion';
|
|
4
|
-
export interface UseStreamingChatCompletions {
|
|
5
|
-
chatCompletions: StreamingChatCompletion[];
|
|
6
|
-
createStreamingChatCompletion: (params: CreateStreamingChatCompletionParams) => Promise<CreateStreamingChatCompletionResponse>;
|
|
7
|
-
latest: StreamingChatCompletion | null;
|
|
8
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ChatCompletionStreamCompleted, NewChatCompletionStreamChunk, StreamNotFound, StreamTimeout } from './StreamData';
|
|
2
|
-
import { StreamError } from './StreamError';
|
|
3
|
-
export interface UseStreamingChatCompletionsProps {
|
|
4
|
-
fetchCreateStreamClientSecret: () => Promise<{
|
|
5
|
-
clientSecret: string;
|
|
6
|
-
}>;
|
|
7
|
-
onChatCompletionStreamCompleted?: (stream: ChatCompletionStreamCompleted) => void;
|
|
8
|
-
onChatCompletionStreamChunk?: (chunk: NewChatCompletionStreamChunk) => void;
|
|
9
|
-
onStreamNotFound?: (error: StreamNotFound) => void;
|
|
10
|
-
onStreamTimeout?: (error: StreamTimeout) => void;
|
|
11
|
-
onStreamError?: (error: StreamError) => void;
|
|
12
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ZodType } from 'zod';
|
|
2
|
-
import { CreateStructuredChatCompletionParams } from './CreateStructuredChatCompletionParams';
|
|
3
|
-
import { StructuredChatCompletion } from './StructuredChatCompletion';
|
|
4
|
-
import { StructuredChatCompletionResponse } from './StructuredChatCompletionResponse';
|
|
5
|
-
export interface UseStructuredChatCompletions {
|
|
6
|
-
chatCompletions: StructuredChatCompletion<ZodType>[];
|
|
7
|
-
createStructuredChatCompletion: <T extends ZodType>(params: CreateStructuredChatCompletionParams<T>) => Promise<StructuredChatCompletionResponse<T>>;
|
|
8
|
-
latest: StructuredChatCompletion<ZodType> | null;
|
|
9
|
-
}
|