@promptbook/ollama 0.114.0-2 → 0.114.0-3
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 +35 -2
- package/esm/index.es.js.map +1 -1
- package/esm/src/book-components/Chat/utils/$provideServerDomWindow.d.ts +11 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/ping.d.ts +2 -5
- package/esm/src/cli/cli-commands/coder.d.ts +1 -1
- package/esm/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +34 -0
- package/esm/src/cli/cli-commands/common/coderGitSyncCliOptions.test.d.ts +1 -0
- package/esm/src/cli/common/loadPromptsModule.d.ts +16 -0
- package/esm/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
- package/esm/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiCompatibleRequestManager.d.ts +1 -1
- package/esm/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +1 -1
- package/esm/src/llm-providers/openai/utils/loadOpenAiAgentsModule.d.ts +203 -0
- package/esm/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +1 -1
- package/esm/src/utils/misc/createLazyModuleLoader.d.ts +14 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +6 -2
- package/umd/index.umd.js +40 -7
- package/umd/index.umd.js.map +1 -1
- package/umd/src/book-components/Chat/utils/$provideServerDomWindow.d.ts +11 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/ping.d.ts +2 -5
- package/umd/src/cli/cli-commands/coder.d.ts +1 -1
- package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +34 -0
- package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.test.d.ts +1 -0
- package/umd/src/cli/common/loadPromptsModule.d.ts +16 -0
- package/umd/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
- package/umd/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiCompatibleRequestManager.d.ts +1 -1
- package/umd/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +1 -1
- package/umd/src/llm-providers/openai/utils/loadOpenAiAgentsModule.d.ts +203 -0
- package/umd/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +1 -1
- package/umd/src/utils/misc/createLazyModuleLoader.d.ts +14 -0
- package/umd/src/version.d.ts +1 -1
package/esm/index.es.js
CHANGED
|
@@ -2,7 +2,6 @@ import { spaceTrim as spaceTrim$1 } from 'spacetrim';
|
|
|
2
2
|
import CryptoJS from 'crypto-js';
|
|
3
3
|
import colors from 'colors';
|
|
4
4
|
import Bottleneck from 'bottleneck';
|
|
5
|
-
import OpenAI from 'openai';
|
|
6
5
|
|
|
7
6
|
// ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
|
|
8
7
|
/**
|
|
@@ -18,7 +17,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
18
17
|
* @generated
|
|
19
18
|
* @see https://github.com/webgptorg/promptbook
|
|
20
19
|
*/
|
|
21
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-
|
|
20
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-3';
|
|
22
21
|
/**
|
|
23
22
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
24
23
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -3580,6 +3579,39 @@ class OpenAiCompatibleNonChatPromptCaller {
|
|
|
3580
3579
|
}
|
|
3581
3580
|
}
|
|
3582
3581
|
|
|
3582
|
+
/**
|
|
3583
|
+
* Creates a loader which imports one module on the first call and reuses the very same module afterwards
|
|
3584
|
+
*
|
|
3585
|
+
* Note: [🐌] Heavy third-party dependencies are imported lazily to keep the startup of the Promptbook CLI fast.
|
|
3586
|
+
* A statically imported dependency is loaded every single time the bundle is loaded, even when the running
|
|
3587
|
+
* command never touches it. A lazily imported dependency is loaded only when the feature is really used.
|
|
3588
|
+
*
|
|
3589
|
+
* @example
|
|
3590
|
+
* const loadJsdomModule = createLazyModuleLoader(() => import('jsdom'));
|
|
3591
|
+
* const { JSDOM } = await loadJsdomModule();
|
|
3592
|
+
*
|
|
3593
|
+
* @private internal utility of Promptbook
|
|
3594
|
+
*/
|
|
3595
|
+
function createLazyModuleLoader(importModule) {
|
|
3596
|
+
let importedModulePromise = null;
|
|
3597
|
+
return function loadModule() {
|
|
3598
|
+
if (importedModulePromise === null) {
|
|
3599
|
+
importedModulePromise = importModule();
|
|
3600
|
+
}
|
|
3601
|
+
return importedModulePromise;
|
|
3602
|
+
};
|
|
3603
|
+
}
|
|
3604
|
+
// Note: [🐌] Do not convert the lazy `import(...)` calls back to static `import` statements, it would bring back the
|
|
3605
|
+
// slow startup of the `ptbk` CLI utility
|
|
3606
|
+
|
|
3607
|
+
/**
|
|
3608
|
+
* Loads the OpenAI SDK (`openai`) on demand
|
|
3609
|
+
*
|
|
3610
|
+
* Note: [🐌] Loaded lazily to keep the startup of the `ptbk` CLI utility fast
|
|
3611
|
+
*
|
|
3612
|
+
* @private internal utility of `OpenAiCompatibleRequestManager`
|
|
3613
|
+
*/
|
|
3614
|
+
const loadOpenAiModule = createLazyModuleLoader(() => import('openai'));
|
|
3583
3615
|
/**
|
|
3584
3616
|
* Manages OpenAI-compatible client creation plus shared retry and rate-limit behavior.
|
|
3585
3617
|
*
|
|
@@ -3606,6 +3638,7 @@ class OpenAiCompatibleRequestManager {
|
|
|
3606
3638
|
timeout: API_REQUEST_TIMEOUT,
|
|
3607
3639
|
maxRetries: CONNECTION_RETRIES_LIMIT,
|
|
3608
3640
|
};
|
|
3641
|
+
const { default: OpenAI } = await loadOpenAiModule();
|
|
3609
3642
|
this.client = new OpenAI(enhancedOptions);
|
|
3610
3643
|
}
|
|
3611
3644
|
return this.client;
|