@promptbook/azure-openai 0.100.0-9 → 0.100.1
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 +7 -14
- package/esm/index.es.js +142 -5
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/color.index.d.ts +50 -0
- package/esm/typings/src/_packages/components.index.d.ts +36 -0
- package/esm/typings/src/_packages/core.index.d.ts +30 -0
- package/esm/typings/src/_packages/types.index.d.ts +38 -0
- package/esm/typings/src/book-2.0/agent-source/parseAgentSource.d.ts +30 -0
- package/esm/typings/src/book-2.0/agent-source/parseAgentSource.test.d.ts +1 -0
- package/esm/typings/src/book-2.0/agent-source/string_book.d.ts +26 -0
- package/esm/typings/src/book-2.0/commitments/ACTION/ACTION.d.ts +38 -0
- package/esm/typings/src/book-2.0/commitments/FORMAT/FORMAT.d.ts +39 -0
- package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +45 -0
- package/esm/typings/src/book-2.0/commitments/META_IMAGE/META_IMAGE.d.ts +44 -0
- package/esm/typings/src/book-2.0/commitments/META_LINK/META_LINK.d.ts +56 -0
- package/esm/typings/src/book-2.0/commitments/MODEL/MODEL.d.ts +39 -0
- package/esm/typings/src/book-2.0/commitments/NOTE/NOTE.d.ts +49 -0
- package/esm/typings/src/book-2.0/commitments/PERSONA/PERSONA.d.ts +46 -0
- package/esm/typings/src/book-2.0/commitments/RULE/RULE.d.ts +44 -0
- package/esm/typings/src/book-2.0/commitments/SAMPLE/SAMPLE.d.ts +44 -0
- package/esm/typings/src/book-2.0/commitments/STYLE/STYLE.d.ts +38 -0
- package/esm/typings/src/book-2.0/commitments/_base/BaseCommitmentDefinition.d.ts +52 -0
- package/esm/typings/src/book-2.0/commitments/_base/BookCommitment.d.ts +5 -0
- package/esm/typings/src/book-2.0/commitments/_base/CommitmentDefinition.d.ts +48 -0
- package/esm/typings/src/book-2.0/commitments/_base/NotYetImplementedCommitmentDefinition.d.ts +22 -0
- package/esm/typings/src/book-2.0/commitments/_base/createEmptyAgentModelRequirements.d.ts +19 -0
- package/esm/typings/src/book-2.0/commitments/_misc/AgentModelRequirements.d.ts +37 -0
- package/esm/typings/src/book-2.0/commitments/_misc/AgentSourceParseResult.d.ts +18 -0
- package/esm/typings/src/book-2.0/commitments/_misc/ParsedCommitment.d.ts +22 -0
- package/esm/typings/src/book-2.0/commitments/_misc/createAgentModelRequirements.d.ts +62 -0
- package/esm/typings/src/book-2.0/commitments/_misc/createAgentModelRequirementsWithCommitments.d.ts +36 -0
- package/esm/typings/src/book-2.0/commitments/_misc/createCommitmentRegex.d.ts +20 -0
- package/esm/typings/src/book-2.0/commitments/_misc/parseAgentSourceWithCommitments.d.ts +24 -0
- package/esm/typings/src/book-2.0/commitments/_misc/removeCommentsFromSystemMessage.d.ts +11 -0
- package/esm/typings/src/book-2.0/commitments/index.d.ts +56 -0
- package/esm/typings/src/book-2.0/utils/profileImageUtils.d.ts +39 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarChip/AvatarChip.d.ts +35 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarChip/AvatarChipFromSource.d.ts +21 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarChip/index.d.ts +2 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +29 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource.d.ts +19 -0
- package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +40 -0
- package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +15 -0
- package/esm/typings/src/book-components/BookEditor/config.d.ts +10 -0
- package/esm/typings/src/book-components/BookEditor/injectCssModuleIntoShadowRoot.d.ts +11 -0
- package/esm/typings/src/book-components/Chat/Chat/Chat.d.ts +20 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +110 -0
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChat.d.ts +14 -0
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChat.test.d.ts +1 -0
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +24 -0
- package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +16 -0
- package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +32 -0
- package/esm/typings/src/book-components/Chat/utils/ChatPersistence.d.ts +25 -0
- package/esm/typings/src/book-components/Chat/utils/ExportFormat.d.ts +4 -0
- package/esm/typings/src/book-components/Chat/utils/addUtmParamsToUrl.d.ts +7 -0
- package/esm/typings/src/book-components/Chat/utils/createShortLinkForChat.d.ts +7 -0
- package/esm/typings/src/book-components/Chat/utils/downloadFile.d.ts +6 -0
- package/esm/typings/src/book-components/Chat/utils/exportChatHistory.d.ts +9 -0
- package/esm/typings/src/book-components/Chat/utils/generatePdfContent.d.ts +8 -0
- package/esm/typings/src/book-components/Chat/utils/generateQrDataUrl.d.ts +7 -0
- package/esm/typings/src/book-components/Chat/utils/getPromptbookBranding.d.ts +6 -0
- package/esm/typings/src/book-components/Chat/utils/messagesToHtml.d.ts +8 -0
- package/esm/typings/src/book-components/Chat/utils/messagesToJson.d.ts +7 -0
- package/esm/typings/src/book-components/Chat/utils/messagesToMarkdown.d.ts +8 -0
- package/esm/typings/src/book-components/Chat/utils/messagesToText.d.ts +8 -0
- package/esm/typings/src/book-components/_common/react-utils/classNames.d.ts +7 -0
- package/esm/typings/src/book-components/_common/react-utils/collectCssTextsForClass.d.ts +7 -0
- package/esm/typings/src/book-components/_common/react-utils/escapeHtml.d.ts +6 -0
- package/esm/typings/src/book-components/_common/react-utils/escapeRegex.d.ts +6 -0
- package/esm/typings/src/config.d.ts +19 -0
- package/esm/typings/src/execution/AvailableModel.d.ts +4 -0
- package/esm/typings/src/execution/ExecutionTask.d.ts +27 -1
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +11 -6
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +6 -1
- package/esm/typings/src/llm-providers/_common/filterModels.d.ts +0 -3
- package/esm/typings/src/llm-providers/_common/profiles/llmProviderProfiles.d.ts +81 -0
- package/esm/typings/src/llm-providers/_common/profiles/test/llmProviderProfiles.test.d.ts +1 -0
- package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +3 -4
- package/esm/typings/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +5 -0
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +5 -5
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
- 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/mocked/MockedEchoLlmExecutionTools.d.ts +5 -0
- package/esm/typings/src/llm-providers/ollama/ollama-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +8 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +5 -0
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +5 -0
- package/esm/typings/src/pipeline/book-notation.d.ts +2 -1
- package/esm/typings/src/playground/permanent/error-handling-playground.d.ts +5 -0
- package/esm/typings/src/types/ModelRequirements.d.ts +0 -2
- package/esm/typings/src/types/typeAliases.d.ts +6 -0
- package/esm/typings/src/utils/color/$randomColor.d.ts +11 -0
- package/esm/typings/src/utils/color/Color.d.ts +179 -0
- package/esm/typings/src/utils/color/css-colors.d.ts +159 -0
- package/esm/typings/src/utils/color/internal-utils/checkChannelValue.d.ts +14 -0
- package/esm/typings/src/utils/color/internal-utils/hslToRgb.d.ts +17 -0
- package/esm/typings/src/utils/color/internal-utils/rgbToHsl.d.ts +17 -0
- package/esm/typings/src/utils/color/operators/ColorTransformer.d.ts +5 -0
- package/esm/typings/src/utils/color/operators/darken.d.ts +9 -0
- package/esm/typings/src/utils/color/operators/furthest.d.ts +16 -0
- package/esm/typings/src/utils/color/operators/grayscale.d.ts +9 -0
- package/esm/typings/src/utils/color/operators/lighten.d.ts +12 -0
- package/esm/typings/src/utils/color/operators/mixWithColor.d.ts +11 -0
- package/esm/typings/src/utils/color/operators/nearest.d.ts +10 -0
- package/esm/typings/src/utils/color/operators/negative.d.ts +7 -0
- package/esm/typings/src/utils/color/operators/negativeLightness.d.ts +7 -0
- package/esm/typings/src/utils/color/operators/withAlpha.d.ts +9 -0
- package/esm/typings/src/utils/color/utils/areColorsEqual.d.ts +14 -0
- package/esm/typings/src/utils/color/utils/colorDistance.d.ts +21 -0
- package/esm/typings/src/utils/color/utils/colorHue.d.ts +11 -0
- package/esm/typings/src/utils/color/utils/colorHueDistance.d.ts +11 -0
- package/esm/typings/src/utils/color/utils/colorHueDistance.test.d.ts +1 -0
- package/esm/typings/src/utils/color/utils/colorLuminance.d.ts +9 -0
- package/esm/typings/src/utils/color/utils/colorSatulightion.d.ts +7 -0
- package/esm/typings/src/utils/color/utils/colorSaturation.d.ts +9 -0
- package/esm/typings/src/utils/color/utils/colorToDataUrl.d.ts +10 -0
- package/esm/typings/src/utils/color/utils/mixColors.d.ts +11 -0
- package/esm/typings/src/utils/organization/preserve.d.ts +21 -0
- package/esm/typings/src/utils/take/classes/TakeChain.d.ts +11 -0
- package/esm/typings/src/utils/take/interfaces/ITakeChain.d.ts +12 -0
- package/esm/typings/src/utils/take/interfaces/Takeable.d.ts +7 -0
- package/esm/typings/src/utils/take/take.d.ts +12 -0
- package/esm/typings/src/utils/take/take.test.d.ts +1 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +142 -5
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +0 -14
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { number_integer } from '../../../types/typeAliases';
|
|
2
|
+
import type { number_percent } from '../../../types/typeAliases';
|
|
3
|
+
import type { number_positive } from '../../../types/typeAliases';
|
|
4
|
+
/**
|
|
5
|
+
* Converts HSL values to RGB values
|
|
6
|
+
*
|
|
7
|
+
* @param hue [0-1]
|
|
8
|
+
* @param saturation [0-1]
|
|
9
|
+
* @param lightness [0-1]
|
|
10
|
+
* @returns [red, green, blue] [0-255]
|
|
11
|
+
*
|
|
12
|
+
* @private util of `@promptbook/color`
|
|
13
|
+
*/
|
|
14
|
+
export declare function hslToRgb(hue: number_percent, saturation: number_percent, lightness: number_percent): readonly [number_positive & number_integer, number_positive & number_integer, number_positive & number_integer];
|
|
15
|
+
/**
|
|
16
|
+
* TODO: Properly name all used internal variables
|
|
17
|
+
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { number_integer } from '../../../types/typeAliases';
|
|
2
|
+
import type { number_percent } from '../../../types/typeAliases';
|
|
3
|
+
import type { number_positive } from '../../../types/typeAliases';
|
|
4
|
+
/**
|
|
5
|
+
* Converts RGB values to HSL values
|
|
6
|
+
*
|
|
7
|
+
* @param red [0-255]
|
|
8
|
+
* @param green [0-255]
|
|
9
|
+
* @param blue [0-255]
|
|
10
|
+
* @returns [hue, saturation, lightness] [0-1]
|
|
11
|
+
*
|
|
12
|
+
* @private util of `@promptbook/color`
|
|
13
|
+
*/
|
|
14
|
+
export declare function rgbToHsl(red: number_positive & number_integer, green: number_positive & number_integer, blue: number_positive & number_integer): readonly [number_percent, number_percent, number_percent];
|
|
15
|
+
/**
|
|
16
|
+
* TODO: Properly name all used internal variables
|
|
17
|
+
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ColorTransformer } from './ColorTransformer';
|
|
2
|
+
/**
|
|
3
|
+
* Makes color transformer which darker the given color
|
|
4
|
+
*
|
|
5
|
+
* @param amount from 0 to 1
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/color`
|
|
8
|
+
*/
|
|
9
|
+
export declare function darken(amount: number): ColorTransformer;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Color } from '../Color';
|
|
2
|
+
import type { ColorTransformer } from './ColorTransformer';
|
|
3
|
+
/**
|
|
4
|
+
* Makes color transformer which finds the furthest color from the given list
|
|
5
|
+
*
|
|
6
|
+
* @param colors array of colors to choose from
|
|
7
|
+
*
|
|
8
|
+
* @public exported from `@promptbook/color`
|
|
9
|
+
*/
|
|
10
|
+
export declare function furthest(...colors: Color[]): ColorTransformer;
|
|
11
|
+
/**
|
|
12
|
+
* Makes color transformer which finds the best text color (black or white) for the given background color
|
|
13
|
+
*
|
|
14
|
+
* @public exported from `@promptbook/color`
|
|
15
|
+
*/
|
|
16
|
+
export declare const textColor: ColorTransformer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ColorTransformer } from './ColorTransformer';
|
|
2
|
+
/**
|
|
3
|
+
* Makes color transformer which returns a grayscale version of the color
|
|
4
|
+
*
|
|
5
|
+
* @param amount from 0 to 1
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/color`
|
|
8
|
+
*/
|
|
9
|
+
export declare function grayscale(amount: number): ColorTransformer;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ColorTransformer } from './ColorTransformer';
|
|
2
|
+
/**
|
|
3
|
+
* Makes color transformer which lighten the given color
|
|
4
|
+
*
|
|
5
|
+
* @param amount from 0 to 1
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/color`
|
|
8
|
+
*/
|
|
9
|
+
export declare function lighten(amount: number): ColorTransformer;
|
|
10
|
+
/**
|
|
11
|
+
* TODO: Maybe implement by mix+hsl
|
|
12
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Color } from '../Color';
|
|
2
|
+
import type { ColorTransformer } from './ColorTransformer';
|
|
3
|
+
/**
|
|
4
|
+
* Makes color transformer which returns a mix of two colors based on a ratio
|
|
5
|
+
*
|
|
6
|
+
* @param ratio the ratio of the first color to the second color, from 0 to 1
|
|
7
|
+
* @param additionalColor the second color to mix with the first color
|
|
8
|
+
*
|
|
9
|
+
* @public exported from `@promptbook/color`
|
|
10
|
+
*/
|
|
11
|
+
export declare function mixWithColor(ratio: number, additionalColor: Color): ColorTransformer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Color } from '../Color';
|
|
2
|
+
import type { ColorTransformer } from './ColorTransformer';
|
|
3
|
+
/**
|
|
4
|
+
* Makes color transformer which finds the nearest color from the given list
|
|
5
|
+
*
|
|
6
|
+
* @param colors array of colors to choose from
|
|
7
|
+
*
|
|
8
|
+
* @public exported from `@promptbook/color`
|
|
9
|
+
*/
|
|
10
|
+
export declare function nearest(...colors: Color[]): ColorTransformer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ColorTransformer } from './ColorTransformer';
|
|
2
|
+
/**
|
|
3
|
+
* Makes color transformer which sets alpha channel to given color
|
|
4
|
+
*
|
|
5
|
+
* @param alpha number from 0 (transparent) to 1 (opaque)
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/color`
|
|
8
|
+
*/
|
|
9
|
+
export declare function withAlpha(alpha: number): ColorTransformer;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Color } from '../Color';
|
|
2
|
+
/**
|
|
3
|
+
* Compares two colors to determine if they are equal based on their RGB values.
|
|
4
|
+
*
|
|
5
|
+
* @param color1 - The first color to compare.
|
|
6
|
+
* @param color2 - The second color to compare.
|
|
7
|
+
* @returns {boolean} True if the colors are equal, false otherwise.
|
|
8
|
+
*
|
|
9
|
+
* @public exported from `@promptbook/color`
|
|
10
|
+
*/
|
|
11
|
+
export declare function areColorsEqual(color1: Color, color2: Color): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* TODO: [🥎] Implement for N colors
|
|
14
|
+
*/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Color } from '../Color';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates distance between two colors
|
|
4
|
+
*
|
|
5
|
+
* @param color1 first color
|
|
6
|
+
* @param color2 second color
|
|
7
|
+
*
|
|
8
|
+
* Note: This function is inefficient. Use colorDistanceSquared instead if possible.
|
|
9
|
+
*
|
|
10
|
+
* @public exported from `@promptbook/color`
|
|
11
|
+
*/
|
|
12
|
+
export declare function colorDistance(color1: Color, color2: Color): number;
|
|
13
|
+
/**
|
|
14
|
+
* Calculates distance between two colors without square root
|
|
15
|
+
*
|
|
16
|
+
* @param color1 first color
|
|
17
|
+
* @param color2 second color
|
|
18
|
+
*
|
|
19
|
+
* @public exported from `@promptbook/color`
|
|
20
|
+
*/
|
|
21
|
+
export declare function colorDistanceSquared(color1: Color, color2: Color): number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Color } from '../Color';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates hue of the color
|
|
4
|
+
*
|
|
5
|
+
* @returns hue in degrees <0-360)
|
|
6
|
+
*
|
|
7
|
+
* @see https://en.wikipedia.org/wiki/HSL_and_HSV#Hue_and_chroma
|
|
8
|
+
*
|
|
9
|
+
* @public exported from `@promptbook/color`
|
|
10
|
+
*/
|
|
11
|
+
export declare function colorHue(color: Color): number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Color } from '../Color';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates hue distance of two colors
|
|
4
|
+
*
|
|
5
|
+
* @returns hue distance in degrees <0-180)
|
|
6
|
+
*
|
|
7
|
+
* @see https://en.wikipedia.org/wiki/HSL_and_HSV#Hue_and_chroma
|
|
8
|
+
*
|
|
9
|
+
* @public exported from `@promptbook/color`
|
|
10
|
+
*/
|
|
11
|
+
export declare function colorHueDistance(color1: Color, color2: Color): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Color } from "../Color";
|
|
2
|
+
/**
|
|
3
|
+
* Calculates saturation of the color
|
|
4
|
+
*
|
|
5
|
+
* @see https://en.wikipedia.org/wiki/HSL_and_HSV#Saturation
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/color`
|
|
8
|
+
*/
|
|
9
|
+
export declare function colorSaturation(color: Color): number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WithTake } from '../../take/interfaces/ITakeChain';
|
|
2
|
+
import { Color } from '../Color';
|
|
3
|
+
/**
|
|
4
|
+
* Mixes an array of colors and returns the average color
|
|
5
|
+
*
|
|
6
|
+
* @param {...Color} colors - The array of colors to be mixed.
|
|
7
|
+
* @returns {WithTake<Color>} - The mixed color.
|
|
8
|
+
*
|
|
9
|
+
* @public exported from `@promptbook/color`
|
|
10
|
+
*/
|
|
11
|
+
export declare function mixColors(...colors: Array<Color>): WithTake<Color>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { really_any } from './really_any';
|
|
2
|
+
/**
|
|
3
|
+
* Does nothing, but preserves the function in the bundle
|
|
4
|
+
* Compiler is tricked into thinking the function is used
|
|
5
|
+
*
|
|
6
|
+
* @param value any function to preserve
|
|
7
|
+
* @returns nothing
|
|
8
|
+
* @private within the repository
|
|
9
|
+
*/
|
|
10
|
+
export declare function $preserve(...value: Array<really_any>): void;
|
|
11
|
+
/**
|
|
12
|
+
* DO NOT USE THIS FUNCTION
|
|
13
|
+
* Only purpose of this function is to trick the compiler and javascript engine
|
|
14
|
+
* that `_preserved` array can be used in the future and should not be garbage collected
|
|
15
|
+
*
|
|
16
|
+
* @private internal for `preserve`
|
|
17
|
+
*/
|
|
18
|
+
export declare function __DO_NOT_USE_getPreserved(): Array<really_any>;
|
|
19
|
+
/**
|
|
20
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ITakeChain } from '../interfaces/ITakeChain';
|
|
2
|
+
import type { Takeable } from '../interfaces/Takeable';
|
|
3
|
+
/**
|
|
4
|
+
* @private util of `@promptbook/color`
|
|
5
|
+
* @de
|
|
6
|
+
*/
|
|
7
|
+
export declare class TakeChain<TValue extends Takeable> implements ITakeChain<TValue> {
|
|
8
|
+
value: TValue;
|
|
9
|
+
constructor(value: TValue);
|
|
10
|
+
then<TResultValue extends Takeable>(callback: (oldValue: TValue) => TResultValue): TResultValue & ITakeChain<TResultValue>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Takeable } from './Takeable';
|
|
2
|
+
/**
|
|
3
|
+
* Represents any value with take chain functionality
|
|
4
|
+
*
|
|
5
|
+
* @private util of `@promptbook/color`
|
|
6
|
+
* @deprecated [🤡] Use some better functional library instead of `TakeChain`
|
|
7
|
+
*/
|
|
8
|
+
export type WithTake<TValue extends Takeable> = TValue & ITakeChain<TValue>;
|
|
9
|
+
export interface ITakeChain<TValue extends Takeable> {
|
|
10
|
+
readonly value: TValue;
|
|
11
|
+
then<TResultValue extends Takeable>(callback: (value: TValue) => TResultValue): WithTake<TResultValue>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WithTake } from './interfaces/ITakeChain';
|
|
2
|
+
import type { Takeable } from './interfaces/Takeable';
|
|
3
|
+
/**
|
|
4
|
+
* A function that takes an initial value and returns a proxy object with chainable methods.
|
|
5
|
+
*
|
|
6
|
+
* @param {*} initialValue - The initial value.
|
|
7
|
+
* @returns {Proxy<WithTake<TValue>>} - A proxy object with a `take` method.
|
|
8
|
+
*
|
|
9
|
+
* @private util of `@promptbook/color`
|
|
10
|
+
* @deprecated [🤡] Use some better functional library instead of `TakeChain`
|
|
11
|
+
*/
|
|
12
|
+
export declare function take<TValue extends Takeable>(initialValue: TValue): WithTake<TValue>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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.100.0
|
|
18
|
+
* It follows semantic versioning (e.g., `0.100.0`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/azure-openai",
|
|
3
|
-
"version": "0.100.
|
|
3
|
+
"version": "0.100.1",
|
|
4
4
|
"description": "Promptbook: Run AI apps in plain human language across multiple models and platforms",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"module": "./esm/index.es.js",
|
|
106
106
|
"typings": "./esm/typings/src/_packages/azure-openai.index.d.ts",
|
|
107
107
|
"peerDependencies": {
|
|
108
|
-
"@promptbook/core": "0.100.
|
|
108
|
+
"@promptbook/core": "0.100.1"
|
|
109
109
|
},
|
|
110
110
|
"dependencies": {
|
|
111
111
|
"@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.100.
|
|
27
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.100.1';
|
|
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
|
|
@@ -104,6 +104,13 @@
|
|
|
104
104
|
* @public exported from `@promptbook/core`
|
|
105
105
|
*/
|
|
106
106
|
const DEFAULT_MAX_REQUESTS_PER_MINUTE = 60;
|
|
107
|
+
/**
|
|
108
|
+
* API request timeout in milliseconds
|
|
109
|
+
* Can be overridden via API_REQUEST_TIMEOUT environment variable
|
|
110
|
+
*
|
|
111
|
+
* @public exported from `@promptbook/core`
|
|
112
|
+
*/
|
|
113
|
+
parseInt(process.env.API_REQUEST_TIMEOUT || '90000');
|
|
107
114
|
/**
|
|
108
115
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
109
116
|
* TODO: [🧠][🧜♂️] Maybe join remoteServerUrl and path into single value
|
|
@@ -1212,7 +1219,7 @@
|
|
|
1212
1219
|
/**
|
|
1213
1220
|
* List of available OpenAI models with pricing
|
|
1214
1221
|
*
|
|
1215
|
-
* Note:
|
|
1222
|
+
* Note: Synced with official API docs at 2025-08-20
|
|
1216
1223
|
*
|
|
1217
1224
|
* @see https://platform.openai.com/docs/models/
|
|
1218
1225
|
* @see https://openai.com/api/pricing/
|
|
@@ -1221,6 +1228,138 @@
|
|
|
1221
1228
|
const OPENAI_MODELS = exportJson({
|
|
1222
1229
|
name: 'OPENAI_MODELS',
|
|
1223
1230
|
value: [
|
|
1231
|
+
/**/
|
|
1232
|
+
{
|
|
1233
|
+
modelVariant: 'CHAT',
|
|
1234
|
+
modelTitle: 'gpt-5',
|
|
1235
|
+
modelName: 'gpt-5',
|
|
1236
|
+
modelDescription: "OpenAI's most advanced language model with unprecedented reasoning capabilities and 200K context window. Features revolutionary improvements in complex problem-solving, scientific reasoning, and creative tasks. Demonstrates human-level performance across diverse domains with enhanced safety measures and alignment. Represents the next generation of AI with superior understanding, nuanced responses, and advanced multimodal capabilities.",
|
|
1237
|
+
pricing: {
|
|
1238
|
+
prompt: pricing(`$1.25 / 1M tokens`),
|
|
1239
|
+
output: pricing(`$10.00 / 1M tokens`),
|
|
1240
|
+
},
|
|
1241
|
+
},
|
|
1242
|
+
/**/
|
|
1243
|
+
/**/
|
|
1244
|
+
{
|
|
1245
|
+
modelVariant: 'CHAT',
|
|
1246
|
+
modelTitle: 'gpt-5-mini',
|
|
1247
|
+
modelName: 'gpt-5-mini',
|
|
1248
|
+
modelDescription: "A faster, cost-efficient version of GPT-5 for well-defined tasks with 200K context window. Maintains core GPT-5 capabilities while offering 5x faster inference and significantly lower costs. Features enhanced instruction following and reduced latency for production applications requiring quick responses with high quality.",
|
|
1249
|
+
pricing: {
|
|
1250
|
+
prompt: pricing(`$0.25 / 1M tokens`),
|
|
1251
|
+
output: pricing(`$2.00 / 1M tokens`),
|
|
1252
|
+
},
|
|
1253
|
+
},
|
|
1254
|
+
/**/
|
|
1255
|
+
/**/
|
|
1256
|
+
{
|
|
1257
|
+
modelVariant: 'CHAT',
|
|
1258
|
+
modelTitle: 'gpt-5-nano',
|
|
1259
|
+
modelName: 'gpt-5-nano',
|
|
1260
|
+
modelDescription: "The fastest, most cost-efficient version of GPT-5 with 200K context window. Optimized for summarization, classification, and simple reasoning tasks. Features 10x faster inference than base GPT-5 while maintaining good quality for straightforward applications. Ideal for high-volume, cost-sensitive deployments.",
|
|
1261
|
+
pricing: {
|
|
1262
|
+
prompt: pricing(`$0.05 / 1M tokens`),
|
|
1263
|
+
output: pricing(`$0.40 / 1M tokens`),
|
|
1264
|
+
},
|
|
1265
|
+
},
|
|
1266
|
+
/**/
|
|
1267
|
+
/**/
|
|
1268
|
+
{
|
|
1269
|
+
modelVariant: 'CHAT',
|
|
1270
|
+
modelTitle: 'gpt-4.1',
|
|
1271
|
+
modelName: 'gpt-4.1',
|
|
1272
|
+
modelDescription: "Smartest non-reasoning model with 128K context window. Enhanced version of GPT-4 with improved instruction following, better factual accuracy, and reduced hallucinations. Features advanced function calling capabilities and superior performance on coding tasks. Ideal for applications requiring high intelligence without reasoning overhead.",
|
|
1273
|
+
pricing: {
|
|
1274
|
+
prompt: pricing(`$3.00 / 1M tokens`),
|
|
1275
|
+
output: pricing(`$12.00 / 1M tokens`),
|
|
1276
|
+
},
|
|
1277
|
+
},
|
|
1278
|
+
/**/
|
|
1279
|
+
/**/
|
|
1280
|
+
{
|
|
1281
|
+
modelVariant: 'CHAT',
|
|
1282
|
+
modelTitle: 'gpt-4.1-mini',
|
|
1283
|
+
modelName: 'gpt-4.1-mini',
|
|
1284
|
+
modelDescription: "Smaller, faster version of GPT-4.1 with 128K context window. Balances intelligence and efficiency with 3x faster inference than base GPT-4.1. Maintains strong capabilities across text generation, reasoning, and coding while offering better cost-performance ratio for most applications.",
|
|
1285
|
+
pricing: {
|
|
1286
|
+
prompt: pricing(`$0.80 / 1M tokens`),
|
|
1287
|
+
output: pricing(`$3.20 / 1M tokens`),
|
|
1288
|
+
},
|
|
1289
|
+
},
|
|
1290
|
+
/**/
|
|
1291
|
+
/**/
|
|
1292
|
+
{
|
|
1293
|
+
modelVariant: 'CHAT',
|
|
1294
|
+
modelTitle: 'gpt-4.1-nano',
|
|
1295
|
+
modelName: 'gpt-4.1-nano',
|
|
1296
|
+
modelDescription: "Fastest, most cost-efficient version of GPT-4.1 with 128K context window. Optimized for high-throughput applications requiring good quality at minimal cost. Features 5x faster inference than GPT-4.1 while maintaining adequate performance for most general-purpose tasks.",
|
|
1297
|
+
pricing: {
|
|
1298
|
+
prompt: pricing(`$0.20 / 1M tokens`),
|
|
1299
|
+
output: pricing(`$0.80 / 1M tokens`),
|
|
1300
|
+
},
|
|
1301
|
+
},
|
|
1302
|
+
/**/
|
|
1303
|
+
/**/
|
|
1304
|
+
{
|
|
1305
|
+
modelVariant: 'CHAT',
|
|
1306
|
+
modelTitle: 'o3',
|
|
1307
|
+
modelName: 'o3',
|
|
1308
|
+
modelDescription: "Advanced reasoning model with 128K context window specializing in complex logical, mathematical, and analytical tasks. Successor to o1 with enhanced step-by-step problem-solving capabilities and superior performance on STEM-focused problems. Ideal for professional applications requiring deep analytical thinking and precise reasoning.",
|
|
1309
|
+
pricing: {
|
|
1310
|
+
prompt: pricing(`$15.00 / 1M tokens`),
|
|
1311
|
+
output: pricing(`$60.00 / 1M tokens`),
|
|
1312
|
+
},
|
|
1313
|
+
},
|
|
1314
|
+
/**/
|
|
1315
|
+
/**/
|
|
1316
|
+
{
|
|
1317
|
+
modelVariant: 'CHAT',
|
|
1318
|
+
modelTitle: 'o3-pro',
|
|
1319
|
+
modelName: 'o3-pro',
|
|
1320
|
+
modelDescription: "Enhanced version of o3 with more compute allocated for better responses on the most challenging problems. Features extended reasoning time and improved accuracy on complex analytical tasks. Designed for applications where maximum reasoning quality is more important than response speed.",
|
|
1321
|
+
pricing: {
|
|
1322
|
+
prompt: pricing(`$30.00 / 1M tokens`),
|
|
1323
|
+
output: pricing(`$120.00 / 1M tokens`),
|
|
1324
|
+
},
|
|
1325
|
+
},
|
|
1326
|
+
/**/
|
|
1327
|
+
/**/
|
|
1328
|
+
{
|
|
1329
|
+
modelVariant: 'CHAT',
|
|
1330
|
+
modelTitle: 'o4-mini',
|
|
1331
|
+
modelName: 'o4-mini',
|
|
1332
|
+
modelDescription: "Fast, cost-efficient reasoning model with 128K context window. Successor to o1-mini with improved analytical capabilities while maintaining speed advantages. Features enhanced mathematical reasoning and logical problem-solving at significantly lower cost than full reasoning models.",
|
|
1333
|
+
pricing: {
|
|
1334
|
+
prompt: pricing(`$4.00 / 1M tokens`),
|
|
1335
|
+
output: pricing(`$16.00 / 1M tokens`),
|
|
1336
|
+
},
|
|
1337
|
+
},
|
|
1338
|
+
/**/
|
|
1339
|
+
/**/
|
|
1340
|
+
{
|
|
1341
|
+
modelVariant: 'CHAT',
|
|
1342
|
+
modelTitle: 'o3-deep-research',
|
|
1343
|
+
modelName: 'o3-deep-research',
|
|
1344
|
+
modelDescription: "Most powerful deep research model with 128K context window. Specialized for comprehensive research tasks, literature analysis, and complex information synthesis. Features advanced citation capabilities and enhanced factual accuracy for academic and professional research applications.",
|
|
1345
|
+
pricing: {
|
|
1346
|
+
prompt: pricing(`$25.00 / 1M tokens`),
|
|
1347
|
+
output: pricing(`$100.00 / 1M tokens`),
|
|
1348
|
+
},
|
|
1349
|
+
},
|
|
1350
|
+
/**/
|
|
1351
|
+
/**/
|
|
1352
|
+
{
|
|
1353
|
+
modelVariant: 'CHAT',
|
|
1354
|
+
modelTitle: 'o4-mini-deep-research',
|
|
1355
|
+
modelName: 'o4-mini-deep-research',
|
|
1356
|
+
modelDescription: "Faster, more affordable deep research model with 128K context window. Balances research capabilities with cost efficiency, offering good performance on literature review, fact-checking, and information synthesis tasks at a more accessible price point.",
|
|
1357
|
+
pricing: {
|
|
1358
|
+
prompt: pricing(`$12.00 / 1M tokens`),
|
|
1359
|
+
output: pricing(`$48.00 / 1M tokens`),
|
|
1360
|
+
},
|
|
1361
|
+
},
|
|
1362
|
+
/**/
|
|
1224
1363
|
/*/
|
|
1225
1364
|
{
|
|
1226
1365
|
modelTitle: 'dall-e-3',
|
|
@@ -1741,7 +1880,6 @@
|
|
|
1741
1880
|
const modelName = prompt.modelRequirements.modelName || this.options.deploymentName;
|
|
1742
1881
|
const modelSettings = {
|
|
1743
1882
|
maxTokens: modelRequirements.maxTokens,
|
|
1744
|
-
// <- TODO: [🌾] Make some global max cap for maxTokens
|
|
1745
1883
|
temperature: modelRequirements.temperature,
|
|
1746
1884
|
user: (_a = this.options.userId) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
1747
1885
|
// <- TODO: [🈁] Use `seed` here AND/OR use is `isDeterministic` for entire execution tools
|
|
@@ -1847,8 +1985,7 @@
|
|
|
1847
1985
|
try {
|
|
1848
1986
|
const modelName = prompt.modelRequirements.modelName || this.options.deploymentName;
|
|
1849
1987
|
const modelSettings = {
|
|
1850
|
-
maxTokens: modelRequirements.maxTokens
|
|
1851
|
-
// <- TODO: [🌾] Make some global max cap for maxTokens
|
|
1988
|
+
maxTokens: modelRequirements.maxTokens,
|
|
1852
1989
|
temperature: modelRequirements.temperature,
|
|
1853
1990
|
user: (_a = this.options.userId) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
1854
1991
|
// <- TODO: [🈁] Use `seed` here AND/OR use is `isDeterministic` for entire execution tools
|