Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@promptbook/azure-openai

Package Overview
Dependencies
Maintainers
0
Versions
262
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@promptbook/azure-openai - npm Package Compare versions

Comparing version 0.71.0-18 to 0.71.0-19

esm/typings/src/types/IntermediateFilesStrategy.d.ts

40

esm/typings/src/_packages/core.index.d.ts

@@ -10,10 +10,11 @@ import { PROMPTBOOK_VERSION } from '../version';

import { CLAIM } from '../config';
import { MAX_PARALLEL_COUNT } from '../config';
import { MAX_EXECUTION_ATTEMPTS } from '../config';
import { MAX_FILENAME_LENGTH } from '../config';
import { MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH } from '../config';
import { MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL } from '../config';
import { EXECUTIONS_CACHE_DIRNAME } from '../config';
import { SCRAPE_CACHE_DIRNAME } from '../config';
import { PIPELINE_COLLECTION_BASE_FILENAME } from '../config';
import { DEFAULT_INTERMEDIATE_FILES_STRATEGY } from '../config';
import { DEFAULT_MAX_PARALLEL_COUNT } from '../config';
import { DEFAULT_MAX_EXECUTION_ATTEMPTS } from '../config';
import { DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH } from '../config';
import { DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL } from '../config';
import { DEFAULT_EXECUTIONS_CACHE_DIRNAME } from '../config';
import { DEFAULT_SCRAPE_CACHE_DIRNAME } from '../config';
import { DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME } from '../config';
import { RESERVED_PARAMETER_NAMES } from '../config';

@@ -23,4 +24,4 @@ import { DEFAULT_REMOTE_URL } from '../config';

import { DEFAULT_CSV_SETTINGS } from '../config';
import { IS_VERBOSE } from '../config';
import { IS_AUTO_INSTALLED } from '../config';
import { DEFAULT_IS_VERBOSE } from '../config';
import { DEFAULT_IS_AUTO_INSTALLED } from '../config';
import { pipelineJsonToString } from '../conversion/pipelineJsonToString';

@@ -80,2 +81,3 @@ import { pipelineStringToJson } from '../conversion/pipelineStringToJson';

import { $scrapersRegister } from '../scrapers/_common/register/$scrapersRegister';
import { makeKnowledgeSourceHandler } from '../scrapers/_common/utils/makeKnowledgeSourceHandler';
import { _LegacyDocumentScraperMetadataRegistration } from '../scrapers/document-legacy/register-metadata';

@@ -102,10 +104,11 @@ import { _DocumentScraperMetadataRegistration } from '../scrapers/document/register-metadata';

export { CLAIM };
export { MAX_PARALLEL_COUNT };
export { MAX_EXECUTION_ATTEMPTS };
export { MAX_FILENAME_LENGTH };
export { MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH };
export { MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL };
export { EXECUTIONS_CACHE_DIRNAME };
export { SCRAPE_CACHE_DIRNAME };
export { PIPELINE_COLLECTION_BASE_FILENAME };
export { DEFAULT_INTERMEDIATE_FILES_STRATEGY };
export { DEFAULT_MAX_PARALLEL_COUNT };
export { DEFAULT_MAX_EXECUTION_ATTEMPTS };
export { DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH };
export { DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL };
export { DEFAULT_EXECUTIONS_CACHE_DIRNAME };
export { DEFAULT_SCRAPE_CACHE_DIRNAME };
export { DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME };
export { RESERVED_PARAMETER_NAMES };

@@ -115,4 +118,4 @@ export { DEFAULT_REMOTE_URL };

export { DEFAULT_CSV_SETTINGS };
export { IS_VERBOSE };
export { IS_AUTO_INSTALLED };
export { DEFAULT_IS_VERBOSE };
export { DEFAULT_IS_AUTO_INSTALLED };
export { pipelineJsonToString };

@@ -172,2 +175,3 @@ export { pipelineStringToJson };

export { $scrapersRegister };
export { makeKnowledgeSourceHandler };
export { _LegacyDocumentScraperMetadataRegistration };

@@ -174,0 +178,0 @@ export { _DocumentScraperMetadataRegistration };

@@ -20,3 +20,2 @@ import type { PipelineCollection } from '../collection/PipelineCollection';

import type { CreatePipelineExecutorOptions } from '../execution/createPipelineExecutor/00-CreatePipelineExecutorOptions';
import type { CreatePipelineExecutorSettings } from '../execution/createPipelineExecutor/00-CreatePipelineExecutorSettings';
import type { EmbeddingVector } from '../execution/EmbeddingVector';

@@ -84,2 +83,3 @@ import type { Executables } from '../execution/Executables';

import type { ExecutionReportStringOptions } from '../types/execution-report/ExecutionReportStringOptions';
import type { IntermediateFilesStrategy } from '../types/IntermediateFilesStrategy';
import type { ModelRequirements } from '../types/ModelRequirements';

@@ -262,3 +262,2 @@ import type { CompletionModelRequirements } from '../types/ModelRequirements';

export type { CreatePipelineExecutorOptions };
export type { CreatePipelineExecutorSettings };
export type { EmbeddingVector };

@@ -326,2 +325,3 @@ export type { Executables };

export type { ExecutionReportStringOptions };
export type { IntermediateFilesStrategy };
export type { ModelRequirements };

@@ -328,0 +328,0 @@ export type { CompletionModelRequirements };

@@ -10,5 +10,5 @@ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';

*/
export declare function collectionToJson(collection: PipelineCollection): Promise<Array<PipelineJson>>;
export declare function collectionToJson(collection: PipelineCollection): Promise<ReadonlyArray<PipelineJson>>;
/**
* TODO: [🧠] Maybe clear `sourceFile` or clear when exposing through API or remote server
*/

@@ -13,2 +13,2 @@ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';

*/
export declare function createCollectionFromJson(...promptbooks: Array<PipelineJson>): PipelineCollection;
export declare function createCollectionFromJson(...promptbooks: ReadonlyArray<PipelineJson>): PipelineCollection;

@@ -23,2 +23,2 @@ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';

*/
export declare function createCollectionFromPromise(promptbookSourcesPromiseOrFactory: Promise<Array<PipelineJson>> | (() => Promise<Array<PipelineJson>>)): PipelineCollection;
export declare function createCollectionFromPromise(promptbookSourcesPromiseOrFactory: Promise<ReadonlyArray<PipelineJson>> | (() => Promise<ReadonlyArray<PipelineJson>>)): PipelineCollection;

@@ -14,3 +14,3 @@ import type { Promisable } from 'type-fest';

*/
listPipelines(): Promisable<Array<string_pipeline_url>>;
listPipelines(): Promisable<ReadonlyArray<string_pipeline_url>>;
/**

@@ -17,0 +17,0 @@ * Gets pipeline by its URL

@@ -22,7 +22,7 @@ import type { PipelineJson } from '../types/PipelineJson/PipelineJson';

*/
constructor(...pipelines: Array<PipelineJson>);
constructor(...pipelines: ReadonlyArray<PipelineJson>);
/**
* Gets all pipelines in the collection
*/
listPipelines(): Array<string_pipeline_url>;
listPipelines(): ReadonlyArray<string_pipeline_url>;
/**

@@ -29,0 +29,0 @@ * Gets pipeline by its URL

@@ -43,7 +43,7 @@ import type { WritableDeep } from 'type-fest';

*/
readonly aliasNames?: Array<string_name & string_SCREAMING_CASE>;
readonly aliasNames?: ReadonlyArray<string_name & string_SCREAMING_CASE>;
/**
* @@@
*/
readonly deprecatedNames?: Array<string_name & string_SCREAMING_CASE>;
readonly deprecatedNames?: ReadonlyArray<string_name & string_SCREAMING_CASE>;
/**

@@ -60,3 +60,3 @@ * @@@

*/
readonly examples: Array<string_markdown_text>;
readonly examples: ReadonlyArray<string_markdown_text>;
/**

@@ -100,3 +100,3 @@ * @throws {ParseError} if the parsing fails

*/
takeFromPipelineJson(pipelineJson: PipelineJson): Array<TCommand>;
takeFromPipelineJson(pipelineJson: PipelineJson): ReadonlyArray<TCommand>;
};

@@ -126,3 +126,3 @@ /**

*/
takeFromTemplateJson($templateJson: $TemplateJson): Array<TCommand>;
takeFromTemplateJson($templateJson: $TemplateJson): ReadonlyArray<TCommand>;
};

@@ -129,0 +129,0 @@ /**

import type { CsvSettings } from './formats/csv/CsvSettings';
import type { IntermediateFilesStrategy } from './types/IntermediateFilesStrategy';
/**

@@ -15,3 +16,3 @@ * Warning message for the generated sections and files files

*/
export declare const CLAIM = "Supercharge LLM models with Promptbook";
export declare const CLAIM = "Build responsible, controlled and transparent applications on top of LLM models!";
/**

@@ -54,20 +55,26 @@ * Warning message for the generated sections and files files

/**
* The maximum number of (LLM) tasks running in parallel
* The maximum length of the (generated) filename
*
* @public exported from `@promptbook/core`
*/
export declare const MAX_PARALLEL_COUNT = 5;
export declare const MAX_FILENAME_LENGTH = 30;
/**
* The maximum number of attempts to execute LLM task before giving up
* Strategy for caching the intermediate results for knowledge sources
*
* @public exported from `@promptbook/core`
*/
export declare const MAX_EXECUTION_ATTEMPTS = 3;
export declare const DEFAULT_INTERMEDIATE_FILES_STRATEGY: IntermediateFilesStrategy;
/**
* The maximum length of the (generated) filename
* The maximum number of (LLM) tasks running in parallel
*
* @public exported from `@promptbook/core`
*/
export declare const MAX_FILENAME_LENGTH = 30;
export declare const DEFAULT_MAX_PARALLEL_COUNT = 5;
/**
* The maximum number of attempts to execute LLM task before giving up
*
* @public exported from `@promptbook/core`
*/
export declare const DEFAULT_MAX_EXECUTION_ATTEMPTS = 3;
/**
* @@@

@@ -78,3 +85,3 @@ * TODO: [🐝][main] !!! Use

*/
export declare const MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH = 3;
export declare const DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH = 3;
/**

@@ -86,3 +93,3 @@ * @@@

*/
export declare const MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL = 200;
export declare const DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL = 200;
/**

@@ -95,3 +102,3 @@ * Where to store the cache of executions for promptbook CLI

*/
export declare const EXECUTIONS_CACHE_DIRNAME = "/.promptbook/executions-cache";
export declare const DEFAULT_EXECUTIONS_CACHE_DIRNAME = "/.promptbook/executions-cache";
/**

@@ -104,3 +111,3 @@ * Where to store the scrape cache

*/
export declare const SCRAPE_CACHE_DIRNAME = "/.promptbook/scrape-cache";
export declare const DEFAULT_SCRAPE_CACHE_DIRNAME = "/.promptbook/scrape-cache";
/**

@@ -111,3 +118,3 @@ * The name of the builded pipeline collection made by CLI `ptbk make` and for lookup in `createCollectionFromDirectory`

*/
export declare const PIPELINE_COLLECTION_BASE_FILENAME = "index";
export declare const DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME = "index";
/**

@@ -169,3 +176,3 @@ * Nonce which is used for replacing things in strings

*/
export declare const IS_VERBOSE = false;
export declare const DEFAULT_IS_VERBOSE = false;
/**

@@ -176,3 +183,3 @@ * @@@

*/
export declare const IS_AUTO_INSTALLED = false;
export declare const DEFAULT_IS_AUTO_INSTALLED = false;
/**

@@ -179,0 +186,0 @@ * @@@

@@ -11,3 +11,4 @@ import type { PipelineExecutor } from './PipelineExecutor';

/**
* TODO: [🐚] This function should be removed OR changed OR be completely rewritten
* TODO: [🧠] Can this return type be better typed than void
*/

@@ -0,8 +1,9 @@

import type { CsvSettings } from '../../formats/csv/CsvSettings';
import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
import type { ExecutionTools } from '../ExecutionTools';
import type { CreatePipelineExecutorSettings } from './00-CreatePipelineExecutorSettings';
/**
* Options for `createPipelineExecutor`
*/
export type CreatePipelineExecutorOptions = {
export type CreatePipelineExecutorOptions = PrepareAndScrapeOptions & {
/**

@@ -17,8 +18,30 @@ * The pipeline to be executed

/**
* Optional settings for the pipeline executor
* When executor does not satisfy expectations it will be retried this amount of times
*
* @default MAX_EXECUTION_ATTEMPTS
*/
readonly settings?: Partial<CreatePipelineExecutorSettings>;
readonly maxExecutionAttempts?: number;
/**
* Settings for CSV format
*
* @default DEFAULT_CSV_SETTINGS
*/
readonly csvSettings?: CsvSettings;
/**
* If you pass fully prepared pipeline, this does not matter
*
* Otherwise:
* If false or not set, warning is shown when pipeline is not prepared
* If true, warning is suppressed
*
* @default false
*/
readonly isNotPreparedWarningSupressed?: boolean;
};
/**
* TODO: !!!!!! Unite `CreatePipelineExecutorOptions` and `CreatePipelineExecutorSettings` OR describe the difference
*/
* TODO: [🧎][🧠] Move `csvSettings` to some better place
* 1) either to some dependency in `ExecutionTools`
* 2) or make here container for multiple formats
* 3) or make the setting more universal and which just sets things like `delimiter` and `quote` without specifying the format
* TODO: [🤹‍♂️] More granular setting for limits of execution + better waiting for queue
*/

@@ -5,5 +5,4 @@ import type { Promisable, ReadonlyDeep } from 'type-fest';

import type { Parameters } from '../../types/typeAliases';
import type { ExecutionTools } from '../ExecutionTools';
import type { PipelineExecutorResult } from '../PipelineExecutorResult';
import type { CreatePipelineExecutorSettings } from './00-CreatePipelineExecutorSettings';
import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorOptions';
/**

@@ -14,3 +13,3 @@ * @@@

*/
type ExecutePipelineOptions = {
type ExecutePipelineOptions = CreatePipelineExecutorOptions & {
/**

@@ -23,6 +22,2 @@ * @@@

*/
readonly tools: ExecutionTools;
/**
* @@@
*/
onProgress?(taskProgress: TaskProgress): Promisable<void>;

@@ -45,6 +40,2 @@ /**

readonly pipelineIdentification: string;
/**
* Settings for the pipeline executor
*/
readonly settings: CreatePipelineExecutorSettings;
};

@@ -51,0 +42,0 @@ /**

@@ -1,2 +0,2 @@

import { Promisable, ReadonlyDeep } from 'type-fest';
import type { Promisable, ReadonlyDeep, WritableDeep } from 'type-fest';
import type { ExecutionReportJson } from '../../types/execution-report/ExecutionReportJson';

@@ -7,4 +7,3 @@ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';

import type { Parameters } from '../../types/typeAliases';
import type { ExecutionTools } from '../ExecutionTools';
import type { CreatePipelineExecutorSettings } from './00-CreatePipelineExecutorSettings';
import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorOptions';
/**

@@ -15,3 +14,3 @@ * @@@

*/
type executeSingleTemplateOptions = {
type executeSingleTemplateOptions = CreatePipelineExecutorOptions & {
/**

@@ -32,15 +31,7 @@ * @@@

*/
readonly tools: ExecutionTools;
/**
* @@@
*/
readonly onProgress: (taskProgress: TaskProgress) => Promisable<void>;
/**
* Settings for the pipeline executor
*/
readonly settings: CreatePipelineExecutorSettings;
/**
* @@@
*/
readonly $executionReport: ExecutionReportJson;
readonly $executionReport: WritableDeep<ExecutionReportJson>;
/**

@@ -47,0 +38,0 @@ * @@@

@@ -1,2 +0,2 @@

import type { ReadonlyDeep } from 'type-fest';
import type { ReadonlyDeep, WritableDeep } from 'type-fest';
import type { ExecutionReportJson } from '../../types/execution-report/ExecutionReportJson';

@@ -8,4 +8,3 @@ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';

import type { TODO_string } from '../../utils/organization/TODO_string';
import type { ExecutionTools } from '../ExecutionTools';
import type { CreatePipelineExecutorSettings } from './00-CreatePipelineExecutorSettings';
import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorOptions';
/**

@@ -16,7 +15,7 @@ * @@@

*/
export type ExecuteAttemptsOptions = {
export type ExecuteAttemptsOptions = Omit<CreatePipelineExecutorOptions, 'pipeline'> & {
/**
* @@@
*/
readonly jokerParameterNames: Readonly<Array<string_parameter_name>>;
readonly jokerParameterNames: Readonly<ReadonlyArray<string_parameter_name>>;
/**

@@ -28,2 +27,6 @@ * @@@

* @@@
*
* Note: [💂] There are two distinct variabiles
* 1) `maxExecutionAttempts` - the amount of attempts LLM model
* 2) `maxAttempts` - the amount of attempts for any template - LLM, SCRIPT, DIALOG, etc.
*/

@@ -50,14 +53,6 @@ readonly maxAttempts: number;

*/
readonly tools: ExecutionTools;
readonly $executionReport: WritableDeep<ExecutionReportJson>;
/**
* Settings for the pipeline executor
*/
readonly settings: CreatePipelineExecutorSettings;
/**
* @@@
*/
readonly $executionReport: ExecutionReportJson;
/**
* @@@
*/
readonly pipelineIdentification: string;

@@ -64,0 +59,0 @@ };

/**
* Represents a vector in an latent space of the embedding model
*/
export type EmbeddingVector = Array<number>;
export type EmbeddingVector = ReadonlyArray<number>;
/**

@@ -6,0 +6,0 @@ * TODO: Figure out how to use NPM package xyzt

@@ -40,3 +40,3 @@ import type { Promisable } from 'type-fest';

*/
listModels(): Promisable<Array<AvailableModel>>;
listModels(): Promisable<ReadonlyArray<AvailableModel>>;
/**

@@ -43,0 +43,0 @@ * Calls a chat model

@@ -30,7 +30,7 @@ import { ReadonlyDeep } from 'type-fest';

*/
readonly errors: ReadonlyDeep<Array<ErrorJson>>;
readonly errors: ReadonlyDeep<ReadonlyArray<ErrorJson>>;
/**
* Warnings that occured during the execution, details are aviable in `executionReport`
*/
readonly warnings: ReadonlyDeep<Array<ErrorJson>>;
readonly warnings: ReadonlyDeep<ReadonlyArray<ErrorJson>>;
/**

@@ -37,0 +37,0 @@ * The report of the execution with all details

@@ -65,2 +65,2 @@ import type { PromptResultUsage } from '../PromptResultUsage';

*/
export declare function addUsage(...usageItems: Array<PromptResultUsage>): PromptResultUsage;
export declare function addUsage(...usageItems: ReadonlyArray<PromptResultUsage>): PromptResultUsage;

@@ -19,3 +19,3 @@ import type { Promisable } from 'type-fest';

*/
export declare function forEachAsync<TItem>(array: Array<TItem>, options: ForEachAsyncOptions, callbackfunction: (value: TItem, index: number, array: Array<TItem>) => Promisable<void>): Promise<void>;
export declare function forEachAsync<TItem>(array: ReadonlyArray<TItem>, options: ForEachAsyncOptions, callbackfunction: (value: TItem, index: number, array: ReadonlyArray<TItem>) => Promisable<void>): Promise<void>;
export {};

@@ -24,3 +24,3 @@ import type { string_mime_type } from '../../types/typeAliases';

*/
readonly aliases?: Array<string_name & string_SCREAMING_CASE>;
readonly aliases?: ReadonlyArray<string_name & string_SCREAMING_CASE>;
/**

@@ -62,3 +62,3 @@ * The mime type of the format (if any)

*/
readonly subvalueDefinitions: Array<FormatSubvalueDefinition<TValue, TSettings>>;
readonly subvalueDefinitions: ReadonlyArray<FormatSubvalueDefinition<TValue, TSettings>>;
};

@@ -65,0 +65,0 @@ /**

import type { Promisable } from 'type-fest';
import type { Parameters } from '../../types/typeAliases';
import type { string_name } from '../../types/typeAliases';
import type { string_parameter_name } from '../../types/typeAliases';
import type { string_name } from '../../types/typeAliases';
import type { string_SCREAMING_CASE } from '../../utils/normalization/normalizeTo_SCREAMING_CASE';

@@ -20,3 +20,3 @@ import type { empty_object } from '../../utils/organization/empty_object';

*/
readonly aliases?: Array<string_name & string_SCREAMING_CASE>;
readonly aliases?: ReadonlyArray<string_name & string_SCREAMING_CASE>;
/**

@@ -23,0 +23,0 @@ * Maps values

@@ -1,2 +0,2 @@

import type { PrepareAndScrapeOptions } from '../../../prepare/PrepareAndScrapeOptions';
import type { CacheLlmToolsOptions } from '../utils/cache/CacheLlmToolsOptions';
import type { LlmExecutionToolsWithTotalUsage } from '../utils/count-total-usage/LlmExecutionToolsWithTotalUsage';

@@ -8,3 +8,3 @@ /**

*/
export declare function $provideLlmToolsForCli(options?: Pick<PrepareAndScrapeOptions, 'isCacheCleaned'>): LlmExecutionToolsWithTotalUsage;
export declare function $provideLlmToolsForCli(options?: Pick<CacheLlmToolsOptions, 'isCacheReloaded'>): LlmExecutionToolsWithTotalUsage;
/**

@@ -11,0 +11,0 @@ * Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`

@@ -9,3 +9,3 @@ import type { string_title } from '../../../types/typeAliases';

*/
export type LlmToolsConfiguration = Array<Registered & {
export type LlmToolsConfiguration = ReadonlyArray<Registered & {
/**

@@ -12,0 +12,0 @@ * @@@

import type { PromptbookStorage } from '../../../../storage/_common/PromptbookStorage';
import type { CacheItem } from './CacheItem';
/**
* @@@
*/
export type CacheLlmToolsOptions = {

@@ -15,3 +18,3 @@ /**

*/
isReloaded?: boolean;
isCacheReloaded?: boolean;
};

@@ -11,3 +11,3 @@ import type { AvailableModel } from '../../execution/AvailableModel';

*/
export declare const ANTHROPIC_CLAUDE_MODELS: Array<AvailableModel & {
export declare const ANTHROPIC_CLAUDE_MODELS: ReadonlyArray<AvailableModel & {
pricing?: {

@@ -14,0 +14,0 @@ readonly prompt: number_usd;

@@ -38,3 +38,3 @@ import Anthropic from '@anthropic-ai/sdk';

*/
listModels(): Array<AvailableModel>;
listModels(): ReadonlyArray<AvailableModel>;
/**

@@ -41,0 +41,0 @@ * Calls Anthropic Claude API to use a chat model.

@@ -38,3 +38,3 @@ import { OpenAIClient } from '@azure/openai';

*/
listModels(): Promise<Array<AvailableModel>>;
listModels(): Promise<ReadonlyArray<AvailableModel>>;
/**

@@ -41,0 +41,0 @@ * Calls OpenAI API to use a chat model.

@@ -12,5 +12,5 @@ import type { Expectations } from '../../types/PipelineJson/Expectations';

*/
export declare function $fakeTextToExpectations(expectations: Expectations, postprocessingFunctionNames?: Array<string_postprocessing_function_name>): Promise<string>;
export declare function $fakeTextToExpectations(expectations: Expectations, postprocessingFunctionNames?: ReadonlyArray<string_postprocessing_function_name>): Promise<string>;
/**
* TODO: [💝] Unite object for expecting amount and format - use here also a format
*/

@@ -27,3 +27,3 @@ import type { AvailableModel } from '../../execution/AvailableModel';

*/
listModels(): Array<AvailableModel>;
listModels(): ReadonlyArray<AvailableModel>;
/**

@@ -30,0 +30,0 @@ * Mocks chat model

@@ -28,3 +28,3 @@ import type { AvailableModel } from '../../execution/AvailableModel';

*/
listModels(): Array<AvailableModel>;
listModels(): ReadonlyArray<AvailableModel>;
/**

@@ -31,0 +31,0 @@ * Fakes chat model

@@ -18,5 +18,5 @@ import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';

*/
export declare function joinLlmExecutionTools(...llmExecutionTools: Array<LlmExecutionTools>): MultipleLlmExecutionTools;
export declare function joinLlmExecutionTools(...llmExecutionTools: ReadonlyArray<LlmExecutionTools>): MultipleLlmExecutionTools;
/**
* TODO: [👷‍♂️] @@@ Manual about construction of llmTools
*/

@@ -24,7 +24,7 @@ import type { AvailableModel } from '../../execution/AvailableModel';

*/
readonly llmExecutionTools: Array<LlmExecutionTools>;
readonly llmExecutionTools: ReadonlyArray<LlmExecutionTools>;
/**
* Gets array of execution tools in order of priority
*/
constructor(...llmExecutionTools: Array<LlmExecutionTools>);
constructor(...llmExecutionTools: ReadonlyArray<LlmExecutionTools>);
get title(): string_title & string_markdown_text;

@@ -40,3 +40,3 @@ get description(): string_markdown;

*/
listModels(): Promise<Array<AvailableModel>>;
listModels(): Promise<ReadonlyArray<AvailableModel>>;
/**

@@ -43,0 +43,0 @@ * Calls the best available chat model

@@ -12,3 +12,3 @@ import type { AvailableModel } from '../../execution/AvailableModel';

*/
export declare const OPENAI_MODELS: Array<AvailableModel & {
export declare const OPENAI_MODELS: ReadonlyArray<AvailableModel & {
pricing?: {

@@ -15,0 +15,0 @@ readonly prompt: number_usd;

@@ -39,3 +39,3 @@ import OpenAI from 'openai';

*/
listModels(): Array<AvailableModel>;
listModels(): ReadonlyArray<AvailableModel>;
/**

@@ -42,0 +42,0 @@ * Calls OpenAI API to use a chat model.

@@ -11,3 +11,3 @@ import type { AvailableModel } from '../../../execution/AvailableModel';

*/
readonly models: Array<AvailableModel>;
readonly models: ReadonlyArray<AvailableModel>;
};

@@ -14,0 +14,0 @@ /**

@@ -34,3 +34,3 @@ import type { AvailableModel } from '../../execution/AvailableModel';

*/
listModels(): Promise<Array<AvailableModel>>;
listModels(): Promise<ReadonlyArray<AvailableModel>>;
/**

@@ -37,0 +37,0 @@ * Creates a connection to the remote proxy server.

@@ -0,1 +1,2 @@

import type { IntermediateFilesStrategy } from '../types/IntermediateFilesStrategy';
import type { string_dirname } from '../types/typeAliases';

@@ -24,8 +25,7 @@ /**

/**
* If true, the cache is cleaned after the scraping
* Strategy for caching the intermediate results for knowledge source
*
*
* @default false // <- TODO: !!!!!! Change to `cacheStrategy`/`intermediateFiles`, Put to global config, change to `true` and explicitly set to `false` in all playgrounds
* @default DEFAULT_INTERMEDIATE_FILES_STRATEGY
*/
readonly isCacheCleaned?: boolean;
readonly intermediateFilesStrategy?: IntermediateFilesStrategy;
/**

@@ -32,0 +32,0 @@ * Maximum number of tasks running in parallel

@@ -15,3 +15,3 @@ import type { ExecutionTools } from '../execution/ExecutionTools';

*/
readonly templatesPrepared: Array<TemplateJson>;
readonly templatesPrepared: ReadonlyArray<TemplateJson>;
};

@@ -18,0 +18,0 @@ /**

@@ -11,3 +11,3 @@ import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';

*/
export declare function prepareKnowledgePieces(knowledgeSources: Array<KnowledgeSourceJson>, tools: Pick<ExecutionTools, 'llm' | 'fs' | 'scrapers'>, options: PrepareAndScrapeOptions): Promise<Array<Omit<KnowledgePiecePreparedJson, 'preparationIds'>>>;
export declare function prepareKnowledgePieces(knowledgeSources: ReadonlyArray<KnowledgeSourceJson>, tools: Pick<ExecutionTools, 'llm' | 'fs' | 'scrapers'>, options: PrepareAndScrapeOptions): Promise<ReadonlyArray<Omit<KnowledgePiecePreparedJson, 'preparationIds'>>>;
/**

@@ -14,0 +14,0 @@ * TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time

@@ -12,2 +12,2 @@ import type { ExecutionTools } from '../../../execution/ExecutionTools';

*/
export declare function $provideScrapersForBrowser(tools: Pick<ExecutionTools, 'llm'>, options?: PrepareAndScrapeOptions): Promise<Array<Scraper>>;
export declare function $provideScrapersForBrowser(tools: Pick<ExecutionTools, 'llm'>, options?: PrepareAndScrapeOptions): Promise<ReadonlyArray<Scraper>>;

@@ -12,5 +12,5 @@ import type { ExecutionTools } from '../../../execution/ExecutionTools';

*/
export declare function $provideScrapersForNode(tools: Pick<ExecutionTools, 'fs' | 'llm' | 'executables'>, options?: PrepareAndScrapeOptions): Promise<Array<Scraper>>;
export declare function $provideScrapersForNode(tools: Pick<ExecutionTools, 'fs' | 'llm' | 'executables'>, options?: PrepareAndScrapeOptions): Promise<ReadonlyArray<Scraper>>;
/**
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
*/

@@ -0,1 +1,2 @@

import type { Executables } from '../../../execution/Executables';
import type { string_mime_type } from '../../../types/typeAliases';

@@ -5,3 +6,2 @@ import type { string_promptbook_documentation_url } from '../../../types/typeAliases';

import type { Registered } from '../../../utils/$Register';
import type { TODO_any } from '../../../utils/organization/TODO_any';
/**

@@ -37,3 +37,3 @@ * @@@

*/
readonly requiredExecutables: TODO_any;
readonly requiredExecutables: ReadonlyArray<Capitalize<keyof Executables extends `${infer N}Path` ? N : never>>;
/**

@@ -40,0 +40,0 @@ * Link to documentation

@@ -20,3 +20,3 @@ import type { Promisable } from 'type-fest';

*/
scrape(source: ScraperSourceHandler): Promisable<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
scrape(source: ScraperSourceHandler): Promisable<ReadonlyArray<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
};

@@ -23,0 +23,0 @@ /**

@@ -16,3 +16,3 @@ import type { PrepareAndScrapeOptions } from '../../../prepare/PrepareAndScrapeOptions';

*/
type GetScraperIntermediateSourceHandler = Required<Pick<PrepareAndScrapeOptions, 'rootDirname' | 'cacheDirname' | 'isCacheCleaned' | 'isVerbose'>> & {
type GetScraperIntermediateSourceHandler = Required<Pick<PrepareAndScrapeOptions, 'rootDirname' | 'cacheDirname' | 'intermediateFilesStrategy' | 'isVerbose'>> & {
readonly extension: string_file_extension;

@@ -32,5 +32,5 @@ };

* 1) Need to store more than serialized JSONs
* 2) Need to switch between a `rootDirname` and `cacheDirname` <- TODO: !!!!
* 2) Need to switch between a `rootDirname` and `cacheDirname` <- TODO: [😡]
* TODO: [🐱‍🐉][🧠] Make some smart crop
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
*/

@@ -9,4 +9,4 @@ import type { SetOptional } from 'type-fest';

*
* @private for scraper utilities
* @public exported from `@promptbook/core`
*/
export declare function makeKnowledgeSourceHandler(knowledgeSource: SetOptional<KnowledgeSourceJson, 'name'>, tools: Pick<ExecutionTools, 'fs'>, options?: Pick<PrepareAndScrapeOptions, 'rootDirname' | 'isVerbose'>): Promise<ScraperSourceHandler>;

@@ -16,3 +16,3 @@ import type { ExecutionTools } from '../../execution/ExecutionTools';

isAvilableInBrowser: false;
requiredExecutables: string[];
requiredExecutables: ("Pandoc" | "LibreOffice")[];
}>;

@@ -19,0 +19,0 @@ /**

@@ -36,3 +36,3 @@ import type { KnowledgePiecePreparedJson } from '../../types/PipelineJson/KnowledgePieceJson';

*/
scrape(source: ScraperSourceHandler): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
scrape(source: ScraperSourceHandler): Promise<ReadonlyArray<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
}

@@ -39,0 +39,0 @@ /**

@@ -14,3 +14,3 @@ import type { Registration } from '../../utils/$Register';

isAvilableInBrowser: false;
requiredExecutables: string[];
requiredExecutables: ("Pandoc" | "LibreOffice")[];
}>;

@@ -17,0 +17,0 @@ /**

@@ -16,3 +16,3 @@ import type { ExecutionTools } from '../../execution/ExecutionTools';

isAvilableInBrowser: false;
requiredExecutables: string[];
requiredExecutables: "Pandoc"[];
}>;

@@ -19,0 +19,0 @@ /**

@@ -36,3 +36,3 @@ import type { KnowledgePiecePreparedJson } from '../../types/PipelineJson/KnowledgePieceJson';

*/
scrape(source: ScraperSourceHandler): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
scrape(source: ScraperSourceHandler): Promise<ReadonlyArray<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
}

@@ -39,0 +39,0 @@ /**

@@ -14,3 +14,3 @@ import type { Registration } from '../../utils/$Register';

isAvilableInBrowser: false;
requiredExecutables: string[];
requiredExecutables: "Pandoc"[];
}>;

@@ -17,0 +17,0 @@ /**

@@ -16,3 +16,3 @@ import type { ExecutionTools } from '../../execution/ExecutionTools';

isAvilableInBrowser: true;
requiredExecutables: string[];
requiredExecutables: never[];
}>;

@@ -19,0 +19,0 @@ /**

@@ -24,3 +24,3 @@ import type { KnowledgePiecePreparedJson } from '../../types/PipelineJson/KnowledgePieceJson';

*/
scrape(source: ScraperSourceHandler): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
scrape(source: ScraperSourceHandler): Promise<ReadonlyArray<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
}

@@ -27,0 +27,0 @@ /**

@@ -14,3 +14,3 @@ import type { Registration } from '../../utils/$Register';

isAvilableInBrowser: true;
requiredExecutables: string[];
requiredExecutables: never[];
}>;

@@ -17,0 +17,0 @@ /**

@@ -16,3 +16,3 @@ import type { ExecutionTools } from '../../execution/ExecutionTools';

isAvilableInBrowser: true;
requiredExecutables: string[];
requiredExecutables: never[];
}>;

@@ -19,0 +19,0 @@ /**

@@ -34,3 +34,3 @@ import type { KnowledgePiecePreparedJson } from '../../types/PipelineJson/KnowledgePieceJson';

*/
scrape(source: ScraperSourceHandler): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
scrape(source: ScraperSourceHandler): Promise<ReadonlyArray<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
}

@@ -37,0 +37,0 @@ /**

@@ -14,3 +14,3 @@ import type { Registration } from '../../utils/$Register';

isAvilableInBrowser: true;
requiredExecutables: string[];
requiredExecutables: never[];
}>;

@@ -17,0 +17,0 @@ /**

@@ -16,3 +16,3 @@ import type { ExecutionTools } from '../../execution/ExecutionTools';

isAvilableInBrowser: false;
requiredExecutables: string[];
requiredExecutables: never[];
}>;

@@ -19,0 +19,0 @@ /**

@@ -14,3 +14,3 @@ import type { Registration } from '../../utils/$Register';

isAvilableInBrowser: false;
requiredExecutables: string[];
requiredExecutables: never[];
}>;

@@ -17,0 +17,0 @@ /**

@@ -43,3 +43,3 @@ import type { KnowledgePiecePreparedJson } from '../../types/PipelineJson/KnowledgePieceJson';

*/
scrape(source: ScraperSourceHandler): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
scrape(source: ScraperSourceHandler): Promise<ReadonlyArray<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
}

@@ -46,0 +46,0 @@ /**

@@ -10,5 +10,5 @@ import type { really_any } from '../../../utils/organization/really_any';

*/
export declare function preserve(func: (...params: Array<really_any>) => unknown): void;
export declare function preserve(func: (...params: ReadonlyArray<really_any>) => unknown): void;
/**
* TODO: !! [1] This maybe does memory leak
*/

@@ -7,2 +7,2 @@ import type { string_name } from '../../../types/typeAliases';

*/
export declare function nameToSubfolderPath(name: string_name): Array<string>;
export declare function nameToSubfolderPath(name: string_name): ReadonlyArray<string>;

@@ -10,2 +10,2 @@ /**

*/
export type Arrayable<TItem> = TItem | Array<TItem> | undefined;
export type Arrayable<TItem> = TItem | ReadonlyArray<TItem> | undefined;

@@ -40,3 +40,3 @@ import type { string_markdown_text } from '../typeAliases';

*/
readonly promptExecutions: Array<ExecutionPromptReportJson>;
readonly promptExecutions: ReadonlyArray<ExecutionPromptReportJson>;
};

@@ -34,3 +34,3 @@ import type { EmbeddingVector } from '../../execution/EmbeddingVector';

*/
readonly sources: Array<{
readonly sources: ReadonlyArray<{
/**

@@ -52,7 +52,7 @@ * Identifier of the source

*/
readonly keywords: Array<string_keyword>;
readonly keywords: ReadonlyArray<string_keyword>;
/**
* List of models embeddings that are associated with the knowledge piece
*/
readonly index: Array<{
readonly index: ReadonlyArray<{
/**

@@ -70,3 +70,3 @@ * Model name which generated the embedding

*/
readonly preparationIds: Array<number_id>;
readonly preparationIds: ReadonlyArray<number_id>;
};

@@ -73,0 +73,0 @@ /**

@@ -40,3 +40,3 @@ import type { number_id } from '../typeAliases';

*/
readonly preparationIds: Array<number_id>;
readonly preparationIds: ReadonlyArray<number_id>;
};

@@ -43,0 +43,0 @@ /**

@@ -41,3 +41,3 @@ import type { ChatModelRequirements } from '../ModelRequirements';

*/
readonly preparationIds: Array<number_id>;
readonly preparationIds: ReadonlyArray<number_id>;
};

@@ -44,0 +44,0 @@ /**

@@ -80,3 +80,3 @@ import type { FormatCommand } from '../commands/FORMAT/FormatCommand';

*/
readonly postprocessingFunctionNames?: Array<string_postprocessing_function_name>;
readonly postprocessingFunctionNames?: ReadonlyArray<string_postprocessing_function_name>;
/**

@@ -83,0 +83,0 @@ * Expectations for the answer

@@ -37,4 +37,4 @@ import { type IDestroyable } from 'destroyable';

constructor(registerName: string_name);
list(): Array<TRegistered>;
list(): ReadonlyArray<TRegistered>;
register(registered: TRegistered): Registration;
}

@@ -11,2 +11,2 @@ import type { Arrayable } from '../types/Arrayable';

*/
export declare function arrayableToArray<TItem>(input?: Arrayable<TItem>): Array<TItem>;
export declare function arrayableToArray<TItem>(input?: Arrayable<TItem>): ReadonlyArray<TItem>;

@@ -11,3 +11,3 @@ import type { string_char_emoji } from '../types/typeAliasEmoji';

*/
export declare const EMOJIS_IN_CATEGORIES: Record<string, Array<string_char_emoji>>;
export declare const EMOJIS_IN_CATEGORIES: Record<string, ReadonlyArray<string_char_emoji>>;
/**

@@ -14,0 +14,0 @@ *

@@ -7,3 +7,3 @@ import type { ExpectationAmount } from '../../types/PipelineJson/Expectations';

*/
export declare function splitIntoSentences(text: string): Array<string>;
export declare function splitIntoSentences(text: string): ReadonlyArray<string>;
/**

@@ -10,0 +10,0 @@ * Counts number of sentences in the text

/**
* Represents items which are compared to each other
*/
export type FromtoItems = Array<{
export type FromtoItems = ReadonlyArray<{
/**

@@ -6,0 +6,0 @@ * The title of the item

@@ -33,5 +33,5 @@ import type { string_markdown } from '../../types/typeAliases';

*/
export declare function extractAllBlocksFromMarkdown(markdown: string_markdown): Array<CodeBlock>;
export declare function extractAllBlocksFromMarkdown(markdown: string_markdown): ReadonlyArray<CodeBlock>;
/**
* TODO: Maybe name for `blockNotation` instead of '```' and '>'
*/

@@ -8,3 +8,3 @@ import type { string_markdown } from '../../types/typeAliases';

*/
export declare function splitMarkdownIntoSections(markdown: string_markdown): Array<string_markdown_section>;
export declare function splitMarkdownIntoSections(markdown: string_markdown): ReadonlyArray<string_markdown_section>;
/**

@@ -11,0 +11,0 @@ * TODO: [🏛] This can be part of markdown builder

@@ -16,2 +16,2 @@ import type { really_any } from './really_any';

*/
export declare function keepUnused<TTypeToKeep1 = really_any, TTypeToKeep2 = really_any, TTypeToKeep3 = really_any>(...valuesToKeep: Array<really_any>): void;
export declare function keepUnused<TTypeToKeep1 = really_any, TTypeToKeep2 = really_any, TTypeToKeep3 = really_any>(...valuesToKeep: ReadonlyArray<really_any>): void;

@@ -12,2 +12,2 @@ import type { really_any } from './really_any';

*/
export declare function TODO_USE(...value: Array<really_any>): void;
export declare function TODO_USE(...value: ReadonlyArray<really_any>): void;

@@ -6,5 +6,5 @@ import type { number_seed } from '../../types/typeAliases';

* Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
* Warning: This function is not cryptographically secure (it uses Math.random internally)
* Warning: This function is NOT cryptographically secure (it uses Math.random internally)
* @public exported from `@promptbook/utils`
*/
export declare function $randomSeed(): number_seed;

@@ -7,2 +7,2 @@ /**

*/
export declare function intersection<TItem>(...sets: Array<Set<TItem>>): Set<TItem>;
export declare function intersection<TItem>(...sets: ReadonlyArray<Set<TItem>>): Set<TItem>;

@@ -7,2 +7,2 @@ /**

*/
export declare function union<TItem>(...sets: Array<Set<TItem>>): Set<TItem>;
export declare function union<TItem>(...sets: ReadonlyArray<Set<TItem>>): Set<TItem>;
{
"name": "@promptbook/azure-openai",
"version": "0.71.0-18",
"version": "0.71.0-19",
"description": "Supercharge your use of large language models",

@@ -55,3 +55,3 @@ "private": false,

"peerDependencies": {
"@promptbook/core": "0.71.0-18"
"@promptbook/core": "0.71.0-19"
},

@@ -58,0 +58,0 @@ "dependencies": {

@@ -24,8 +24,2 @@ <!-- ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten -->

<blockquote style="color: #ff8811">
<b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
</blockquote>
<blockquote style="color: #ff8811">
<b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.

@@ -32,0 +26,0 @@ </blockquote>

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc