@promptbook/pdf
Advanced tools
Comparing version 0.71.0-17 to 0.71.0-18
@@ -68,2 +68,3 @@ import { PROMPTBOOK_VERSION } from '../version'; | ||
import { joinLlmExecutionTools } from '../llm-providers/multiple/joinLlmExecutionTools'; | ||
import { MultipleLlmExecutionTools } from '../llm-providers/multiple/MultipleLlmExecutionTools'; | ||
import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration'; | ||
@@ -157,2 +158,3 @@ import { preparePersona } from '../personas/preparePersona'; | ||
export { joinLlmExecutionTools }; | ||
export { MultipleLlmExecutionTools }; | ||
export { _OpenAiMetadataRegistration }; | ||
@@ -159,0 +161,0 @@ export { preparePersona }; |
@@ -6,2 +6,3 @@ import { PROMPTBOOK_VERSION } from '../version'; | ||
import { $provideLlmToolsFromEnv } from '../llm-providers/_common/register/$provideLlmToolsFromEnv'; | ||
import { $provideExecutablesForNode } from '../scrapers/_common/register/$provideExecutablesForNode'; | ||
import { $provideFilesystemForNode } from '../scrapers/_common/register/$provideFilesystemForNode'; | ||
@@ -17,2 +18,3 @@ import { $provideScrapersForNode } from '../scrapers/_common/register/$provideScrapersForNode'; | ||
export { $provideLlmToolsFromEnv }; | ||
export { $provideExecutablesForNode }; | ||
export { $provideFilesystemForNode }; | ||
@@ -19,0 +21,0 @@ export { $provideScrapersForNode }; |
@@ -22,2 +22,3 @@ import type { PipelineCollection } from '../collection/PipelineCollection'; | ||
import type { EmbeddingVector } from '../execution/EmbeddingVector'; | ||
import type { Executables } from '../execution/Executables'; | ||
import type { ExecutionTools } from '../execution/ExecutionTools'; | ||
@@ -53,3 +54,2 @@ import type { FilesystemTools } from '../execution/FilesystemTools'; | ||
import type { LangtailExecutionToolsOptions } from '../llm-providers/langtail/LangtailExecutionToolsOptions'; | ||
import type { MultipleLlmExecutionTools } from '../llm-providers/multiple/MultipleLlmExecutionTools'; | ||
import type { OpenAiExecutionToolsOptions } from '../llm-providers/openai/OpenAiExecutionToolsOptions'; | ||
@@ -227,4 +227,4 @@ import type { PromptbookServer_Error } from '../llm-providers/remote/interfaces/PromptbookServer_Error'; | ||
import type { Registration } from '../utils/$Register'; | ||
import type { IExecCommandOptions } from '../utils/execCommand/IExecCommandOptions'; | ||
import type { IExecCommandOptionsAdvanced } from '../utils/execCommand/IExecCommandOptions'; | ||
import type { ExecCommandOptions } from '../utils/execCommand/ExecCommandOptions'; | ||
import type { ExecCommandOptionsAdvanced } from '../utils/execCommand/ExecCommandOptions'; | ||
import type { FromtoItems } from '../utils/FromtoItems'; | ||
@@ -234,3 +234,3 @@ import type { CodeBlock } from '../utils/markdown/extractAllBlocksFromMarkdown'; | ||
import type { string_keyword } from '../utils/normalization/IKeywords'; | ||
import type { IKeywords } from '../utils/normalization/IKeywords'; | ||
import type { Keywords } from '../utils/normalization/IKeywords'; | ||
import type { string_kebab_case } from '../utils/normalization/normalize-to-kebab-case'; | ||
@@ -266,2 +266,3 @@ import type { string_camelCase } from '../utils/normalization/normalizeTo_camelCase'; | ||
export type { EmbeddingVector }; | ||
export type { Executables }; | ||
export type { ExecutionTools }; | ||
@@ -297,3 +298,2 @@ export type { FilesystemTools }; | ||
export type { LangtailExecutionToolsOptions }; | ||
export type { MultipleLlmExecutionTools }; | ||
export type { OpenAiExecutionToolsOptions }; | ||
@@ -471,4 +471,4 @@ export type { PromptbookServer_Error }; | ||
export type { Registration }; | ||
export type { IExecCommandOptions }; | ||
export type { IExecCommandOptionsAdvanced }; | ||
export type { ExecCommandOptions }; | ||
export type { ExecCommandOptionsAdvanced }; | ||
export type { FromtoItems }; | ||
@@ -478,3 +478,3 @@ export type { CodeBlock }; | ||
export type { string_keyword }; | ||
export type { IKeywords }; | ||
export type { Keywords }; | ||
export type { string_kebab_case }; | ||
@@ -481,0 +481,0 @@ export type { string_camelCase }; |
@@ -27,3 +27,3 @@ import { PROMPTBOOK_VERSION } from '../version'; | ||
import type { string_keyword } from '../utils/normalization/IKeywords'; | ||
import type { IKeywords } from '../utils/normalization/IKeywords'; | ||
import type { Keywords } from '../utils/normalization/IKeywords'; | ||
import { isValidKeyword } from '../utils/normalization/isValidKeyword'; | ||
@@ -99,3 +99,3 @@ import { nameToUriPart } from '../utils/normalization/nameToUriPart'; | ||
export type { string_keyword }; | ||
export type { IKeywords }; | ||
export type { Keywords }; | ||
export { isValidKeyword }; | ||
@@ -102,0 +102,0 @@ export { nameToUriPart }; |
import type { Scraper } from '../scrapers/_common/Scraper'; | ||
import type { Arrayable } from '../types/Arrayable'; | ||
import type { Executables } from './Executables'; | ||
import type { FilesystemTools } from './FilesystemTools'; | ||
@@ -32,2 +33,10 @@ import type { LlmExecutionTools } from './LlmExecutionTools'; | ||
* | ||
* Tip: Use `$provideExecutablesForNode` | ||
* | ||
* @default [] - If not provided, no external knowledge extraction will be possible | ||
*/ | ||
readonly executables?: Executables; | ||
/** | ||
* Scrapers for extracting knowledge from external sources | ||
* | ||
* Tip: Use `$provideScrapersForNode` OR `$provideScrapersForBrowser` to use all available scrapers | ||
@@ -55,4 +64,1 @@ * | ||
}; | ||
/** | ||
* TODO: !!!!!! Move here also the executables and make $provideXxxxForNode | ||
*/ |
import type { AutomaticTranslator } from './AutomaticTranslator'; | ||
import type { TranslatorOptions } from './TranslatorOptions'; | ||
interface LindatAutomaticTranslatorOptions extends TranslatorOptions { | ||
apiUrl?: URL; | ||
} | ||
/** | ||
* @@@ | ||
*/ | ||
type LindatAutomaticTranslatorOptions = TranslatorOptions & { | ||
/** | ||
* @@@ | ||
*/ | ||
readonly apiUrl?: URL; | ||
}; | ||
/** | ||
* @@@ | ||
* | ||
* @private still in development [๐ณ] | ||
@@ -8,0 +16,0 @@ */ |
@@ -18,4 +18,3 @@ import type { AvailableModel } from '../../execution/AvailableModel'; | ||
* Note: Internal utility of `joinLlmExecutionTools` but exposed type | ||
* @public exported from `@promptbook/types` | ||
* TODO: !!!!!! Export as runtime class not just type | ||
* @public exported from `@promptbook/core` | ||
*/ | ||
@@ -22,0 +21,0 @@ export declare class MultipleLlmExecutionTools implements LlmExecutionTools { |
@@ -7,10 +7,10 @@ import type { AvailableModel } from '../../../execution/AvailableModel'; | ||
*/ | ||
export interface PromptbookServer_ListModels_Response { | ||
export type PromptbookServer_ListModels_Response = { | ||
/** | ||
* Available models that can be used | ||
*/ | ||
models: Array<AvailableModel>; | ||
} | ||
readonly models: Array<AvailableModel>; | ||
}; | ||
/** | ||
* TODO: [๐] Listing models (and checking configuration) probbably should go through REST API not Socket.io | ||
*/ | ||
*/ |
@@ -7,7 +7,7 @@ import type { PromptResult } from '../../../execution/PromptResult'; | ||
*/ | ||
export interface PromptbookServer_Prompt_Response { | ||
export type PromptbookServer_Prompt_Response = { | ||
/** | ||
* The result of the prompt | ||
*/ | ||
promptResult: PromptResult; | ||
} | ||
readonly promptResult: PromptResult; | ||
}; |
@@ -37,21 +37,2 @@ import type { string_dirname } from '../types/typeAliases'; | ||
/** | ||
* Path to the external programs executables | ||
* | ||
* TODO: !!!!!! Transform to scrapers and make them Classy | ||
*/ | ||
readonly externalProgramsPaths?: { | ||
/** | ||
* Path to the `pandoc` executable | ||
* | ||
* @example 'C:/Users/me/AppData/Local/Pandoc/pandoc.exe' | ||
*/ | ||
readonly pandocPath?: string; | ||
/** | ||
* Path to the LibreOffice executable | ||
* | ||
* @example 'C:/Program Files/LibreOffice/program/swriter.exe' | ||
*/ | ||
readonly libreOfficePath?: string; | ||
}; | ||
/** | ||
* If true, the missing software is automatically installed | ||
@@ -58,0 +39,0 @@ */ |
@@ -5,3 +5,3 @@ import type { ExecutionTools } from '../../../execution/ExecutionTools'; | ||
/** | ||
* @@@!!!!!! | ||
* @@@ | ||
* | ||
@@ -8,0 +8,0 @@ * 1) @@@ |
@@ -5,3 +5,3 @@ import type { ExecutionTools } from '../../../execution/ExecutionTools'; | ||
/** | ||
* !!!!!! | ||
* @@@ | ||
* | ||
@@ -13,5 +13,5 @@ * 1) @@@ | ||
*/ | ||
export declare function $provideScrapersForNode(tools: Pick<ExecutionTools, 'fs' | 'llm'>, options?: PrepareAndScrapeOptions): Promise<Array<Scraper>>; | ||
export declare function $provideScrapersForNode(tools: Pick<ExecutionTools, 'fs' | 'llm' | 'executables'>, options?: PrepareAndScrapeOptions): Promise<Array<Scraper>>; | ||
/** | ||
* Note: [๐ข] Code in this file should never be never released in packages that could be imported into browser environment | ||
*/ |
@@ -64,4 +64,4 @@ import type { Promisable } from 'type-fest'; | ||
/** | ||
* TODO: !!!!!! Test that this is catched | ||
* Note: [โซ] Code in this file should never be published in any package | ||
* <- TODO: !!!!!! Test that this is catched | ||
*/ |
@@ -10,3 +10,3 @@ import type { KnowledgePiecePreparedJson } from '../../types/PipelineJson/KnowledgePieceJson'; | ||
/** | ||
* Scraper for .docx files | ||
* Scraper for old document files (like .doc and .rtf) | ||
* | ||
@@ -27,3 +27,3 @@ * @see `documentationUrl` for more details | ||
private readonly documentScraper; | ||
constructor(tools: Pick<ExecutionTools, 'fs' | 'llm'>, options: PrepareAndScrapeOptions); | ||
constructor(tools: Pick<ExecutionTools, 'fs' | 'llm' | 'executables'>, options: PrepareAndScrapeOptions); | ||
/** | ||
@@ -30,0 +30,0 @@ * Convert the `.doc` or `.rtf` to `.doc` file and returns intermediate source |
@@ -26,3 +26,3 @@ import type { KnowledgePiecePreparedJson } from '../../types/PipelineJson/KnowledgePieceJson'; | ||
private readonly markdownScraper; | ||
constructor(tools: Pick<ExecutionTools, 'fs' | 'llm'>, options: PrepareAndScrapeOptions); | ||
constructor(tools: Pick<ExecutionTools, 'fs' | 'llm' | 'executables'>, options: PrepareAndScrapeOptions); | ||
/** | ||
@@ -29,0 +29,0 @@ * Convert the `.docx` or `.odt` to `.md` file and returns intermediate source |
@@ -10,3 +10,3 @@ import type { KnowledgePiecePreparedJson } from '../../types/PipelineJson/KnowledgePieceJson'; | ||
/** | ||
* Scraper for .docx files | ||
* Scraper for .pdf files | ||
* | ||
@@ -13,0 +13,0 @@ * @see `documentationUrl` for more details |
@@ -11,3 +11,3 @@ import type { KnowledgePiecePreparedJson } from '../../types/PipelineJson/KnowledgePieceJson'; | ||
/** | ||
* Scraper for .docx files | ||
* Scraper for websites | ||
* | ||
@@ -28,2 +28,6 @@ * @see `documentationUrl` for more details | ||
private readonly markdownScraper; | ||
/** | ||
* Showdown converter is used internally | ||
*/ | ||
private readonly showdownConverter; | ||
constructor(tools: Pick<ExecutionTools, 'fs' | 'llm'>, options: PrepareAndScrapeOptions); | ||
@@ -44,3 +48,2 @@ /** | ||
/** | ||
* TODO: !!!!!! Put into separate package | ||
* TODO: [๐ฃ] Scraped website in .md can act as cache item - there is no need to run conversion each time | ||
@@ -47,0 +50,0 @@ * TODO: [๐ช] Do it in parallel 11:11 |
@@ -16,3 +16,3 @@ import type { ForeachJson } from '../../commands/FOREACH/ForeachJson'; | ||
*/ | ||
export interface TemplateJsonCommon { | ||
export type TemplateJsonCommon = { | ||
/** | ||
@@ -97,3 +97,3 @@ * Name of the template | ||
readonly resultingParameterName: string_name; | ||
} | ||
}; | ||
/** | ||
@@ -100,0 +100,0 @@ * TODO: use one helper type> (string_prompt | string_javascript | string_markdown) & string_template |
@@ -1,2 +0,2 @@ | ||
import type { IExecCommandOptions } from './IExecCommandOptions'; | ||
import type { ExecCommandOptions } from './ExecCommandOptions'; | ||
/** | ||
@@ -11,5 +11,5 @@ * Run one command in a shell | ||
*/ | ||
export declare function $execCommand(options: IExecCommandOptions): Promise<string>; | ||
export declare function $execCommand(options: ExecCommandOptions): Promise<string>; | ||
/** | ||
* Note: [๐ข] Code in this file should never be never released in packages that could be imported into browser environment | ||
*/ |
@@ -1,3 +0,3 @@ | ||
import type { IExecCommandOptions } from './IExecCommandOptions'; | ||
import type { IExecCommandOptionsAdvanced } from './IExecCommandOptions'; | ||
import type { ExecCommandOptions } from './ExecCommandOptions'; | ||
import type { ExecCommandOptionsAdvanced } from './ExecCommandOptions'; | ||
/** | ||
@@ -8,4 +8,4 @@ * Normalize options for `execCommand` and `execCommands` | ||
*/ | ||
export declare function execCommandNormalizeOptions(options: IExecCommandOptions): Pick<IExecCommandOptionsAdvanced, 'command' | 'args' | 'cwd' | 'crashOnError' | 'timeout'> & { | ||
export declare function execCommandNormalizeOptions(options: ExecCommandOptions): Pick<ExecCommandOptionsAdvanced, 'command' | 'args' | 'cwd' | 'crashOnError' | 'timeout'> & { | ||
humanReadableCommand: string; | ||
}; |
@@ -5,3 +5,3 @@ /** | ||
* Keyword is string without diacritics in lowercase [a-z1-9] | ||
* Words are splitted between multiple keywords @see IKeywords | ||
* Words are splitted between multiple keywords @see Keywords | ||
* | ||
@@ -19,5 +19,5 @@ * For example `"keyword"` | ||
*/ | ||
export type IKeywords = Set<string_keyword>; | ||
export type Keywords = Set<string_keyword>; | ||
/** | ||
* TODO: [๐ฎ] Keywords with weight | ||
*/ |
import type { really_unknown } from '../organization/really_unknown'; | ||
import type { IKeywords } from './IKeywords'; | ||
import type { Keywords } from './IKeywords'; | ||
/** | ||
@@ -12,3 +12,3 @@ * Parses keywords from any object and recursively walks through | ||
*/ | ||
export declare function parseKeywords(input: really_unknown): IKeywords; | ||
export declare function parseKeywords(input: really_unknown): Keywords; | ||
/** | ||
@@ -15,0 +15,0 @@ * Note: Not using spread in input param because of keeping second parameter for options |
@@ -1,2 +0,2 @@ | ||
import type { IKeywords } from './IKeywords'; | ||
import type { Keywords } from './IKeywords'; | ||
/** | ||
@@ -9,2 +9,2 @@ * Parses keywords from a string | ||
*/ | ||
export declare function parseKeywordsFromString(input: string): IKeywords; | ||
export declare function parseKeywordsFromString(input: string): Keywords; |
@@ -1,2 +0,2 @@ | ||
import type { IKeywords } from './IKeywords'; | ||
import type { Keywords } from './IKeywords'; | ||
/** | ||
@@ -10,2 +10,2 @@ * @@@ | ||
*/ | ||
export declare function searchKeywords(haystack: IKeywords, needle: IKeywords): boolean; | ||
export declare function searchKeywords(haystack: Keywords, needle: Keywords): boolean; |
/** | ||
* Additional options for `unwrapResult` | ||
*/ | ||
interface UnwrapResultOptions { | ||
type UnwrapResultOptions = { | ||
/** | ||
* If true, the text is trimmed before processing | ||
*/ | ||
isTrimmed?: boolean; | ||
readonly isTrimmed?: boolean; | ||
/** | ||
@@ -18,4 +18,4 @@ * If true, the introduce sentence is removed | ||
*/ | ||
isIntroduceSentenceRemoved?: boolean; | ||
} | ||
readonly isIntroduceSentenceRemoved?: boolean; | ||
}; | ||
/** | ||
@@ -22,0 +22,0 @@ * Removes quotes and optional introduce text from a string |
{ | ||
"name": "@promptbook/pdf", | ||
"version": "0.71.0-17", | ||
"version": "0.71.0-18", | ||
"description": "Supercharge your use of large language models", | ||
@@ -14,2 +14,3 @@ "private": false, | ||
], | ||
"todo-0": "TODO: [โ๏ธ] Make better list of keywords", | ||
"keywords": [ | ||
@@ -55,3 +56,3 @@ "ai", | ||
"peerDependencies": { | ||
"@promptbook/core": "0.71.0-17" | ||
"@promptbook/core": "0.71.0-18" | ||
}, | ||
@@ -62,5 +63,5 @@ "dependencies": { | ||
"prettier": "2.8.1", | ||
"spacetrim": "0.11.39", | ||
"spacetrim": "0.11.59", | ||
"waitasecond": "1.11.83" | ||
} | ||
} |
@@ -5,3 +5,3 @@ <!-- โ ๏ธ WARNING: This code has been generated so that any manual changes will be overwritten --> | ||
Supercharge your use of large language models | ||
Build responsible, controlled and transparent applications on top of LLM models! | ||
@@ -30,2 +30,6 @@ | ||
<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> | ||
## ๐ฆ Package `@promptbook/pdf` | ||
@@ -32,0 +36,0 @@ |
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
1314785
568
21604
455
+ Added@promptbook/core@0.71.0-18(transitive)
+ Addedspacetrim@0.11.59(transitive)
- Removed@promptbook/core@0.71.0-17(transitive)
- Removedspacetrim@0.11.39(transitive)
Updatedspacetrim@0.11.59