@promptbook/azure-openai 0.92.0-9 → 0.93.0
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/README.md +140 -88
- package/esm/index.es.js +47 -33
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/browser.index.d.ts +2 -0
- package/esm/typings/src/_packages/core.index.d.ts +26 -14
- package/esm/typings/src/_packages/types.index.d.ts +6 -2
- package/esm/typings/src/collection/PipelineCollection.d.ts +0 -2
- package/esm/typings/src/collection/SimplePipelineCollection.d.ts +1 -1
- package/esm/typings/src/commands/FOREACH/ForeachJson.d.ts +6 -6
- package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +0 -2
- package/esm/typings/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +36 -28
- package/esm/typings/src/config.d.ts +41 -11
- package/esm/typings/src/constants.d.ts +43 -2
- package/esm/typings/src/conversion/parsePipeline.d.ts +2 -2
- package/esm/typings/src/errors/0-BoilerplateError.d.ts +2 -2
- package/esm/typings/src/errors/CollectionError.d.ts +1 -1
- package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +1 -1
- package/esm/typings/src/executables/apps/locateLibreoffice.d.ts +2 -1
- package/esm/typings/src/executables/apps/locatePandoc.d.ts +2 -1
- package/esm/typings/src/executables/locateApp.d.ts +2 -2
- package/esm/typings/src/executables/platforms/locateAppOnLinux.d.ts +2 -1
- package/esm/typings/src/executables/platforms/locateAppOnMacOs.d.ts +2 -1
- package/esm/typings/src/executables/platforms/locateAppOnWindows.d.ts +2 -1
- package/esm/typings/src/execution/AbstractTaskResult.d.ts +1 -1
- package/esm/typings/src/execution/CommonToolsOptions.d.ts +3 -3
- package/esm/typings/src/execution/ExecutionTask.d.ts +19 -1
- package/esm/typings/src/execution/LlmExecutionToolsConstructor.d.ts +2 -1
- package/esm/typings/src/execution/PipelineExecutorResult.d.ts +4 -2
- package/esm/typings/src/execution/PromptbookFetch.d.ts +1 -1
- package/esm/typings/src/execution/ScriptExecutionTools.d.ts +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/$OngoingTaskResult.d.ts +12 -9
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +13 -10
- package/esm/typings/src/execution/createPipelineExecutor/20-executeTask.d.ts +12 -9
- package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +15 -3
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +21 -15
- package/esm/typings/src/execution/createPipelineExecutor/computeCosineSimilarity.d.ts +13 -0
- package/esm/typings/src/execution/createPipelineExecutor/filterJustOutputParameters.d.ts +7 -6
- package/esm/typings/src/execution/createPipelineExecutor/getContextForTask.d.ts +5 -1
- package/esm/typings/src/execution/createPipelineExecutor/getExamplesForTask.d.ts +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +12 -9
- package/esm/typings/src/execution/createPipelineExecutor/getReservedParametersForTask.d.ts +18 -5
- package/esm/typings/src/execution/createPipelineExecutor/knowledgePiecesToString.d.ts +9 -0
- package/esm/typings/src/execution/execution-report/ExecutionReportJson.d.ts +1 -1
- package/esm/typings/src/execution/execution-report/ExecutionReportString.d.ts +1 -1
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +4 -4
- package/esm/typings/src/execution/utils/checkExpectations.d.ts +3 -3
- package/esm/typings/src/execution/utils/uncertainNumber.d.ts +3 -2
- package/esm/typings/src/execution/utils/usageToWorktime.d.ts +1 -1
- package/esm/typings/src/formats/_common/{FormatDefinition.d.ts → FormatParser.d.ts} +8 -6
- package/esm/typings/src/formats/_common/FormatSubvalueParser.d.ts +66 -0
- package/esm/typings/src/formats/csv/CsvFormatParser.d.ts +17 -0
- package/esm/typings/src/formats/csv/CsvSettings.d.ts +2 -2
- package/esm/typings/src/formats/csv/utils/csvParse.d.ts +12 -0
- package/esm/typings/src/formats/csv/utils/isValidCsvString.d.ts +1 -1
- package/esm/typings/src/formats/index.d.ts +2 -2
- package/esm/typings/src/formats/json/JsonFormatParser.d.ts +19 -0
- package/esm/typings/src/formats/json/utils/isValidJsonString.d.ts +1 -1
- package/esm/typings/src/formats/json/utils/jsonParse.d.ts +0 -3
- package/esm/typings/src/formats/text/{TextFormatDefinition.d.ts → TextFormatParser.d.ts} +7 -7
- package/esm/typings/src/formats/xml/XmlFormatParser.d.ts +19 -0
- package/esm/typings/src/formats/xml/utils/isValidXmlString.d.ts +1 -1
- package/esm/typings/src/formfactors/_boilerplate/BoilerplateFormfactorDefinition.d.ts +3 -2
- package/esm/typings/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +16 -7
- package/esm/typings/src/formfactors/_common/FormfactorDefinition.d.ts +3 -1
- package/esm/typings/src/formfactors/_common/string_formfactor_name.d.ts +2 -1
- package/esm/typings/src/formfactors/chatbot/ChatbotFormfactorDefinition.d.ts +2 -2
- package/esm/typings/src/formfactors/completion/CompletionFormfactorDefinition.d.ts +29 -0
- package/esm/typings/src/formfactors/generator/GeneratorFormfactorDefinition.d.ts +2 -1
- package/esm/typings/src/formfactors/generic/GenericFormfactorDefinition.d.ts +2 -2
- package/esm/typings/src/formfactors/index.d.ts +33 -8
- package/esm/typings/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +4 -2
- package/esm/typings/src/formfactors/sheets/SheetsFormfactorDefinition.d.ts +3 -2
- package/esm/typings/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +3 -2
- package/esm/typings/src/high-level-abstractions/index.d.ts +2 -2
- package/esm/typings/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +3 -3
- package/esm/typings/src/llm-providers/_common/register/$llmToolsRegister.d.ts +3 -3
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +4 -4
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +4 -3
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +18 -5
- package/esm/typings/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +11 -4
- package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +21 -42
- package/esm/typings/src/llm-providers/_common/register/LlmToolsOptions.d.ts +9 -2
- package/esm/typings/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +13 -4
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +10 -5
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +11 -3
- package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +3 -3
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +5 -5
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +6 -0
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +4 -4
- package/esm/typings/src/llm-providers/deepseek/deepseek-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +2 -2
- package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +2 -2
- package/esm/typings/src/migrations/migratePipeline.d.ts +9 -0
- package/esm/typings/src/other/templates/getBookTemplates.d.ts +2 -2
- package/esm/typings/src/pipeline/PipelineInterface/PipelineInterface.d.ts +3 -3
- package/esm/typings/src/pipeline/PipelineInterface/constants.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineInterface/getPipelineInterface.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineInterface/isPipelineImplementingInterface.d.ts +5 -4
- package/esm/typings/src/pipeline/PipelineInterface/isPipelineInterfacesEqual.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineJson/CommonTaskJson.d.ts +10 -7
- package/esm/typings/src/pipeline/PipelineJson/ParameterJson.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +3 -2
- package/esm/typings/src/pipeline/PipelineString.d.ts +3 -1
- package/esm/typings/src/pipeline/book-notation.d.ts +2 -2
- package/esm/typings/src/postprocessing/utils/extractBlock.d.ts +1 -1
- package/esm/typings/src/postprocessing/utils/extractJsonBlock.d.ts +2 -2
- package/esm/typings/src/prepare/prepareTasks.d.ts +8 -5
- package/esm/typings/src/remote-server/openapi.d.ts +1 -1
- package/esm/typings/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Response.d.ts +1 -1
- package/esm/typings/src/remote-server/startRemoteServer.d.ts +1 -1
- package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +7 -6
- package/esm/typings/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +3 -3
- package/esm/typings/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +1 -1
- package/esm/typings/src/scrapers/_common/Converter.d.ts +3 -1
- package/esm/typings/src/scrapers/_common/Scraper.d.ts +4 -3
- package/esm/typings/src/scrapers/_common/ScraperIntermediateSource.d.ts +4 -2
- package/esm/typings/src/scrapers/_common/prepareKnowledgePieces.d.ts +2 -2
- package/esm/typings/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +2 -1
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +6 -3
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +3 -5
- package/esm/typings/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +3 -3
- package/esm/typings/src/scrapers/_common/register/$scrapersRegister.d.ts +3 -2
- package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +8 -5
- package/esm/typings/src/scrapers/_common/register/ScraperConstructor.d.ts +2 -1
- package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +6 -5
- package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +3 -1
- package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +2 -1
- package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +4 -1
- package/esm/typings/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +2 -1
- package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +3 -4
- package/esm/typings/src/scripting/javascript/JavascriptExecutionTools.d.ts +1 -1
- package/esm/typings/src/scripting/javascript/postprocessing-functions.d.ts +5 -1
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
- package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +1 -1
- package/esm/typings/src/storage/file-cache-storage/FileCacheStorage.d.ts +12 -5
- package/esm/typings/src/storage/file-cache-storage/FileCacheStorageOptions.d.ts +4 -2
- package/esm/typings/src/storage/file-cache-storage/utils/nameToSubfolderPath.d.ts +2 -1
- package/esm/typings/src/storage/local-storage/getIndexedDbStorage.d.ts +11 -0
- package/esm/typings/src/storage/local-storage/utils/IndexedDbStorageOptions.d.ts +14 -0
- package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.d.ts +8 -0
- package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +2 -1
- package/esm/typings/src/types/IntermediateFilesStrategy.d.ts +2 -1
- package/esm/typings/src/types/ModelRequirements.d.ts +2 -2
- package/esm/typings/src/types/ModelVariant.d.ts +5 -5
- package/esm/typings/src/types/typeAliases.d.ts +22 -19
- package/esm/typings/src/utils/$Register.d.ts +8 -7
- package/esm/typings/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +2 -2
- package/esm/typings/src/utils/editable/edit-pipeline-string/deflatePipeline.d.ts +4 -1
- package/esm/typings/src/utils/editable/utils/isFlatPipeline.d.ts +2 -1
- package/esm/typings/src/utils/editable/utils/stringifyPipelineJson.d.ts +1 -1
- package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -1
- package/esm/typings/src/utils/expectation-counters/index.d.ts +1 -1
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +2 -2
- package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -1
- package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +2 -2
- package/esm/typings/src/utils/normalization/nameToUriPart.d.ts +4 -4
- package/esm/typings/src/utils/normalization/nameToUriParts.d.ts +4 -4
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +3 -3
- package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +3 -3
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +4 -4
- package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +3 -3
- package/esm/typings/src/utils/normalization/removeDiacritics.d.ts +3 -3
- package/esm/typings/src/utils/normalization/searchKeywords.d.ts +4 -1
- package/esm/typings/src/utils/normalization/titleToName.d.ts +4 -4
- package/esm/typings/src/utils/organization/TODO_USE.d.ts +1 -1
- package/esm/typings/src/utils/organization/empty_object.d.ts +2 -2
- package/esm/typings/src/utils/organization/just.d.ts +1 -1
- package/esm/typings/src/utils/organization/just_empty_object.d.ts +4 -4
- package/esm/typings/src/utils/organization/keepUnused.d.ts +1 -1
- package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +7 -7
- package/esm/typings/src/utils/removeQuotes.d.ts +2 -2
- package/esm/typings/src/utils/serialization/clonePipeline.d.ts +4 -3
- package/esm/typings/src/utils/serialization/deepClone.d.ts +5 -1
- package/esm/typings/src/utils/trimCodeBlock.d.ts +1 -1
- package/esm/typings/src/utils/trimEndOfCodeBlock.d.ts +1 -1
- package/esm/typings/src/utils/unwrapResult.d.ts +2 -2
- package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +3 -3
- package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +5 -4
- package/esm/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +1 -1
- package/esm/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +1 -1
- package/esm/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +1 -1
- package/esm/typings/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +1 -1
- package/esm/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +1 -1
- package/esm/typings/src/utils/validators/url/isValidUrl.d.ts +1 -1
- package/esm/typings/src/version.d.ts +2 -1
- package/esm/typings/src/wizzard/wizzard.d.ts +1 -1
- package/package.json +15 -3
- package/umd/index.umd.js +47 -33
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +0 -31
- package/esm/typings/src/formats/csv/CsvFormatDefinition.d.ts +0 -17
- package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +0 -19
- package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +0 -19
- /package/esm/typings/src/llm-providers/{multiple → _multiple}/MultipleLlmExecutionTools.d.ts +0 -0
- /package/esm/typings/src/llm-providers/{multiple → _multiple}/joinLlmExecutionTools.d.ts +0 -0
- /package/esm/typings/src/llm-providers/{multiple → _multiple}/playground/playground.d.ts +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Removes quotes from a string
|
|
3
3
|
*
|
|
4
|
-
* Tip: This is very
|
|
4
|
+
* Tip: This is very useful for post-processing of the result of the LLM model
|
|
5
5
|
* Note: This function removes only the same quotes from the beginning and the end of the string
|
|
6
|
-
* Note: There are two
|
|
6
|
+
* Note: There are two similar functions:
|
|
7
7
|
* - `removeQuotes` which removes only bounding quotes
|
|
8
8
|
* - `unwrapResult` which removes whole introduce sentence
|
|
9
9
|
*
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Creates a deep clone of a PipelineJson object, copying all properties explicitly.
|
|
4
4
|
*
|
|
5
|
-
* Note: It is
|
|
5
|
+
* Note: It is useful for ensuring that modifications to the returned pipeline do not affect the original.
|
|
6
6
|
*
|
|
7
|
-
* @param pipeline
|
|
7
|
+
* @param pipeline The pipeline to clone.
|
|
8
|
+
* @returns A new PipelineJson object with the same properties as the input.
|
|
8
9
|
* @public exported from `@promptbook/utils`
|
|
9
10
|
*/
|
|
10
11
|
export declare function clonePipeline(pipeline: PipelineJson): PipelineJson;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { WritableDeep } from 'type-fest';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Creates a deep clone of the given object
|
|
4
4
|
*
|
|
5
|
+
* Note: This method only works for objects that are fully serializable to JSON and do not contain functions, Dates, or special types.
|
|
6
|
+
*
|
|
7
|
+
* @param objectValue The object to clone.
|
|
8
|
+
* @returns A deep, writable clone of the input object.
|
|
5
9
|
* @public exported from `@promptbook/utils`
|
|
6
10
|
*/
|
|
7
11
|
export declare function deepClone<TObject>(objectValue: TObject): WritableDeep<TObject>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Function trimCodeBlock will trim starting and ending code block from the string if it is present.
|
|
3
3
|
*
|
|
4
|
-
* Note: This is
|
|
4
|
+
* Note: This is useful for post-processing of the result of the chat LLM model
|
|
5
5
|
* when the model wraps the result in the (markdown) code block.
|
|
6
6
|
*
|
|
7
7
|
* @public exported from `@promptbook/utils`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Function trimEndOfCodeBlock will remove ending code block from the string if it is present.
|
|
3
3
|
*
|
|
4
|
-
* Note: This is
|
|
4
|
+
* Note: This is useful for post-processing of the result of the completion LLM model
|
|
5
5
|
* if you want to start code block in the prompt but you don't want to end it in the result.
|
|
6
6
|
*
|
|
7
7
|
* @public exported from `@promptbook/utils`
|
|
@@ -20,9 +20,9 @@ type UnwrapResultOptions = {
|
|
|
20
20
|
/**
|
|
21
21
|
* Removes quotes and optional introduce text from a string
|
|
22
22
|
*
|
|
23
|
-
* Tip: This is very
|
|
23
|
+
* Tip: This is very useful for post-processing of the result of the LLM model
|
|
24
24
|
* Note: This function trims the text and removes whole introduce sentence if it is present
|
|
25
|
-
* Note: There are two
|
|
25
|
+
* Note: There are two similar functions:
|
|
26
26
|
* - `removeQuotes` which removes only bounding quotes
|
|
27
27
|
* - `unwrapResult` which removes whole introduce sentence
|
|
28
28
|
*
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { string_javascript_name } from '../../../types/typeAliases';
|
|
2
2
|
import type { really_unknown } from '../../organization/really_unknown';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Checks if the given value is a valid JavaScript identifier name.
|
|
5
5
|
*
|
|
6
|
-
* @param javascriptName
|
|
7
|
-
* @returns
|
|
6
|
+
* @param javascriptName The value to check for JavaScript identifier validity.
|
|
7
|
+
* @returns `true` if the value is a valid JavaScript name, false otherwise.
|
|
8
8
|
* @public exported from `@promptbook/utils`
|
|
9
9
|
*/
|
|
10
10
|
export declare function isValidJavascriptName(javascriptName: really_unknown): javascriptName is string_javascript_name;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { string_parameter_name } from '../../../types/typeAliases';
|
|
2
2
|
/**
|
|
3
|
-
* Function `validateParameterName` will
|
|
3
|
+
* Function `validateParameterName` will normalize and validate a parameter name for use in pipelines.
|
|
4
|
+
* It removes diacritics, emojis, and quotes, normalizes to camelCase, and checks for reserved names and invalid characters.
|
|
4
5
|
*
|
|
5
|
-
* @param parameterName
|
|
6
|
-
* @returns
|
|
7
|
-
* @throws {ParseError}
|
|
6
|
+
* @param parameterName The parameter name to validate and normalize.
|
|
7
|
+
* @returns The validated and normalized parameter name.
|
|
8
|
+
* @throws {ParseError} If the parameter name is empty, reserved, or contains invalid characters.
|
|
8
9
|
* @private within the repository
|
|
9
10
|
*/
|
|
10
11
|
export declare function validateParameterName(parameterName: string): string_parameter_name;
|
|
@@ -6,7 +6,7 @@ import type { really_unknown } from '../../organization/really_unknown';
|
|
|
6
6
|
*
|
|
7
7
|
* @see https://www.npmjs.com/package/promptbook?activeTab=versions
|
|
8
8
|
* Note: When you are using for example promptbook 2.0.0 and there already is promptbook 3.0.0 it don`t know about it.
|
|
9
|
-
* Note: There are two
|
|
9
|
+
* Note: There are two similar functions:
|
|
10
10
|
* - `isValidSemanticVersion` which tests any semantic version
|
|
11
11
|
* - `isValidPromptbookVersion` *(this one)* which tests just Promptbook versions
|
|
12
12
|
*
|
|
@@ -3,7 +3,7 @@ import type { really_unknown } from '../../organization/really_unknown';
|
|
|
3
3
|
/**
|
|
4
4
|
* Tests if given string is valid semantic version
|
|
5
5
|
*
|
|
6
|
-
* Note: There are two
|
|
6
|
+
* Note: There are two similar functions:
|
|
7
7
|
* - `isValidSemanticVersion` which tests any semantic version
|
|
8
8
|
* - `isValidPromptbookVersion` *(this one)* which tests just Promptbook versions
|
|
9
9
|
*
|
|
@@ -2,7 +2,7 @@ import type { string_hostname } from '../../../types/typeAliases';
|
|
|
2
2
|
/**
|
|
3
3
|
* Checks if an URL is reserved for private networks or localhost.
|
|
4
4
|
*
|
|
5
|
-
* Note: There are two
|
|
5
|
+
* Note: There are two similar functions:
|
|
6
6
|
* - `isUrlOnPrivateNetwork` which tests full URL
|
|
7
7
|
* - `isHostnameOnPrivateNetwork` *(this one)* which tests just hostname
|
|
8
8
|
*
|
|
@@ -2,7 +2,7 @@ import type { string_url } from '../../../types/typeAliases';
|
|
|
2
2
|
/**
|
|
3
3
|
* Checks if an IP address or hostname is reserved for private networks or localhost.
|
|
4
4
|
*
|
|
5
|
-
* Note: There are two
|
|
5
|
+
* Note: There are two similar functions:
|
|
6
6
|
* - `isUrlOnPrivateNetwork` *(this one)* which tests full URL
|
|
7
7
|
* - `isHostnameOnPrivateNetwork` which tests just hostname
|
|
8
8
|
*
|
|
@@ -3,7 +3,7 @@ import type { really_unknown } from '../../organization/really_unknown';
|
|
|
3
3
|
/**
|
|
4
4
|
* Tests if given string is valid pipeline URL URL.
|
|
5
5
|
*
|
|
6
|
-
* Note: There are two
|
|
6
|
+
* Note: There are two similar functions:
|
|
7
7
|
* - `isValidUrl` which tests any URL
|
|
8
8
|
* - `isValidPipelineUrl` *(this one)* which tests just pipeline URL
|
|
9
9
|
*
|
|
@@ -4,7 +4,7 @@ import type { really_unknown } from '../../organization/really_unknown';
|
|
|
4
4
|
* Tests if given string is valid URL.
|
|
5
5
|
*
|
|
6
6
|
* Note: Dataurl are considered perfectly valid.
|
|
7
|
-
* Note: There are two
|
|
7
|
+
* Note: There are two similar functions:
|
|
8
8
|
* - `isValidUrl` which tests any URL
|
|
9
9
|
* - `isValidPipelineUrl` *(this one)* which tests just promptbook URL
|
|
10
10
|
*
|
|
@@ -14,7 +14,8 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
|
|
|
14
14
|
*/
|
|
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.92.0`).
|
|
18
19
|
*
|
|
19
20
|
* @generated
|
|
20
21
|
*/
|
|
@@ -24,7 +24,7 @@ declare class Wizzard {
|
|
|
24
24
|
* 2) As a URL https://promptbook.studio/hejny/write-cv.book fetched from the internet
|
|
25
25
|
* 3) As a string
|
|
26
26
|
*
|
|
27
|
-
* Note: This works
|
|
27
|
+
* Note: This works similar to the `ptbk run` command
|
|
28
28
|
*/
|
|
29
29
|
execute(book: string_pipeline_url | string_filename | PipelineString, inputParameters: InputParameters): Promise<{
|
|
30
30
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/azure-openai",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.93.0",
|
|
4
|
+
"description": "Promptbook: Run AI apps in plain human language across multiple models and platforms",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"repository": {
|
|
@@ -47,11 +47,23 @@
|
|
|
47
47
|
"node": ">=16.0.0",
|
|
48
48
|
"npm": ">=8.0.0"
|
|
49
49
|
},
|
|
50
|
+
"cspell": {
|
|
51
|
+
"version": "0.2",
|
|
52
|
+
"language": "en",
|
|
53
|
+
"ignorePaths": [
|
|
54
|
+
"node_modules",
|
|
55
|
+
".next",
|
|
56
|
+
"coverage",
|
|
57
|
+
"dist",
|
|
58
|
+
".git"
|
|
59
|
+
],
|
|
60
|
+
"words": []
|
|
61
|
+
},
|
|
50
62
|
"main": "./umd/index.umd.js",
|
|
51
63
|
"module": "./esm/index.es.js",
|
|
52
64
|
"typings": "./esm/typings/src/_packages/azure-openai.index.d.ts",
|
|
53
65
|
"peerDependencies": {
|
|
54
|
-
"@promptbook/core": "0.
|
|
66
|
+
"@promptbook/core": "0.93.0"
|
|
55
67
|
},
|
|
56
68
|
"dependencies": {
|
|
57
69
|
"@azure/openai": "1.0.0-beta.12",
|
package/umd/index.umd.js
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* @generated
|
|
25
25
|
* @see https://github.com/webgptorg/promptbook
|
|
26
26
|
*/
|
|
27
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.
|
|
27
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.93.0';
|
|
28
28
|
/**
|
|
29
29
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
30
30
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
const CONNECTION_TIMEOUT_MS = 7 * 1000;
|
|
87
87
|
// <- TODO: [🧜♂️]
|
|
88
88
|
/**
|
|
89
|
-
*
|
|
89
|
+
* Default settings for parsing and generating CSV files in Promptbook.
|
|
90
90
|
*
|
|
91
91
|
* @public exported from `@promptbook/core`
|
|
92
92
|
*/
|
|
@@ -96,6 +96,14 @@
|
|
|
96
96
|
newline: '\n',
|
|
97
97
|
skipEmptyLines: true,
|
|
98
98
|
});
|
|
99
|
+
/**
|
|
100
|
+
* Default rate limits (requests per minute)
|
|
101
|
+
*
|
|
102
|
+
* Note: Adjust based on the provider tier you are have
|
|
103
|
+
*
|
|
104
|
+
* @public exported from `@promptbook/core`
|
|
105
|
+
*/
|
|
106
|
+
const DEFAULT_MAX_REQUESTS_PER_MINUTE = 60;
|
|
99
107
|
/**
|
|
100
108
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
101
109
|
* TODO: [🧠][🧜♂️] Maybe join remoteServerUrl and path into single value
|
|
@@ -127,7 +135,7 @@
|
|
|
127
135
|
super(message);
|
|
128
136
|
this.name = 'PipelineExecutionError';
|
|
129
137
|
// TODO: [🐙] DRY - Maybe $randomId
|
|
130
|
-
this.id = `error-${$randomToken(8 /* <- TODO: To global config + Use Base58 to avoid
|
|
138
|
+
this.id = `error-${$randomToken(8 /* <- TODO: To global config + Use Base58 to avoid similar char conflicts */)}`;
|
|
131
139
|
Object.setPrototypeOf(this, PipelineExecutionError.prototype);
|
|
132
140
|
}
|
|
133
141
|
}
|
|
@@ -190,7 +198,7 @@
|
|
|
190
198
|
${block(message)}
|
|
191
199
|
|
|
192
200
|
Note: This error should not happen.
|
|
193
|
-
It's
|
|
201
|
+
It's probably a bug in the pipeline collection
|
|
194
202
|
|
|
195
203
|
Please report issue:
|
|
196
204
|
${block(getErrorReportUrl(new Error(message)).href)}
|
|
@@ -546,10 +554,10 @@
|
|
|
546
554
|
*/
|
|
547
555
|
|
|
548
556
|
/**
|
|
549
|
-
*
|
|
557
|
+
* Removes diacritic marks (accents) from characters in a string.
|
|
550
558
|
*
|
|
551
|
-
* @param input
|
|
552
|
-
* @returns
|
|
559
|
+
* @param input The string containing diacritics to be normalized.
|
|
560
|
+
* @returns The string with diacritics removed or normalized.
|
|
553
561
|
* @public exported from `@promptbook/utils`
|
|
554
562
|
*/
|
|
555
563
|
function removeDiacritics(input) {
|
|
@@ -695,14 +703,18 @@
|
|
|
695
703
|
/**
|
|
696
704
|
* Make UncertainNumber
|
|
697
705
|
*
|
|
698
|
-
* @param value
|
|
706
|
+
* @param value value of the uncertain number, if `NaN` or `undefined`, it will be set to 0 and `isUncertain=true`
|
|
707
|
+
* @param isUncertain if `true`, the value is uncertain, otherwise depends on the value
|
|
699
708
|
*
|
|
700
709
|
* @private utility for initializating UncertainNumber
|
|
701
710
|
*/
|
|
702
|
-
function uncertainNumber(value) {
|
|
711
|
+
function uncertainNumber(value, isUncertain) {
|
|
703
712
|
if (value === null || value === undefined || Number.isNaN(value)) {
|
|
704
713
|
return UNCERTAIN_ZERO_VALUE;
|
|
705
714
|
}
|
|
715
|
+
if (isUncertain === true) {
|
|
716
|
+
return { value, isUncertain };
|
|
717
|
+
}
|
|
706
718
|
return { value };
|
|
707
719
|
}
|
|
708
720
|
|
|
@@ -920,8 +932,12 @@
|
|
|
920
932
|
*/
|
|
921
933
|
|
|
922
934
|
/**
|
|
923
|
-
*
|
|
935
|
+
* Creates a deep clone of the given object
|
|
924
936
|
*
|
|
937
|
+
* Note: This method only works for objects that are fully serializable to JSON and do not contain functions, Dates, or special types.
|
|
938
|
+
*
|
|
939
|
+
* @param objectValue The object to clone.
|
|
940
|
+
* @returns A deep, writable clone of the input object.
|
|
925
941
|
* @public exported from `@promptbook/utils`
|
|
926
942
|
*/
|
|
927
943
|
function deepClone(objectValue) {
|
|
@@ -983,13 +999,13 @@
|
|
|
983
999
|
*/
|
|
984
1000
|
const REPLACING_NONCE = 'ptbkauk42kV2dzao34faw7FudQUHYPtW';
|
|
985
1001
|
/**
|
|
986
|
-
*
|
|
1002
|
+
* Placeholder value indicating a parameter is missing its value.
|
|
987
1003
|
*
|
|
988
1004
|
* @private within the repository
|
|
989
1005
|
*/
|
|
990
1006
|
const RESERVED_PARAMETER_MISSING_VALUE = 'MISSING-' + REPLACING_NONCE;
|
|
991
1007
|
/**
|
|
992
|
-
*
|
|
1008
|
+
* Placeholder value indicating a parameter is restricted and cannot be used directly.
|
|
993
1009
|
*
|
|
994
1010
|
* @private within the repository
|
|
995
1011
|
*/
|
|
@@ -1196,7 +1212,7 @@
|
|
|
1196
1212
|
/**
|
|
1197
1213
|
* List of available OpenAI models with pricing
|
|
1198
1214
|
*
|
|
1199
|
-
* Note: Done at
|
|
1215
|
+
* Note: Done at 2025-05-06
|
|
1200
1216
|
*
|
|
1201
1217
|
* @see https://platform.openai.com/docs/models/
|
|
1202
1218
|
* @see https://openai.com/api/pricing/
|
|
@@ -1457,7 +1473,7 @@
|
|
|
1457
1473
|
modelName: 'text-embedding-3-large',
|
|
1458
1474
|
modelDescription: "OpenAI's most capable text embedding model designed for high-quality embeddings for complex similarity tasks and information retrieval.",
|
|
1459
1475
|
pricing: {
|
|
1460
|
-
prompt: computeUsage(`$0.13
|
|
1476
|
+
prompt: computeUsage(`$0.13 / 1M tokens`),
|
|
1461
1477
|
// TODO: [🏏] Leverage the batch API @see https://platform.openai.com/docs/guides/batch
|
|
1462
1478
|
output: 0, // <- Note: [🆖] In Embedding models you dont pay for output
|
|
1463
1479
|
},
|
|
@@ -1550,8 +1566,8 @@
|
|
|
1550
1566
|
modelName: 'gpt-4o-mini',
|
|
1551
1567
|
modelDescription: 'Smaller, more cost-effective version of GPT-4o with good performance across text, vision, and audio tasks at reduced complexity.',
|
|
1552
1568
|
pricing: {
|
|
1553
|
-
prompt: computeUsage(`$
|
|
1554
|
-
output: computeUsage(`$
|
|
1569
|
+
prompt: computeUsage(`$0.15 / 1M tokens`),
|
|
1570
|
+
output: computeUsage(`$0.60 / 1M tokens`),
|
|
1555
1571
|
},
|
|
1556
1572
|
},
|
|
1557
1573
|
/**/
|
|
@@ -1573,7 +1589,7 @@
|
|
|
1573
1589
|
modelTitle: 'o1-preview-2024-09-12',
|
|
1574
1590
|
modelName: 'o1-preview-2024-09-12',
|
|
1575
1591
|
modelDescription: 'September 2024 version of O1 preview with specialized reasoning capabilities for complex tasks requiring precise analytical thinking.',
|
|
1576
|
-
// <- TODO: [💩] Some better system to organize
|
|
1592
|
+
// <- TODO: [💩] Some better system to organize these date suffixes and versions
|
|
1577
1593
|
pricing: {
|
|
1578
1594
|
prompt: computeUsage(`$15.00 / 1M tokens`),
|
|
1579
1595
|
output: computeUsage(`$60.00 / 1M tokens`),
|
|
@@ -1659,9 +1675,6 @@
|
|
|
1659
1675
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1660
1676
|
*/
|
|
1661
1677
|
|
|
1662
|
-
// Default rate limits (requests per minute) - adjust as needed based on Azure OpenAI tier
|
|
1663
|
-
const DEFAULT_RPM = 60;
|
|
1664
|
-
// <- TODO: !!! Put in some better place
|
|
1665
1678
|
/**
|
|
1666
1679
|
* Execution Tools for calling Azure OpenAI API.
|
|
1667
1680
|
*
|
|
@@ -1681,7 +1694,7 @@
|
|
|
1681
1694
|
this.client = null;
|
|
1682
1695
|
// TODO: Allow configuring rate limits via options
|
|
1683
1696
|
this.limiter = new Bottleneck__default["default"]({
|
|
1684
|
-
minTime: 60000 / (this.options.maxRequestsPerMinute ||
|
|
1697
|
+
minTime: 60000 / (this.options.maxRequestsPerMinute || DEFAULT_MAX_REQUESTS_PER_MINUTE),
|
|
1685
1698
|
});
|
|
1686
1699
|
}
|
|
1687
1700
|
get title() {
|
|
@@ -1935,7 +1948,7 @@
|
|
|
1935
1948
|
});
|
|
1936
1949
|
}
|
|
1937
1950
|
/**
|
|
1938
|
-
* Changes Azure error (which is not
|
|
1951
|
+
* Changes Azure error (which is not proper Error but object) to proper Error
|
|
1939
1952
|
*/
|
|
1940
1953
|
transformAzureError(azureError) {
|
|
1941
1954
|
if (azureError instanceof UnexpectedError) {
|
|
@@ -1995,7 +2008,8 @@
|
|
|
1995
2008
|
}
|
|
1996
2009
|
|
|
1997
2010
|
/**
|
|
1998
|
-
*
|
|
2011
|
+
* Safely retrieves the global scope object (window in browser, global in Node.js)
|
|
2012
|
+
* regardless of the JavaScript environment in which the code is running
|
|
1999
2013
|
*
|
|
2000
2014
|
* Note: `$` is used to indicate that this function is not a pure function - it access global scope
|
|
2001
2015
|
*
|
|
@@ -2006,10 +2020,10 @@
|
|
|
2006
2020
|
}
|
|
2007
2021
|
|
|
2008
2022
|
/**
|
|
2009
|
-
*
|
|
2023
|
+
* Normalizes a text string to SCREAMING_CASE (all uppercase with underscores).
|
|
2010
2024
|
*
|
|
2011
|
-
* @param text
|
|
2012
|
-
* @returns
|
|
2025
|
+
* @param text The text string to be converted to SCREAMING_CASE format.
|
|
2026
|
+
* @returns The normalized text in SCREAMING_CASE format.
|
|
2013
2027
|
* @example 'HELLO_WORLD'
|
|
2014
2028
|
* @example 'I_LOVE_PROMPTBOOK'
|
|
2015
2029
|
* @public exported from `@promptbook/utils`
|
|
@@ -2061,10 +2075,10 @@
|
|
|
2061
2075
|
*/
|
|
2062
2076
|
|
|
2063
2077
|
/**
|
|
2064
|
-
*
|
|
2078
|
+
* Normalizes a text string to snake_case format.
|
|
2065
2079
|
*
|
|
2066
|
-
* @param text
|
|
2067
|
-
* @returns
|
|
2080
|
+
* @param text The text string to be converted to snake_case format.
|
|
2081
|
+
* @returns The normalized text in snake_case format.
|
|
2068
2082
|
* @example 'hello_world'
|
|
2069
2083
|
* @example 'i_love_promptbook'
|
|
2070
2084
|
* @public exported from `@promptbook/utils`
|
|
@@ -2074,11 +2088,11 @@
|
|
|
2074
2088
|
}
|
|
2075
2089
|
|
|
2076
2090
|
/**
|
|
2077
|
-
*
|
|
2091
|
+
* Global registry for storing and managing registered entities of a given type.
|
|
2078
2092
|
*
|
|
2079
2093
|
* Note: `$` is used to indicate that this function is not a pure function - it accesses and adds variables in global scope.
|
|
2080
2094
|
*
|
|
2081
|
-
* @private internal utility, exported are only
|
|
2095
|
+
* @private internal utility, exported are only singleton instances of this class
|
|
2082
2096
|
*/
|
|
2083
2097
|
class $Register {
|
|
2084
2098
|
constructor(registerName) {
|
|
@@ -2122,10 +2136,10 @@
|
|
|
2122
2136
|
}
|
|
2123
2137
|
|
|
2124
2138
|
/**
|
|
2125
|
-
*
|
|
2139
|
+
* Register for LLM tools.
|
|
2126
2140
|
*
|
|
2127
2141
|
* Note: `$` is used to indicate that this interacts with the global scope
|
|
2128
|
-
* @singleton Only one instance of each register is created per build, but
|
|
2142
|
+
* @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
|
|
2129
2143
|
* @public exported from `@promptbook/core`
|
|
2130
2144
|
*/
|
|
2131
2145
|
const $llmToolsRegister = new $Register('llm_execution_tools_constructors');
|