@promptbook/javascript 0.110.0-4 → 0.110.0-5
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/esm/index.es.js +1 -1
- package/esm/typings/src/_packages/openai.index.d.ts +0 -4
- package/esm/typings/src/_packages/types.index.d.ts +0 -2
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +0 -1
- package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +0 -1
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +40 -1
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionToolsOptions.d.ts +30 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +1 -1
- package/esm/typings/src/llm-providers/openai/OpenAiAgentExecutionTools.d.ts +0 -43
- package/esm/typings/src/llm-providers/openai/createOpenAiAgentExecutionTools.d.ts +0 -11
package/esm/index.es.js
CHANGED
|
@@ -18,7 +18,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
18
18
|
* @generated
|
|
19
19
|
* @see https://github.com/webgptorg/promptbook
|
|
20
20
|
*/
|
|
21
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.110.0-
|
|
21
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.110.0-5';
|
|
22
22
|
/**
|
|
23
23
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
24
24
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
|
-
import { createOpenAiAgentExecutionTools } from '../llm-providers/openai/createOpenAiAgentExecutionTools';
|
|
3
2
|
import { createOpenAiAssistantExecutionTools } from '../llm-providers/openai/createOpenAiAssistantExecutionTools';
|
|
4
3
|
import { createOpenAiCompatibleExecutionTools } from '../llm-providers/openai/createOpenAiCompatibleExecutionTools';
|
|
5
4
|
import { createOpenAiExecutionTools } from '../llm-providers/openai/createOpenAiExecutionTools';
|
|
6
5
|
import { OPENAI_MODELS } from '../llm-providers/openai/openai-models';
|
|
7
|
-
import { OpenAiAgentExecutionTools } from '../llm-providers/openai/OpenAiAgentExecutionTools';
|
|
8
6
|
import { OpenAiAssistantExecutionTools } from '../llm-providers/openai/OpenAiAssistantExecutionTools';
|
|
9
7
|
import type { OpenAiAssistantExecutionToolsOptions } from '../llm-providers/openai/OpenAiAssistantExecutionToolsOptions';
|
|
10
8
|
import { OpenAiCompatibleExecutionTools } from '../llm-providers/openai/OpenAiCompatibleExecutionTools';
|
|
@@ -17,12 +15,10 @@ import { _OpenAiRegistration } from '../llm-providers/openai/register-constructo
|
|
|
17
15
|
import { _OpenAiAssistantRegistration } from '../llm-providers/openai/register-constructor';
|
|
18
16
|
import { _OpenAiCompatibleRegistration } from '../llm-providers/openai/register-constructor';
|
|
19
17
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
20
|
-
export { createOpenAiAgentExecutionTools };
|
|
21
18
|
export { createOpenAiAssistantExecutionTools };
|
|
22
19
|
export { createOpenAiCompatibleExecutionTools };
|
|
23
20
|
export { createOpenAiExecutionTools };
|
|
24
21
|
export { OPENAI_MODELS };
|
|
25
|
-
export { OpenAiAgentExecutionTools };
|
|
26
22
|
export { OpenAiAssistantExecutionTools };
|
|
27
23
|
export type { OpenAiAssistantExecutionToolsOptions };
|
|
28
24
|
export { OpenAiCompatibleExecutionTools };
|
|
@@ -138,7 +138,6 @@ import type { AzureOpenAiExecutionToolsOptions } from '../llm-providers/azure-op
|
|
|
138
138
|
import type { DeepseekExecutionToolsOptions } from '../llm-providers/deepseek/DeepseekExecutionToolsOptions';
|
|
139
139
|
import type { GoogleExecutionToolsOptions } from '../llm-providers/google/GoogleExecutionToolsOptions';
|
|
140
140
|
import type { OllamaExecutionToolsOptions } from '../llm-providers/ollama/OllamaExecutionToolsOptions';
|
|
141
|
-
import type { OpenAiAgentExecutionToolsOptions } from '../llm-providers/openai/OpenAiAgentExecutionTools';
|
|
142
141
|
import type { OpenAiAssistantExecutionToolsOptions } from '../llm-providers/openai/OpenAiAssistantExecutionToolsOptions';
|
|
143
142
|
import type { OpenAiCompatibleExecutionToolsOptions } from '../llm-providers/openai/OpenAiCompatibleExecutionToolsOptions';
|
|
144
143
|
import type { OpenAiCompatibleExecutionToolsNonProxiedOptions } from '../llm-providers/openai/OpenAiCompatibleExecutionToolsOptions';
|
|
@@ -540,7 +539,6 @@ export type { AzureOpenAiExecutionToolsOptions };
|
|
|
540
539
|
export type { DeepseekExecutionToolsOptions };
|
|
541
540
|
export type { GoogleExecutionToolsOptions };
|
|
542
541
|
export type { OllamaExecutionToolsOptions };
|
|
543
|
-
export type { OpenAiAgentExecutionToolsOptions };
|
|
544
542
|
export type { OpenAiAssistantExecutionToolsOptions };
|
|
545
543
|
export type { OpenAiCompatibleExecutionToolsOptions };
|
|
546
544
|
export type { OpenAiCompatibleExecutionToolsNonProxiedOptions };
|
|
@@ -14,7 +14,6 @@ import type { AgentOptions } from './AgentOptions';
|
|
|
14
14
|
* - `Agent` - which represents an AI Agent with its source, memories, actions, etc. Agent is a higher-level abstraction which is internally using:
|
|
15
15
|
* - `LlmExecutionTools` - which wraps one or more LLM models and provides an interface to execute them
|
|
16
16
|
* - `AgentLlmExecutionTools` - which is a specific implementation of `LlmExecutionTools` that wraps another LlmExecutionTools and applies agent-specific system prompts and requirements
|
|
17
|
-
* - `OpenAiAgentExecutionTools` - which is a specific implementation of `LlmExecutionTools` for OpenAI models with agent capabilities (using Responses API), recommended for usage in `Agent` or `AgentLlmExecutionTools`
|
|
18
17
|
* - `OpenAiAssistantExecutionTools` - (Deprecated) which is a specific implementation of `LlmExecutionTools` for OpenAI models with assistant capabilities
|
|
19
18
|
* - `RemoteAgent` - which is an `Agent` that connects to a Promptbook Agents Server
|
|
20
19
|
*
|
|
@@ -16,7 +16,6 @@ import type { CreateAgentLlmExecutionToolsOptions } from './CreateAgentLlmExecut
|
|
|
16
16
|
* - `Agent` - which represents an AI Agent with its source, memories, actions, etc. Agent is a higher-level abstraction which is internally using:
|
|
17
17
|
* - `LlmExecutionTools` - which wraps one or more LLM models and provides an interface to execute them
|
|
18
18
|
* - `AgentLlmExecutionTools` - which is a specific implementation of `LlmExecutionTools` that wraps another LlmExecutionTools and applies agent-specific system prompts and requirements
|
|
19
|
-
* - `OpenAiAgentExecutionTools` - which is a specific implementation of `LlmExecutionTools` for OpenAI models with agent capabilities (using Responses API), recommended for usage in `Agent` or `AgentLlmExecutionTools`
|
|
20
19
|
* - `OpenAiAssistantExecutionTools` - (Deprecated) which is a specific implementation of `LlmExecutionTools` for OpenAI models with assistant capabilities
|
|
21
20
|
* - `RemoteAgent` - which is an `Agent` that connects to a Promptbook Agents Server
|
|
22
21
|
*
|
|
@@ -18,7 +18,6 @@ import { OpenAiExecutionTools } from './OpenAiExecutionTools';
|
|
|
18
18
|
* - `RemoteAgent` - which is an `Agent` that connects to a Promptbook Agents Server
|
|
19
19
|
*
|
|
20
20
|
* @public exported from `@promptbook/openai`
|
|
21
|
-
* @deprecated Use `OpenAiAgentExecutionTools` instead which uses the new OpenAI Responses API
|
|
22
21
|
*/
|
|
23
22
|
export declare class OpenAiAssistantExecutionTools extends OpenAiExecutionTools implements LlmExecutionTools {
|
|
24
23
|
readonly assistantId: string_token;
|
|
@@ -43,6 +42,46 @@ export declare class OpenAiAssistantExecutionTools extends OpenAiExecutionTools
|
|
|
43
42
|
* Get an existing assistant tool wrapper
|
|
44
43
|
*/
|
|
45
44
|
getAssistant(assistantId: string_token): OpenAiAssistantExecutionTools;
|
|
45
|
+
/**
|
|
46
|
+
* Returns the per-knowledge-source download timeout in milliseconds.
|
|
47
|
+
*/
|
|
48
|
+
private getKnowledgeSourceDownloadTimeoutMs;
|
|
49
|
+
/**
|
|
50
|
+
* Returns the max concurrency for knowledge source uploads.
|
|
51
|
+
*/
|
|
52
|
+
private getKnowledgeSourceUploadMaxConcurrency;
|
|
53
|
+
/**
|
|
54
|
+
* Returns the polling interval in milliseconds for vector store uploads.
|
|
55
|
+
*/
|
|
56
|
+
private getKnowledgeSourceUploadPollIntervalMs;
|
|
57
|
+
/**
|
|
58
|
+
* Returns the overall upload timeout in milliseconds for vector store uploads.
|
|
59
|
+
*/
|
|
60
|
+
private getKnowledgeSourceUploadTimeoutMs;
|
|
61
|
+
/**
|
|
62
|
+
* Returns true if we should continue even if vector store ingestion stalls.
|
|
63
|
+
*/
|
|
64
|
+
private shouldContinueOnVectorStoreStall;
|
|
65
|
+
/**
|
|
66
|
+
* Returns assistant-specific options with extended settings.
|
|
67
|
+
*/
|
|
68
|
+
private get assistantOptions();
|
|
69
|
+
/**
|
|
70
|
+
* Downloads a knowledge source URL into a File for vector store upload.
|
|
71
|
+
*/
|
|
72
|
+
private downloadKnowledgeSourceFile;
|
|
73
|
+
/**
|
|
74
|
+
* Logs vector store file batch diagnostics to help trace ingestion stalls or failures.
|
|
75
|
+
*/
|
|
76
|
+
private logVectorStoreFileBatchDiagnostics;
|
|
77
|
+
/**
|
|
78
|
+
* Uploads knowledge source files to the vector store and polls until processing completes.
|
|
79
|
+
*/
|
|
80
|
+
private uploadKnowledgeSourceFilesToVectorStore;
|
|
81
|
+
/**
|
|
82
|
+
* Creates a vector store and uploads knowledge sources, returning its ID.
|
|
83
|
+
*/
|
|
84
|
+
private createVectorStoreWithKnowledgeSources;
|
|
46
85
|
createNewAssistant(options: {
|
|
47
86
|
/**
|
|
48
87
|
* Name of the new assistant
|
|
@@ -17,4 +17,34 @@ export type OpenAiAssistantExecutionToolsOptions = OpenAiCompatibleExecutionTool
|
|
|
17
17
|
* Which assistant to use
|
|
18
18
|
*/
|
|
19
19
|
readonly assistantId: string_token;
|
|
20
|
+
/**
|
|
21
|
+
* Per-knowledge-source download timeout in milliseconds when preparing assistants.
|
|
22
|
+
*
|
|
23
|
+
* @default 30000
|
|
24
|
+
*/
|
|
25
|
+
readonly knowledgeSourceDownloadTimeoutMs?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Max concurrency for uploading knowledge source files to the vector store.
|
|
28
|
+
*
|
|
29
|
+
* @default 5
|
|
30
|
+
*/
|
|
31
|
+
readonly knowledgeSourceUploadMaxConcurrency?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Poll interval in milliseconds when waiting for vector store file batch processing.
|
|
34
|
+
*
|
|
35
|
+
* @default 5000
|
|
36
|
+
*/
|
|
37
|
+
readonly knowledgeSourceUploadPollIntervalMs?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Overall timeout in milliseconds for vector store file batch processing.
|
|
40
|
+
*
|
|
41
|
+
* @default 900000
|
|
42
|
+
*/
|
|
43
|
+
readonly knowledgeSourceUploadTimeoutMs?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Whether we should continue even if vector store ingestion stalls.
|
|
46
|
+
*
|
|
47
|
+
* @default true
|
|
48
|
+
*/
|
|
49
|
+
readonly shouldContinueOnVectorStoreStall?: boolean;
|
|
20
50
|
};
|
|
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
|
|
|
15
15
|
export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
|
|
16
16
|
/**
|
|
17
17
|
* Represents the version string of the Promptbook engine.
|
|
18
|
-
* It follows semantic versioning (e.g., `0.110.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.110.0-4`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/javascript",
|
|
3
|
-
"version": "0.110.0-
|
|
3
|
+
"version": "0.110.0-5",
|
|
4
4
|
"description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"module": "./esm/index.es.js",
|
|
95
95
|
"typings": "./esm/typings/src/_packages/javascript.index.d.ts",
|
|
96
96
|
"peerDependencies": {
|
|
97
|
-
"@promptbook/core": "0.110.0-
|
|
97
|
+
"@promptbook/core": "0.110.0-5"
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
100
|
"crypto": "1.0.1",
|
package/umd/index.umd.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @generated
|
|
23
23
|
* @see https://github.com/webgptorg/promptbook
|
|
24
24
|
*/
|
|
25
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.110.0-
|
|
25
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.110.0-5';
|
|
26
26
|
/**
|
|
27
27
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
28
28
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import OpenAI from 'openai';
|
|
2
|
-
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
3
|
-
import type { ChatPromptResult } from '../../execution/PromptResult';
|
|
4
|
-
import type { Prompt } from '../../types/Prompt';
|
|
5
|
-
import type { string_markdown, string_markdown_text, string_title } from '../../types/typeAliases';
|
|
6
|
-
import type { OpenAiCompatibleExecutionToolsNonProxiedOptions } from './OpenAiCompatibleExecutionToolsOptions';
|
|
7
|
-
import { OpenAiExecutionTools } from './OpenAiExecutionTools';
|
|
8
|
-
/**
|
|
9
|
-
* Options for OpenAiAgentExecutionTools
|
|
10
|
-
*/
|
|
11
|
-
export type OpenAiAgentExecutionToolsOptions = OpenAiCompatibleExecutionToolsNonProxiedOptions & {
|
|
12
|
-
/**
|
|
13
|
-
* ID of the vector store to use for file search
|
|
14
|
-
*/
|
|
15
|
-
readonly vectorStoreId?: string;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Execution Tools for calling OpenAI API using the Responses API (Agents)
|
|
19
|
-
*
|
|
20
|
-
* @public exported from `@promptbook/openai`
|
|
21
|
-
*/
|
|
22
|
-
export declare class OpenAiAgentExecutionTools extends OpenAiExecutionTools implements LlmExecutionTools {
|
|
23
|
-
readonly vectorStoreId?: string;
|
|
24
|
-
constructor(options: OpenAiAgentExecutionToolsOptions);
|
|
25
|
-
get title(): string_title & string_markdown_text;
|
|
26
|
-
get description(): string_markdown;
|
|
27
|
-
/**
|
|
28
|
-
* Calls OpenAI API to use a chat model with streaming.
|
|
29
|
-
*/
|
|
30
|
-
callChatModelStream(prompt: Prompt, onProgress: (chunk: ChatPromptResult) => void): Promise<ChatPromptResult>;
|
|
31
|
-
/**
|
|
32
|
-
* Creates a vector store from knowledge sources
|
|
33
|
-
*/
|
|
34
|
-
static createVectorStore(client: OpenAI, name: string, knowledgeSources: ReadonlyArray<string>): Promise<string>;
|
|
35
|
-
/**
|
|
36
|
-
* Discriminant for type guards
|
|
37
|
-
*/
|
|
38
|
-
protected get discriminant(): string;
|
|
39
|
-
/**
|
|
40
|
-
* Type guard to check if given `LlmExecutionTools` are instanceof `OpenAiAgentExecutionTools`
|
|
41
|
-
*/
|
|
42
|
-
static isOpenAiAgentExecutionTools(llmExecutionTools: LlmExecutionTools): llmExecutionTools is OpenAiAgentExecutionTools;
|
|
43
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { OpenAiAgentExecutionTools } from './OpenAiAgentExecutionTools';
|
|
2
|
-
import type { OpenAiAgentExecutionToolsOptions } from './OpenAiAgentExecutionTools';
|
|
3
|
-
/**
|
|
4
|
-
* Execution Tools for calling OpenAI API using Responses API
|
|
5
|
-
*
|
|
6
|
-
* @public exported from `@promptbook/openai`
|
|
7
|
-
*/
|
|
8
|
-
export declare const createOpenAiAgentExecutionTools: ((options: OpenAiAgentExecutionToolsOptions) => OpenAiAgentExecutionTools) & {
|
|
9
|
-
packageName: string;
|
|
10
|
-
className: string;
|
|
11
|
-
};
|