@fencyai/js 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/lib/api/createChatCompletion.d.ts +1 -18
- package/lib/api/createStream.d.ts +0 -8
- package/lib/api/createStream.js +0 -8
- package/lib/api/listMemories.d.ts +8 -0
- package/lib/api/listMemories.js +54 -0
- package/lib/api/listMemoryTypes.d.ts +6 -0
- package/lib/api/{searchFiles.js → listMemoryTypes.js} +5 -13
- package/lib/index.d.ts +4 -18
- package/lib/index.js +4 -24
- package/lib/loadFency.d.ts +1 -1
- package/lib/openapi/index.d.ts +6 -14
- package/lib/openapi/models/ListMemoriesResponse.d.ts +6 -0
- package/lib/openapi/models/ListMemoryTypesResponse.d.ts +6 -0
- package/lib/openapi/models/{ChatCompletionDto.d.ts → PubChatCompletionDto.d.ts} +1 -1
- package/lib/openapi/models/{CreateChatCompletionRequest.d.ts → PubCreateChatCompletionRequest.d.ts} +1 -1
- package/lib/openapi/models/PubMemoryDto.d.ts +5 -0
- package/lib/openapi/models/PubMemoryTypeDto.d.ts +5 -0
- package/lib/openapi/services/PubService.d.ts +16 -32
- package/lib/openapi/services/PubService.js +16 -40
- package/lib/types/CreateChatCompletionResponse.d.ts +9 -0
- package/lib/types/FencyInstance.d.ts +4 -0
- package/lib/types/FencyOptions.d.ts +6 -0
- package/lib/types/ListMemoriesRequest.d.ts +8 -0
- package/lib/types/ListMemoriesResponse.d.ts +10 -0
- package/lib/types/ListMemoryTypesResponse.d.ts +10 -0
- package/lib/types/index.d.ts +7 -13
- package/lib/utils/version.js +1 -1
- package/package.json +2 -2
- package/lib/api/createFile.d.ts +0 -16
- package/lib/api/createFile.js +0 -67
- package/lib/api/createWebsite.d.ts +0 -16
- package/lib/api/createWebsite.js +0 -46
- package/lib/api/listFiles.d.ts +0 -16
- package/lib/api/listFiles.js +0 -47
- package/lib/api/searchFiles.d.ts +0 -16
- package/lib/openapi/models/CreateFileFromPostRequestParams.d.ts +0 -5
- package/lib/openapi/models/CreateFileFromUrlParams.d.ts +0 -3
- package/lib/openapi/models/CreateWebsiteRequest.d.ts +0 -6
- package/lib/openapi/models/FileMatchingChunk.d.ts +0 -5
- package/lib/openapi/models/FileSearchItem.d.ts +0 -9
- package/lib/openapi/models/FileSearchResponse.d.ts +0 -4
- package/lib/openapi/models/ListFilesResponse.d.ts +0 -6
- package/lib/openapi/models/PubCreateFileRequest.d.ts +0 -8
- package/lib/openapi/models/PubFileDto.d.ts +0 -9
- package/lib/openapi/models/PubFileListDto.d.ts +0 -11
- package/lib/openapi/models/PubWebsiteDto.d.ts +0 -5
- package/lib/openapi/models/PubWebsiteDto.js +0 -1
- package/lib/openapi/models/S3PostRequestDto.d.ts +0 -10
- package/lib/openapi/models/S3PostRequestDto.js +0 -1
- package/lib/types/CreateFileRequest.d.ts +0 -8
- package/lib/types/CreateFileRequest.js +0 -1
- package/lib/types/CreateFileResponse.d.ts +0 -9
- package/lib/types/CreateFileResponse.js +0 -1
- package/lib/types/CreateWebsiteRequest.d.ts +0 -6
- package/lib/types/CreateWebsiteRequest.js +0 -1
- package/lib/types/CreateWebsiteResponse.d.ts +0 -9
- package/lib/types/CreateWebsiteResponse.js +0 -1
- package/lib/types/FencyFile.d.ts +0 -11
- package/lib/types/FencyFile.js +0 -1
- package/lib/types/FencyListFileItem.d.ts +0 -11
- package/lib/types/FencyListFileItem.js +0 -1
- package/lib/types/FileSearchItem.d.ts +0 -8
- package/lib/types/FileSearchItem.js +0 -1
- package/lib/types/ListFilesRequest.d.ts +0 -6
- package/lib/types/ListFilesRequest.js +0 -1
- package/lib/types/ListFilesResponse.d.ts +0 -11
- package/lib/types/ListFilesResponse.js +0 -1
- package/lib/types/SearchFilesRequest.d.ts +0 -4
- package/lib/types/SearchFilesRequest.js +0 -1
- package/lib/types/SearchFilesResponse.d.ts +0 -9
- package/lib/types/SearchFilesResponse.js +0 -1
- package/lib/types/Website.d.ts +0 -7
- package/lib/types/Website.js +0 -1
- package/lib/types.d.ts +0 -17
- package/lib/types.js +0 -1
- /package/lib/openapi/models/{ChatCompletionDto.js → ListMemoriesResponse.js} +0 -0
- /package/lib/openapi/models/{CreateChatCompletionRequest.js → ListMemoryTypesResponse.js} +0 -0
- /package/lib/openapi/models/{CreateFileFromPostRequestParams.js → PubChatCompletionDto.js} +0 -0
- /package/lib/openapi/models/{CreateFileFromUrlParams.js → PubCreateChatCompletionRequest.js} +0 -0
- /package/lib/openapi/models/{CreateWebsiteRequest.js → PubMemoryDto.js} +0 -0
- /package/lib/openapi/models/{FileMatchingChunk.js → PubMemoryTypeDto.js} +0 -0
- /package/lib/{openapi/models/FileSearchItem.js → types/CreateChatCompletionResponse.js} +0 -0
- /package/lib/{openapi/models/FileSearchResponse.js → types/FencyInstance.js} +0 -0
- /package/lib/{openapi/models/ListFilesResponse.js → types/FencyOptions.js} +0 -0
- /package/lib/{openapi/models/PubCreateFileRequest.js → types/ListMemoriesRequest.js} +0 -0
- /package/lib/{openapi/models/PubFileDto.js → types/ListMemoriesResponse.js} +0 -0
- /package/lib/{openapi/models/PubFileListDto.js → types/ListMemoryTypesResponse.js} +0 -0
|
@@ -1,22 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatCompletion } from '../types/ChatCompletion';
|
|
1
|
+
import { CreateChatCompletionResponse } from '..';
|
|
3
2
|
import { CreateChatCompletionRequest } from '../types/CreateChatCompletionRequest';
|
|
4
|
-
/**
|
|
5
|
-
* Creates a chat completion by making a POST request to the Fency API.
|
|
6
|
-
*
|
|
7
|
-
* @param pk - The publishable key (used as Bearer token)
|
|
8
|
-
* @param streamId - The stream ID to associate with the chat completion
|
|
9
|
-
* @param options - Optional configuration (apiUrl, request overrides)
|
|
10
|
-
* @returns A promise that resolves to a ChatCompletionResponse
|
|
11
|
-
* @throws Error if the request fails or the response is invalid
|
|
12
|
-
*/
|
|
13
|
-
export type CreateChatCompletionResponse = {
|
|
14
|
-
type: 'success';
|
|
15
|
-
completion: ChatCompletion;
|
|
16
|
-
} | {
|
|
17
|
-
type: 'error';
|
|
18
|
-
error: ApiError;
|
|
19
|
-
};
|
|
20
3
|
export declare function createChatCompletion(params: {
|
|
21
4
|
pk: string;
|
|
22
5
|
request: CreateChatCompletionRequest;
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { CreateStreamRequest } from '../types/CreateStreamRequest';
|
|
2
2
|
import { CreateStreamResponse } from '../types/CreateStreamResponse';
|
|
3
|
-
/**
|
|
4
|
-
* Creates a new stream by making a POST request to the Fency API.
|
|
5
|
-
*
|
|
6
|
-
* @param pk - The publishable key (used as Bearer token and default name)
|
|
7
|
-
* @param options - Optional configuration (apiUrl, name)
|
|
8
|
-
* @returns A promise that resolves to a Stream
|
|
9
|
-
* @throws Error if the request fails or the response is invalid
|
|
10
|
-
*/
|
|
11
3
|
export declare function createStream(params: {
|
|
12
4
|
pk: string;
|
|
13
5
|
request: CreateStreamRequest;
|
package/lib/api/createStream.js
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { OpenAPI, PubService, StreamType } from '../openapi';
|
|
2
2
|
import { getPackageVersion } from '../utils/version';
|
|
3
|
-
/**
|
|
4
|
-
* Creates a new stream by making a POST request to the Fency API.
|
|
5
|
-
*
|
|
6
|
-
* @param pk - The publishable key (used as Bearer token and default name)
|
|
7
|
-
* @param options - Optional configuration (apiUrl, name)
|
|
8
|
-
* @returns A promise that resolves to a Stream
|
|
9
|
-
* @throws Error if the request fails or the response is invalid
|
|
10
|
-
*/
|
|
11
3
|
export async function createStream(params) {
|
|
12
4
|
try {
|
|
13
5
|
OpenAPI.BASE = params.baseUrl;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ListMemoriesRequest } from '../types/ListMemoriesRequest';
|
|
2
|
+
import { ListMemoriesResponse } from '../types/ListMemoriesResponse';
|
|
3
|
+
export declare function listMemories(params: {
|
|
4
|
+
pk: string;
|
|
5
|
+
clientSecret: string;
|
|
6
|
+
request: ListMemoriesRequest;
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
}): Promise<ListMemoriesResponse>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { getPackageVersion } from '../utils/version';
|
|
2
|
+
export async function listMemories(params) {
|
|
3
|
+
try {
|
|
4
|
+
const response = await listMemoriesApi({
|
|
5
|
+
baseUrl: params.baseUrl,
|
|
6
|
+
pk: params.pk,
|
|
7
|
+
clientSecret: params.clientSecret,
|
|
8
|
+
nextPageToken: params.request.nextPageToken,
|
|
9
|
+
previousPageToken: params.request.previousPageToken,
|
|
10
|
+
limit: params.request.limit,
|
|
11
|
+
typeName: params.request.typeName,
|
|
12
|
+
title: params.request.title,
|
|
13
|
+
meta: params.request.meta,
|
|
14
|
+
});
|
|
15
|
+
return {
|
|
16
|
+
type: 'success',
|
|
17
|
+
items: response.items,
|
|
18
|
+
pagination: response.pagination,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function listMemoriesApi(params) {
|
|
26
|
+
const queryParams = new URLSearchParams();
|
|
27
|
+
if (params.nextPageToken)
|
|
28
|
+
queryParams.append('nextPageToken', params.nextPageToken);
|
|
29
|
+
if (params.previousPageToken)
|
|
30
|
+
queryParams.append('previousPageToken', params.previousPageToken);
|
|
31
|
+
if (params.limit !== undefined)
|
|
32
|
+
queryParams.append('limit', params.limit.toString());
|
|
33
|
+
if (params.typeName)
|
|
34
|
+
queryParams.append('typeName', encodeURIComponent(params.typeName));
|
|
35
|
+
if (params.title)
|
|
36
|
+
queryParams.append('title', encodeURIComponent(params.title));
|
|
37
|
+
// Handle meta object - encode as key-value pairs
|
|
38
|
+
if (params.meta && Object.keys(params.meta).length > 0) {
|
|
39
|
+
Object.entries(params.meta).forEach(([key, value]) => {
|
|
40
|
+
queryParams.append(`meta_${encodeURIComponent(key)}`, value);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
const queryString = queryParams.toString();
|
|
44
|
+
const response = await fetch(`${params.baseUrl}/v1/pub/memories?${queryString}`, {
|
|
45
|
+
method: 'GET',
|
|
46
|
+
headers: {
|
|
47
|
+
'Content-Type': 'application/json',
|
|
48
|
+
Authorization: `Bearer ${params.pk}`,
|
|
49
|
+
'X-Fency-Sdk-Version': getPackageVersion(),
|
|
50
|
+
'X-Fency-Client-Secret': params.clientSecret,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
return response.json();
|
|
54
|
+
}
|
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
import { OpenAPI, PubService } from '../openapi';
|
|
2
2
|
import { getPackageVersion } from '../utils/version';
|
|
3
|
-
|
|
4
|
-
* Creates a website by making a POST request to the Fency API.
|
|
5
|
-
*
|
|
6
|
-
* @param pk - The publishable key (used as Bearer token)
|
|
7
|
-
* @param request - The request body
|
|
8
|
-
* @param options - Optional configuration (apiUrl, request overrides)
|
|
9
|
-
* @returns A promise that resolves to a CreateWebsiteResponse
|
|
10
|
-
* @throws Error if the request fails or the response is invalid
|
|
11
|
-
*/
|
|
12
|
-
export async function searchFiles(params) {
|
|
3
|
+
export async function listMemoryTypes(params) {
|
|
13
4
|
try {
|
|
14
5
|
OpenAPI.BASE = params.baseUrl;
|
|
15
6
|
OpenAPI.HEADERS = {
|
|
16
7
|
'Content-Type': 'application/json',
|
|
17
8
|
Authorization: `Bearer ${params.pk}`,
|
|
18
9
|
'X-Fency-Sdk-Version': getPackageVersion(),
|
|
19
|
-
'X-Fency-Client-Secret': params.
|
|
10
|
+
'X-Fency-Client-Secret': params.clientSecret,
|
|
20
11
|
};
|
|
21
|
-
const response = await PubService.
|
|
12
|
+
const response = await PubService.listMemoryTypes();
|
|
22
13
|
return {
|
|
23
14
|
type: 'success',
|
|
24
|
-
|
|
15
|
+
items: response.items,
|
|
16
|
+
pagination: response.pagination,
|
|
25
17
|
};
|
|
26
18
|
}
|
|
27
19
|
catch (error) {
|
package/lib/index.d.ts
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import { createStream } from './api/createStream';
|
|
3
|
-
import { loadFency } from './loadFency';
|
|
1
|
+
export { loadFency } from './loadFency';
|
|
4
2
|
export type { FencyInstance, FencyOptions } from './types';
|
|
5
3
|
export * from './types/index';
|
|
4
|
+
export type { ChatCompletionStreamCompletedEventDto, FileTextContentReadyEventDto, FileUploadCompletedEventDto, NewChatCompletionStreamChunkEventDto, StreamNotFoundEventDto, StreamTimeoutEventDto, WebsiteHtmlContentReadyEventDto, WebsiteTextContentReadyEventDto, } from './openapi';
|
|
6
5
|
export { createChatCompletion } from './api/createChatCompletion';
|
|
7
|
-
export type { CreateChatCompletionResponse } from './api/createChatCompletion';
|
|
8
|
-
export { searchFiles } from './api/searchFiles';
|
|
9
|
-
export type { FileSearchItem, FileSearchResponse } from './openapi';
|
|
10
|
-
export { createFile } from './api/createFile';
|
|
11
|
-
export type { S3PostRequestDto } from './openapi';
|
|
12
6
|
export { createStream } from './api/createStream';
|
|
13
|
-
export
|
|
14
|
-
export {
|
|
15
|
-
export { createWebsite } from './api/createWebsite';
|
|
16
|
-
export { loadFency } from './loadFency';
|
|
17
|
-
declare const _default: {
|
|
18
|
-
loadFency: typeof loadFency;
|
|
19
|
-
createChatCompletion: typeof createChatCompletion;
|
|
20
|
-
createStream: typeof createStream;
|
|
21
|
-
};
|
|
22
|
-
export default _default;
|
|
7
|
+
export { listMemoryTypes } from './api/listMemoryTypes';
|
|
8
|
+
export { listMemories } from './api/listMemories';
|
package/lib/index.js
CHANGED
|
@@ -1,27 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
// This is the base library that provides the loadFency method
|
|
3
|
-
// Import main functions
|
|
4
|
-
import { createChatCompletion } from './api/createChatCompletion';
|
|
5
|
-
import { createStream } from './api/createStream';
|
|
6
|
-
import { loadFency } from './loadFency';
|
|
1
|
+
export { loadFency } from './loadFency';
|
|
7
2
|
export * from './types/index';
|
|
8
|
-
//
|
|
3
|
+
// api
|
|
9
4
|
export { createChatCompletion } from './api/createChatCompletion';
|
|
10
|
-
// search files
|
|
11
|
-
export { searchFiles } from './api/searchFiles';
|
|
12
|
-
// uploads
|
|
13
|
-
export { createFile } from './api/createFile';
|
|
14
|
-
// create chat completion stre am
|
|
15
5
|
export { createStream } from './api/createStream';
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
// create website
|
|
19
|
-
export { createWebsite } from './api/createWebsite';
|
|
20
|
-
// load fency
|
|
21
|
-
export { loadFency } from './loadFency';
|
|
22
|
-
// Default export for convenience
|
|
23
|
-
export default {
|
|
24
|
-
loadFency,
|
|
25
|
-
createChatCompletion,
|
|
26
|
-
createStream,
|
|
27
|
-
};
|
|
6
|
+
export { listMemoryTypes } from './api/listMemoryTypes';
|
|
7
|
+
export { listMemories } from './api/listMemories';
|
package/lib/loadFency.d.ts
CHANGED
package/lib/openapi/index.d.ts
CHANGED
|
@@ -3,34 +3,26 @@ export { CancelablePromise, CancelError } from './core/CancelablePromise';
|
|
|
3
3
|
export { OpenAPI } from './core/OpenAPI';
|
|
4
4
|
export type { OpenAPIConfig } from './core/OpenAPI';
|
|
5
5
|
export { ApiDtoType } from './models/ApiDtoType';
|
|
6
|
-
export type { ChatCompletionDto } from './models/ChatCompletionDto';
|
|
7
6
|
export type { ChatCompletionStreamCompletedEventDto } from './models/ChatCompletionStreamCompletedEventDto';
|
|
8
|
-
export type { CreateChatCompletionRequest } from './models/CreateChatCompletionRequest';
|
|
9
7
|
export type { CreateChatCompletionStreamRequest } from './models/CreateChatCompletionStreamRequest';
|
|
10
8
|
export type { CreateClaudeChatCompletionDto } from './models/CreateClaudeChatCompletionDto';
|
|
11
9
|
export type { CreateClaudeChatCompletionMessageDto } from './models/CreateClaudeChatCompletionMessageDto';
|
|
12
|
-
export type { CreateFileFromPostRequestParams } from './models/CreateFileFromPostRequestParams';
|
|
13
|
-
export type { CreateFileFromUrlParams } from './models/CreateFileFromUrlParams';
|
|
14
10
|
export type { CreateGeminiChatCompletionDto } from './models/CreateGeminiChatCompletionDto';
|
|
15
11
|
export type { CreateGeminiChatCompletionMessageDto } from './models/CreateGeminiChatCompletionMessageDto';
|
|
16
12
|
export type { CreateOpenAiChatCompletionDto } from './models/CreateOpenAiChatCompletionDto';
|
|
17
13
|
export type { CreateOpenAiChatCompletionMessageDto } from './models/CreateOpenAiChatCompletionMessageDto';
|
|
18
14
|
export type { CreateStreamRequest } from './models/CreateStreamRequest';
|
|
19
|
-
export type { CreateWebsiteRequest } from './models/CreateWebsiteRequest';
|
|
20
|
-
export type { FileMatchingChunk } from './models/FileMatchingChunk';
|
|
21
15
|
export type { FileSearchIndexReadyEventDto } from './models/FileSearchIndexReadyEventDto';
|
|
22
|
-
export type { FileSearchItem } from './models/FileSearchItem';
|
|
23
|
-
export type { FileSearchResponse } from './models/FileSearchResponse';
|
|
24
16
|
export type { FileTextContentReadyEventDto } from './models/FileTextContentReadyEventDto';
|
|
25
17
|
export type { FileUploadCompletedEventDto } from './models/FileUploadCompletedEventDto';
|
|
26
|
-
export type {
|
|
18
|
+
export type { ListMemoriesResponse } from './models/ListMemoriesResponse';
|
|
19
|
+
export type { ListMemoryTypesResponse } from './models/ListMemoryTypesResponse';
|
|
27
20
|
export type { NewChatCompletionStreamChunkEventDto } from './models/NewChatCompletionStreamChunkEventDto';
|
|
28
21
|
export type { PaginationDto } from './models/PaginationDto';
|
|
29
|
-
export type {
|
|
30
|
-
export type {
|
|
31
|
-
export type {
|
|
32
|
-
export type {
|
|
33
|
-
export type { S3PostRequestDto } from './models/S3PostRequestDto';
|
|
22
|
+
export type { PubChatCompletionDto } from './models/PubChatCompletionDto';
|
|
23
|
+
export type { PubCreateChatCompletionRequest } from './models/PubCreateChatCompletionRequest';
|
|
24
|
+
export type { PubMemoryDto } from './models/PubMemoryDto';
|
|
25
|
+
export type { PubMemoryTypeDto } from './models/PubMemoryTypeDto';
|
|
34
26
|
export type { StreamDto } from './models/StreamDto';
|
|
35
27
|
export { StreamEventType } from './models/StreamEventType';
|
|
36
28
|
export type { StreamNotFoundEventDto } from './models/StreamNotFoundEventDto';
|
package/lib/openapi/models/{CreateChatCompletionRequest.d.ts → PubCreateChatCompletionRequest.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CreateClaudeChatCompletionDto } from './CreateClaudeChatCompletionDto';
|
|
2
2
|
import type { CreateGeminiChatCompletionDto } from './CreateGeminiChatCompletionDto';
|
|
3
3
|
import type { CreateOpenAiChatCompletionDto } from './CreateOpenAiChatCompletionDto';
|
|
4
|
-
export type
|
|
4
|
+
export type PubCreateChatCompletionRequest = {
|
|
5
5
|
streamId?: string | null;
|
|
6
6
|
sessionClientSecret?: string | null;
|
|
7
7
|
openai?: CreateOpenAiChatCompletionDto;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import type { ChatCompletionDto } from '../models/ChatCompletionDto';
|
|
2
1
|
import type { ChatCompletionStreamCompletedEventDto } from '../models/ChatCompletionStreamCompletedEventDto';
|
|
3
|
-
import type { CreateChatCompletionRequest } from '../models/CreateChatCompletionRequest';
|
|
4
2
|
import type { CreateStreamRequest } from '../models/CreateStreamRequest';
|
|
5
|
-
import type { CreateWebsiteRequest } from '../models/CreateWebsiteRequest';
|
|
6
3
|
import type { FileSearchIndexReadyEventDto } from '../models/FileSearchIndexReadyEventDto';
|
|
7
|
-
import type { FileSearchResponse } from '../models/FileSearchResponse';
|
|
8
4
|
import type { FileTextContentReadyEventDto } from '../models/FileTextContentReadyEventDto';
|
|
9
5
|
import type { FileUploadCompletedEventDto } from '../models/FileUploadCompletedEventDto';
|
|
10
|
-
import type {
|
|
6
|
+
import type { ListMemoriesResponse } from '../models/ListMemoriesResponse';
|
|
7
|
+
import type { ListMemoryTypesResponse } from '../models/ListMemoryTypesResponse';
|
|
11
8
|
import type { NewChatCompletionStreamChunkEventDto } from '../models/NewChatCompletionStreamChunkEventDto';
|
|
12
|
-
import type {
|
|
13
|
-
import type {
|
|
14
|
-
import type { PubWebsiteDto } from '../models/PubWebsiteDto';
|
|
9
|
+
import type { PubChatCompletionDto } from '../models/PubChatCompletionDto';
|
|
10
|
+
import type { PubCreateChatCompletionRequest } from '../models/PubCreateChatCompletionRequest';
|
|
15
11
|
import type { StreamDto } from '../models/StreamDto';
|
|
16
12
|
import type { StreamNotFoundEventDto } from '../models/StreamNotFoundEventDto';
|
|
17
13
|
import type { StreamTimeoutEventDto } from '../models/StreamTimeoutEventDto';
|
|
@@ -20,35 +16,30 @@ import type { WebsiteTextContentReadyEventDto } from '../models/WebsiteTextConte
|
|
|
20
16
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
21
17
|
export declare class PubService {
|
|
22
18
|
/**
|
|
23
|
-
* Create
|
|
19
|
+
* Create ChatCompletion
|
|
24
20
|
* @param requestBody
|
|
25
|
-
* @returns
|
|
21
|
+
* @returns PubChatCompletionDto OK
|
|
26
22
|
* @throws ApiError
|
|
27
23
|
*/
|
|
28
|
-
static createChatCompletion(requestBody:
|
|
24
|
+
static createChatCompletion(requestBody: PubCreateChatCompletionRequest): CancelablePromise<PubChatCompletionDto>;
|
|
29
25
|
/**
|
|
30
|
-
* List
|
|
26
|
+
* List Memories
|
|
31
27
|
* @param nextPageToken
|
|
32
28
|
* @param previousPageToken
|
|
33
29
|
* @param limit
|
|
34
|
-
* @returns
|
|
35
|
-
* @throws ApiError
|
|
36
|
-
*/
|
|
37
|
-
static listFiles(nextPageToken?: string, previousPageToken?: string, limit?: number): CancelablePromise<ListFilesResponse>;
|
|
38
|
-
/**
|
|
39
|
-
* Create File
|
|
40
|
-
* @param requestBody
|
|
41
|
-
* @returns PubFileDto Created
|
|
30
|
+
* @returns ListMemoriesResponse OK
|
|
42
31
|
* @throws ApiError
|
|
43
32
|
*/
|
|
44
|
-
static
|
|
33
|
+
static listMemories(nextPageToken?: string, previousPageToken?: string, limit?: number): CancelablePromise<ListMemoriesResponse>;
|
|
45
34
|
/**
|
|
46
|
-
*
|
|
47
|
-
* @param
|
|
48
|
-
* @
|
|
35
|
+
* List Memory Types
|
|
36
|
+
* @param nextPageToken
|
|
37
|
+
* @param previousPageToken
|
|
38
|
+
* @param limit
|
|
39
|
+
* @returns ListMemoryTypesResponse OK
|
|
49
40
|
* @throws ApiError
|
|
50
41
|
*/
|
|
51
|
-
static
|
|
42
|
+
static listMemoryTypes(nextPageToken?: string, previousPageToken?: string, limit?: number): CancelablePromise<ListMemoryTypesResponse>;
|
|
52
43
|
/**
|
|
53
44
|
* Create Chat Completion Stream
|
|
54
45
|
* @param requestBody
|
|
@@ -62,11 +53,4 @@ export declare class PubService {
|
|
|
62
53
|
* @throws ApiError
|
|
63
54
|
*/
|
|
64
55
|
static getPubTypes(): CancelablePromise<(StreamTimeoutEventDto | StreamNotFoundEventDto | NewChatCompletionStreamChunkEventDto | ChatCompletionStreamCompletedEventDto | FileUploadCompletedEventDto | FileTextContentReadyEventDto | WebsiteHtmlContentReadyEventDto | WebsiteTextContentReadyEventDto | FileSearchIndexReadyEventDto)>;
|
|
65
|
-
/**
|
|
66
|
-
* Create Website
|
|
67
|
-
* @param requestBody
|
|
68
|
-
* @returns PubWebsiteDto Created
|
|
69
|
-
* @throws ApiError
|
|
70
|
-
*/
|
|
71
|
-
static createWebsite(requestBody: CreateWebsiteRequest): CancelablePromise<PubWebsiteDto>;
|
|
72
56
|
}
|
|
@@ -2,9 +2,9 @@ import { OpenAPI } from '../core/OpenAPI';
|
|
|
2
2
|
import { request as __request } from '../core/request';
|
|
3
3
|
export class PubService {
|
|
4
4
|
/**
|
|
5
|
-
* Create
|
|
5
|
+
* Create ChatCompletion
|
|
6
6
|
* @param requestBody
|
|
7
|
-
* @returns
|
|
7
|
+
* @returns PubChatCompletionDto OK
|
|
8
8
|
* @throws ApiError
|
|
9
9
|
*/
|
|
10
10
|
static createChatCompletion(requestBody) {
|
|
@@ -16,17 +16,17 @@ export class PubService {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* List
|
|
19
|
+
* List Memories
|
|
20
20
|
* @param nextPageToken
|
|
21
21
|
* @param previousPageToken
|
|
22
22
|
* @param limit
|
|
23
|
-
* @returns
|
|
23
|
+
* @returns ListMemoriesResponse OK
|
|
24
24
|
* @throws ApiError
|
|
25
25
|
*/
|
|
26
|
-
static
|
|
26
|
+
static listMemories(nextPageToken, previousPageToken, limit) {
|
|
27
27
|
return __request(OpenAPI, {
|
|
28
28
|
method: 'GET',
|
|
29
|
-
url: '/v1/pub/
|
|
29
|
+
url: '/v1/pub/memories',
|
|
30
30
|
query: {
|
|
31
31
|
'nextPageToken': nextPageToken,
|
|
32
32
|
'previousPageToken': previousPageToken,
|
|
@@ -35,31 +35,21 @@ export class PubService {
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
39
|
-
* @param
|
|
40
|
-
* @
|
|
41
|
-
* @
|
|
42
|
-
|
|
43
|
-
static createFile(requestBody) {
|
|
44
|
-
return __request(OpenAPI, {
|
|
45
|
-
method: 'POST',
|
|
46
|
-
url: '/v1/pub/files',
|
|
47
|
-
body: requestBody,
|
|
48
|
-
mediaType: 'application/json',
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Search files
|
|
53
|
-
* @param text
|
|
54
|
-
* @returns FileSearchResponse OK
|
|
38
|
+
* List Memory Types
|
|
39
|
+
* @param nextPageToken
|
|
40
|
+
* @param previousPageToken
|
|
41
|
+
* @param limit
|
|
42
|
+
* @returns ListMemoryTypesResponse OK
|
|
55
43
|
* @throws ApiError
|
|
56
44
|
*/
|
|
57
|
-
static
|
|
45
|
+
static listMemoryTypes(nextPageToken, previousPageToken, limit) {
|
|
58
46
|
return __request(OpenAPI, {
|
|
59
47
|
method: 'GET',
|
|
60
|
-
url: '/v1/pub/
|
|
48
|
+
url: '/v1/pub/memory-types',
|
|
61
49
|
query: {
|
|
62
|
-
'
|
|
50
|
+
'nextPageToken': nextPageToken,
|
|
51
|
+
'previousPageToken': previousPageToken,
|
|
52
|
+
'limit': limit,
|
|
63
53
|
},
|
|
64
54
|
});
|
|
65
55
|
}
|
|
@@ -88,18 +78,4 @@ export class PubService {
|
|
|
88
78
|
url: '/v1/pub/types',
|
|
89
79
|
});
|
|
90
80
|
}
|
|
91
|
-
/**
|
|
92
|
-
* Create Website
|
|
93
|
-
* @param requestBody
|
|
94
|
-
* @returns PubWebsiteDto Created
|
|
95
|
-
* @throws ApiError
|
|
96
|
-
*/
|
|
97
|
-
static createWebsite(requestBody) {
|
|
98
|
-
return __request(OpenAPI, {
|
|
99
|
-
method: 'POST',
|
|
100
|
-
url: '/v1/pub/websites',
|
|
101
|
-
body: requestBody,
|
|
102
|
-
mediaType: 'application/json',
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
81
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PaginationDto, PubMemoryTypeDto } from '../openapi';
|
|
2
|
+
import { ApiError } from './ApiError';
|
|
3
|
+
export type ListMemoryTypesResponse = {
|
|
4
|
+
type: 'success';
|
|
5
|
+
items: PubMemoryTypeDto[];
|
|
6
|
+
pagination: PaginationDto;
|
|
7
|
+
} | {
|
|
8
|
+
type: 'error';
|
|
9
|
+
error: ApiError;
|
|
10
|
+
};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,29 +1,23 @@
|
|
|
1
1
|
export type { AnthropicModel } from './AnthropicModel';
|
|
2
2
|
export type { ApiError } from './ApiError';
|
|
3
|
-
export type { ChatCompletion } from './ChatCompletion';
|
|
4
3
|
export { isChatCompletion } from './ChatCompletion';
|
|
4
|
+
export type { ChatCompletion } from './ChatCompletion';
|
|
5
5
|
export type { ChatCompletionMessage } from './ChatCompletionMessage';
|
|
6
6
|
export type { ClaudeChatCompletionMessage } from './ClaudeChatCompletionMessage';
|
|
7
7
|
export type { CreateChatCompletionRequest } from './CreateChatCompletionRequest';
|
|
8
8
|
export type { CreateClaudeChatCompletionRequestParams } from './CreateClaudeChatCompletionRequestParams';
|
|
9
|
-
export type { CreateFileRequest } from './CreateFileRequest';
|
|
10
|
-
export type { CreateFileResponse } from './CreateFileResponse';
|
|
11
9
|
export type { CreateGeminiChatCompletionRequestParams } from './CreateGeminiChatCompletionRequestParams';
|
|
12
10
|
export type { CreateOpenAiChatCompletionRequestParams } from './CreateOpenAiChatCompletionRequestParams';
|
|
13
11
|
export type { CreateStreamRequest } from './CreateStreamRequest';
|
|
14
12
|
export type { CreateStreamResponse } from './CreateStreamResponse';
|
|
15
|
-
export type { CreateWebsiteRequest } from './CreateWebsiteRequest';
|
|
16
|
-
export type { CreateWebsiteResponse } from './CreateWebsiteResponse';
|
|
17
|
-
export type { FencyFile } from './FencyFile';
|
|
18
|
-
export type { FencyListFileItem } from './FencyListFileItem';
|
|
19
|
-
export type { FileSearchItem } from './FileSearchItem';
|
|
20
13
|
export type { GeminiChatCompletionMessage } from './GeminiChatCompletionMessage';
|
|
21
14
|
export type { GeminiModel } from './GeminiModel';
|
|
22
|
-
export type { ListFilesRequest } from './ListFilesRequest';
|
|
23
|
-
export type { ListFilesResponse } from './ListFilesResponse';
|
|
24
15
|
export type { OpenAiModel } from './OpenAiModel';
|
|
25
16
|
export type { S3PostRequest } from './S3PostRequest';
|
|
26
|
-
export type { SearchFilesRequest } from './SearchFilesRequest';
|
|
27
|
-
export type { SearchFilesResponse } from './SearchFilesResponse';
|
|
28
17
|
export type { Stream } from './Stream';
|
|
29
|
-
export type {
|
|
18
|
+
export type { ListMemoryTypesResponse } from './ListMemoryTypesResponse';
|
|
19
|
+
export type { CreateChatCompletionResponse } from './CreateChatCompletionResponse';
|
|
20
|
+
export type { FencyInstance } from './FencyInstance';
|
|
21
|
+
export type { FencyOptions } from './FencyOptions';
|
|
22
|
+
export type { ListMemoriesResponse } from './ListMemoriesResponse';
|
|
23
|
+
export type { ListMemoriesRequest } from './ListMemoriesRequest';
|
package/lib/utils/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Browser-compatible version utility
|
|
2
2
|
// The version is set at build time and can be overridden if needed
|
|
3
3
|
// Build-time version constant - this should be updated during the build process
|
|
4
|
-
const SDK_VERSION = '0.1.
|
|
4
|
+
const SDK_VERSION = '0.1.83';
|
|
5
5
|
// Allow runtime override if needed
|
|
6
6
|
let versionOverride = null;
|
|
7
7
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fencyai/js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.85",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "staklau <steinaageklaussen@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"ts-jest": "^29.1.1",
|
|
43
43
|
"typescript": "^5.3.3"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "fc0cdc699f3b28db051eb93b868708763c7f7990"
|
|
46
46
|
}
|
package/lib/api/createFile.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { CreateFileRequest } from '../types/CreateFileRequest';
|
|
2
|
-
import { CreateFileResponse } from '../types/CreateFileResponse';
|
|
3
|
-
/**
|
|
4
|
-
* Creates a website by making a POST request to the Fency API.
|
|
5
|
-
*
|
|
6
|
-
* @param pk - The publishable key (used as Bearer token)
|
|
7
|
-
* @param request - The request body
|
|
8
|
-
* @param options - Optional configuration (apiUrl, request overrides)
|
|
9
|
-
* @returns A promise that resolves to a CreateWebsiteResponse
|
|
10
|
-
* @throws Error if the request fails or the response is invalid
|
|
11
|
-
*/
|
|
12
|
-
export declare function createFile(params: {
|
|
13
|
-
pk: string;
|
|
14
|
-
request: CreateFileRequest;
|
|
15
|
-
baseUrl: string;
|
|
16
|
-
}): Promise<CreateFileResponse>;
|