@promptbook/openai 0.112.0-62 → 0.112.0-63
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 +20 -12
- package/esm/index.es.js.map +1 -1
- package/esm/src/_packages/components.index.d.ts +4 -0
- package/esm/src/_packages/core.index.d.ts +2 -0
- package/esm/src/_packages/types.index.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +0 -2
- package/esm/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.d.ts +7 -1
- package/esm/src/book-components/Chat/Chat/useChatInputAreaComposer.d.ts +1 -1
- package/esm/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +2 -2
- package/esm/src/book-components/Chat/hooks/useChatAutoScroll.d.ts +6 -3
- package/esm/src/book-components/Chat/types/ChatMessage.d.ts +34 -0
- package/esm/src/cli/cli-commands/agent/agentProjectPaths.d.ts +54 -0
- package/esm/src/cli/cli-commands/agent/agentRunCliOptions.d.ts +13 -0
- package/esm/src/cli/cli-commands/agent/init.d.ts +10 -0
- package/esm/src/cli/cli-commands/agent/initializeAgentProjectConfiguration.d.ts +21 -0
- package/esm/src/cli/cli-commands/agent/printAgentInitializationSummary.d.ts +7 -0
- package/esm/src/cli/cli-commands/agent/run.d.ts +10 -0
- package/esm/src/cli/cli-commands/agent/run.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/agent/tick.d.ts +10 -0
- package/esm/src/cli/cli-commands/agent.d.ts +15 -0
- package/esm/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +86 -0
- package/esm/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +11 -0
- package/esm/src/commitments/KNOWLEDGE/KNOWLEDGE.test.d.ts +1 -0
- package/esm/src/commitments/_common/toolRuntimeContext.d.ts +6 -0
- package/esm/src/commitments/index.d.ts +2 -1
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +4 -2
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsOptions.d.ts +9 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +20 -12
- package/umd/index.umd.js.map +1 -1
- package/umd/src/_packages/components.index.d.ts +4 -0
- package/umd/src/_packages/core.index.d.ts +2 -0
- package/umd/src/_packages/types.index.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +0 -2
- package/umd/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.d.ts +7 -1
- package/umd/src/book-components/Chat/Chat/useChatInputAreaComposer.d.ts +1 -1
- package/umd/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +2 -2
- package/umd/src/book-components/Chat/hooks/useChatAutoScroll.d.ts +6 -3
- package/umd/src/book-components/Chat/types/ChatMessage.d.ts +34 -0
- package/umd/src/cli/cli-commands/agent/agentProjectPaths.d.ts +54 -0
- package/umd/src/cli/cli-commands/agent/agentRunCliOptions.d.ts +13 -0
- package/umd/src/cli/cli-commands/agent/init.d.ts +10 -0
- package/umd/src/cli/cli-commands/agent/initializeAgentProjectConfiguration.d.ts +21 -0
- package/umd/src/cli/cli-commands/agent/printAgentInitializationSummary.d.ts +7 -0
- package/umd/src/cli/cli-commands/agent/run.d.ts +10 -0
- package/umd/src/cli/cli-commands/agent/run.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/agent/tick.d.ts +10 -0
- package/umd/src/cli/cli-commands/agent.d.ts +15 -0
- package/umd/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +86 -0
- package/umd/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +11 -0
- package/umd/src/commitments/KNOWLEDGE/KNOWLEDGE.test.d.ts +1 -0
- package/umd/src/commitments/_common/toolRuntimeContext.d.ts +6 -0
- package/umd/src/commitments/index.d.ts +2 -1
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +4 -2
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsOptions.d.ts +9 -0
- package/umd/src/version.d.ts +1 -1
package/esm/index.es.js
CHANGED
|
@@ -23,7 +23,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
23
23
|
* @generated
|
|
24
24
|
* @see https://github.com/webgptorg/promptbook
|
|
25
25
|
*/
|
|
26
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
26
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-63';
|
|
27
27
|
/**
|
|
28
28
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
29
29
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -7891,8 +7891,8 @@ class OpenAiAgentKitExecutionTools extends OpenAiVectorStoreHandler {
|
|
|
7891
7891
|
* Prepares an AgentKit agent with optional knowledge sources and tool definitions.
|
|
7892
7892
|
*/
|
|
7893
7893
|
async prepareAgentKitAgent(options) {
|
|
7894
|
-
var _a, _b
|
|
7895
|
-
const { name, instructions, knowledgeSources, tools,
|
|
7894
|
+
var _a, _b;
|
|
7895
|
+
const { name, instructions, knowledgeSources, tools, vectorStoreId: cachedVectorStoreId, storeAsPrepared, } = options;
|
|
7896
7896
|
await this.ensureAgentKitDefaults();
|
|
7897
7897
|
if (this.options.isVerbose) {
|
|
7898
7898
|
console.info('[🤰]', 'Preparing OpenAI AgentKit agent', {
|
|
@@ -7900,11 +7900,10 @@ class OpenAiAgentKitExecutionTools extends OpenAiVectorStoreHandler {
|
|
|
7900
7900
|
instructionsLength: instructions.length,
|
|
7901
7901
|
knowledgeSourcesCount: (_a = knowledgeSources === null || knowledgeSources === void 0 ? void 0 : knowledgeSources.length) !== null && _a !== void 0 ? _a : 0,
|
|
7902
7902
|
toolsCount: (_b = tools === null || tools === void 0 ? void 0 : tools.length) !== null && _b !== void 0 ? _b : 0,
|
|
7903
|
-
nativeAgentKitToolsCount: (_c = nativeAgentKitTools === null || nativeAgentKitTools === void 0 ? void 0 : nativeAgentKitTools.length) !== null && _c !== void 0 ? _c : 0,
|
|
7904
7903
|
});
|
|
7905
7904
|
}
|
|
7906
7905
|
let vectorStoreId = cachedVectorStoreId;
|
|
7907
|
-
if (!vectorStoreId && knowledgeSources && knowledgeSources.length > 0) {
|
|
7906
|
+
if (this.isNativeKnowledgeSearchEnabled && !vectorStoreId && knowledgeSources && knowledgeSources.length > 0) {
|
|
7908
7907
|
const vectorStoreResult = await this.createVectorStoreWithKnowledgeSources({
|
|
7909
7908
|
client: await this.getClient(),
|
|
7910
7909
|
name,
|
|
@@ -7913,13 +7912,19 @@ class OpenAiAgentKitExecutionTools extends OpenAiVectorStoreHandler {
|
|
|
7913
7912
|
});
|
|
7914
7913
|
vectorStoreId = vectorStoreResult.vectorStoreId;
|
|
7915
7914
|
}
|
|
7916
|
-
else if (vectorStoreId && this.options.isVerbose) {
|
|
7915
|
+
else if (this.isNativeKnowledgeSearchEnabled && vectorStoreId && this.options.isVerbose) {
|
|
7917
7916
|
console.info('[🤰]', 'Using cached vector store for AgentKit agent', {
|
|
7918
7917
|
name,
|
|
7919
7918
|
vectorStoreId,
|
|
7920
7919
|
});
|
|
7921
7920
|
}
|
|
7922
|
-
|
|
7921
|
+
if (!this.isNativeKnowledgeSearchEnabled) {
|
|
7922
|
+
vectorStoreId = undefined;
|
|
7923
|
+
}
|
|
7924
|
+
const agentKitTools = this.buildAgentKitTools({
|
|
7925
|
+
tools,
|
|
7926
|
+
vectorStoreId,
|
|
7927
|
+
});
|
|
7923
7928
|
const openAiAgentKitAgent = new Agent({
|
|
7924
7929
|
name,
|
|
7925
7930
|
model: this.agentKitModelName,
|
|
@@ -7938,7 +7943,7 @@ class OpenAiAgentKitExecutionTools extends OpenAiVectorStoreHandler {
|
|
|
7938
7943
|
name,
|
|
7939
7944
|
model: this.agentKitModelName,
|
|
7940
7945
|
toolCount: agentKitTools.length,
|
|
7941
|
-
hasVectorStore: Boolean(vectorStoreId),
|
|
7946
|
+
hasVectorStore: this.isNativeKnowledgeSearchEnabled && Boolean(vectorStoreId),
|
|
7942
7947
|
});
|
|
7943
7948
|
}
|
|
7944
7949
|
return preparedAgent;
|
|
@@ -7958,14 +7963,11 @@ class OpenAiAgentKitExecutionTools extends OpenAiVectorStoreHandler {
|
|
|
7958
7963
|
* Builds the tool list for AgentKit, including hosted file search when applicable.
|
|
7959
7964
|
*/
|
|
7960
7965
|
buildAgentKitTools(options) {
|
|
7961
|
-
const { tools,
|
|
7966
|
+
const { tools, vectorStoreId } = options;
|
|
7962
7967
|
const agentKitTools = [];
|
|
7963
7968
|
if (vectorStoreId) {
|
|
7964
7969
|
agentKitTools.push(fileSearchTool(vectorStoreId));
|
|
7965
7970
|
}
|
|
7966
|
-
if (nativeAgentKitTools && nativeAgentKitTools.length > 0) {
|
|
7967
|
-
agentKitTools.push(...nativeAgentKitTools);
|
|
7968
|
-
}
|
|
7969
7971
|
if (tools && tools.length > 0) {
|
|
7970
7972
|
let scriptTools = null;
|
|
7971
7973
|
for (const toolDefinition of tools) {
|
|
@@ -8440,6 +8442,12 @@ class OpenAiAgentKitExecutionTools extends OpenAiVectorStoreHandler {
|
|
|
8440
8442
|
get agentKitOptions() {
|
|
8441
8443
|
return this.options;
|
|
8442
8444
|
}
|
|
8445
|
+
/**
|
|
8446
|
+
* Returns true when hosted OpenAI vector-store search should back `knowledgeSources`.
|
|
8447
|
+
*/
|
|
8448
|
+
get isNativeKnowledgeSearchEnabled() {
|
|
8449
|
+
return this.agentKitOptions.isNativeKnowledgeSearchEnabled !== false;
|
|
8450
|
+
}
|
|
8443
8451
|
/**
|
|
8444
8452
|
* Discriminant for type guards.
|
|
8445
8453
|
*/
|