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

@promptbook/remote-client

Package Overview
Dependencies
Maintainers
1
Versions
454
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@promptbook/remote-client - npm Package Compare versions

Comparing version 0.37.0 to 0.38.0

esm/typings/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts

4

esm/typings/execution/CommonExecutionToolsOptions.d.ts

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

export interface CommonExecutionToolsOptions {
export type CommonExecutionToolsOptions = {
/**

@@ -6,5 +6,5 @@ * If true, the internal executions will be logged

readonly isVerbose?: boolean;
}
};
/**
* TODO: [🧠][πŸ’™] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
*/
import { PromptbookJson } from '../_packages/types.index';
import { ExecutionTools } from './ExecutionTools';
import { PromptbookExecutor } from './PromptbookExecutor';
export interface CreatePromptbookExecutorSettings {
export type CreatePromptbookExecutorSettings = {
/**

@@ -11,3 +11,3 @@ * When executor does not satisfy expectations it will be retried this amount of times

readonly maxExecutionAttempts: number;
}
};
/**

@@ -14,0 +14,0 @@ * Options for creating a promptbook executor

@@ -9,3 +9,3 @@ import { NaturalExecutionTools } from './NaturalExecutionTools';

*/
export interface ExecutionTools {
export type ExecutionTools = {
/**

@@ -26,2 +26,2 @@ * Tools for executing prompts to large language models like GPT-4

userInterface: UserInterfaceTools;
}
};

@@ -10,3 +10,3 @@ import { Prompt } from '../types/Prompt';

*/
export interface NaturalExecutionTools {
export type NaturalExecutionTools = {
/**

@@ -20,3 +20,3 @@ * Use a chat model

gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
}
};
/**

@@ -23,0 +23,0 @@ * TODO: [🏳] gptChat -> chat, gptComplete -> complete, translate

@@ -6,3 +6,3 @@ import { string_token } from '../../../.././types/typeAliases';

*/
export interface OpenAiExecutionToolsOptions extends CommonExecutionToolsOptions {
export type OpenAiExecutionToolsOptions = CommonExecutionToolsOptions & {
/**

@@ -17,2 +17,2 @@ * OpenAI API key

user?: string_token;
}
};

@@ -5,3 +5,3 @@ import type { PromptbookLibrary } from '../../../../../classes/PromptbookLibrary';

import type { NaturalExecutionTools } from '../../../../NaturalExecutionTools';
export interface RemoteServerOptions extends CommonExecutionToolsOptions {
export type RemoteServerOptions = CommonExecutionToolsOptions & {
/**

@@ -28,2 +28,2 @@ * Port on which the server will listen

createNaturalExecutionTools(clientId: client_id): NaturalExecutionTools;
}
};

@@ -6,3 +6,3 @@ import type { client_id, string_uri } from '../../../.././types/typeAliases';

*/
export interface RemoteNaturalExecutionToolsOptions extends CommonExecutionToolsOptions {
export type RemoteNaturalExecutionToolsOptions = CommonExecutionToolsOptions & {
/**

@@ -24,2 +24,2 @@ * URL of the remote PROMPTBOOK server

readonly clientId: client_id;
}
};

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

*/
export interface CallbackInterfaceToolsOptions extends CommonExecutionToolsOptions {
export type CallbackInterfaceToolsOptions = CommonExecutionToolsOptions & {
/**

@@ -13,2 +13,2 @@ * The callback function to be called when promptDialog is called

callback(prompt: UserInterfaceToolsPromptDialogOptions): Promisable<string>;
}
};

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

*/
export interface PromptbookExecutor {
export type PromptbookExecutor = {
(inputParameters: Record<string_name, string>, onProgress: (taskProgress: TaskProgress) => Promisable<void>): Promise<{

@@ -37,5 +37,5 @@ /**

}>;
}
};
/**
* TODO: [🧠] Should this file be in /execution or /types folder?
*/

@@ -17,5 +17,4 @@ import type { number_positive_or_zero, number_tokens, number_usd, string_date_iso8601, string_model_name } from '.././types/typeAliases';

*/
export interface PromptChatResult extends PromptCommonResult {
}
export interface PromptCommonResult {
export type PromptChatResult = PromptCommonResult & {};
export type PromptCommonResult = {
/**

@@ -69,3 +68,3 @@ * Exact text response from the model

readonly rawResponse: object;
}
};
/**

@@ -72,0 +71,0 @@ * TODO: [🧠] Maybe timing more accurate then seconds?

@@ -8,9 +8,9 @@ import { string_name, string_script } from '.././types/typeAliases';

*/
export interface ScriptExecutionTools {
export type ScriptExecutionTools = {
execute(options: ScriptExecutionToolsExecuteOptions): Promise<string>;
}
};
/**
* Input for the script execution
*/
export interface ScriptExecutionToolsExecuteOptions {
export type ScriptExecutionToolsExecuteOptions = {
/**

@@ -35,5 +35,5 @@ * Language of the script

script: string_script;
}
};
/**
* TODO: [🧠][πŸ’™] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
*/
*/

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

import { IAutomaticTranslator } from './IAutomaticTranslator';
import { AutomaticTranslator } from './AutomaticTranslator';
/**
* This will wrap an automatic translator and log each translation into the console
*/
export declare class DebugAutomaticTranslator implements IAutomaticTranslator {
export declare class DebugAutomaticTranslator implements AutomaticTranslator {
private readonly automaticTranslator;
constructor(automaticTranslator: IAutomaticTranslator);
constructor(automaticTranslator: AutomaticTranslator);
translate(message: string): Promise<string>;
}

@@ -1,5 +0,5 @@

import { IAutomaticTranslator } from './IAutomaticTranslator';
export declare class FakeAutomaticTranslator implements IAutomaticTranslator {
import { AutomaticTranslator } from './AutomaticTranslator';
export declare class FakeAutomaticTranslator implements AutomaticTranslator {
constructor();
translate(message: string): string;
}

@@ -1,11 +0,11 @@

import { IAutomaticTranslator } from './IAutomaticTranslator';
import { ITranslatorOptions } from './ITranslatorOptions';
interface ILindatAutomaticTranslatorOptions extends ITranslatorOptions {
import { AutomaticTranslator } from './AutomaticTranslator';
import { TranslatorOptions } from './TranslatorOptions';
interface LindatAutomaticTranslatorOptions extends TranslatorOptions {
apiUrl: URL;
}
export declare class LindatAutomaticTranslator implements IAutomaticTranslator {
export declare class LindatAutomaticTranslator implements AutomaticTranslator {
private readonly options;
constructor(options: ILindatAutomaticTranslatorOptions);
constructor(options: LindatAutomaticTranslatorOptions);
translate(message: string): Promise<string>;
}
export {};

@@ -1,5 +0,5 @@

import { IAutomaticTranslator } from './automatic-translators/IAutomaticTranslator';
import { ITranslatorOptions } from './automatic-translators/ITranslatorOptions';
import { AutomaticTranslator } from './automatic-translators/AutomaticTranslator';
import { TranslatorOptions } from './automatic-translators/TranslatorOptions';
export declare function translateMessages({ automaticTranslator, from, to, }: {
automaticTranslator: IAutomaticTranslator;
} & ITranslatorOptions): Promise<void>;
automaticTranslator: AutomaticTranslator;
} & TranslatorOptions): Promise<void>;

@@ -7,3 +7,3 @@ import { number_integer, number_positive } from '../types/typeAliases';

*/
export interface UserInterfaceTools {
export type UserInterfaceTools = {
/**

@@ -16,4 +16,4 @@ * Asks the user to answer a free-text (multiline) question

promptDialog(options: UserInterfaceToolsPromptDialogOptions): Promise<string>;
}
export interface UserInterfaceToolsPromptDialogOptions {
};
export type UserInterfaceToolsPromptDialogOptions = {
/**

@@ -47,2 +47,2 @@ * Prompt title

priority: number_integer & number_positive;
}
};

@@ -16,6 +16,6 @@ import type { string_markdown_text, string_name, string_version } from '.././types/typeAliases';

*/
export interface PromptbookUrlCommand {
export type PromptbookUrlCommand = {
readonly type: 'PROMPTBOOK_URL';
readonly promptbookUrl: URL;
}
};
/**

@@ -27,6 +27,6 @@ * PromptbookVersion command tells which version is .promptbook file using

*/
export interface PromptbookVersionCommand {
export type PromptbookVersionCommand = {
readonly type: 'PROMPTBOOK_VERSION';
readonly promptbookVersion: string_version;
}
};
/**

@@ -36,21 +36,21 @@ * Execute command tells how to execute the section

*/
export interface ExecuteCommand {
export type ExecuteCommand = {
readonly type: 'EXECUTE';
readonly executionType: ExecutionType;
}
};
/**
* Model command tells which model and modelRequirements to use for the prompt template. execution
*/
export interface ModelCommand {
export type ModelCommand = {
readonly type: 'MODEL';
readonly key: keyof ModelRequirements;
readonly value: any;
}
};
/**
* Joker parameter is used instead of executing the prompt template if it meet the expectations requirements
*/
export interface JokerCommand {
export type JokerCommand = {
readonly type: 'JOKER';
readonly parameterName: string_name;
}
};
/**

@@ -63,3 +63,3 @@ * Parameter command describes one parameter of the prompt template

*/
export interface ParameterCommand {
export type ParameterCommand = {
readonly type: 'PARAMETER';

@@ -70,3 +70,3 @@ readonly isInput: boolean;

readonly parameterDescription: string_markdown_text | null;
}
};
/**

@@ -76,6 +76,6 @@ * Postprocess command describes which function to use for postprocessing

*/
export interface PostprocessCommand {
export type PostprocessCommand = {
readonly type: 'POSTPROCESS';
readonly functionName: string_name;
}
};
/**

@@ -92,3 +92,3 @@ * Expect command describes the desired output of the prompt template (after post-processing)

*/
export interface ExpectAmountCommand {
export type ExpectAmountCommand = {
readonly type: 'EXPECT_AMOUNT';

@@ -98,9 +98,9 @@ readonly sign: 'EXACTLY' | 'MINIMUM' | 'MAXIMUM';

readonly amount: ExpectationAmount;
}
};
/**
* Represents a command that expects a specific format.
*/
export interface ExpectFormatCommand {
export type ExpectFormatCommand = {
readonly type: 'EXPECT_FORMAT';
readonly format: 'JSON';
}
};

@@ -10,3 +10,3 @@ import { string_model_name } from './typeAliases';

*/
export type ModelVariant = (typeof MODEL_VARIANTS)[number];
export type ModelVariant = typeof MODEL_VARIANTS[number];
/**

@@ -17,3 +17,3 @@ * Abstract way to specify the LLM. It does not specify the LLM with concrete version itself, only the requirements for the LLM.

*/
export interface ModelRequirements {
export type ModelRequirements = {
/**

@@ -39,3 +39,3 @@ * Model variant describes the very general type of the model

readonly maxTokens?: number;
}
};
/**

@@ -42,0 +42,0 @@ * TODO: Maybe figure out better word than "variant"

@@ -8,3 +8,3 @@ import type { string_name, string_prompt, string_promptbook_url_with_hashtemplate, string_title } from '.././types/typeAliases';

*/
export interface Prompt {
export type Prompt = {
/**

@@ -39,5 +39,5 @@ * The title of the prompt

readonly parameters: Record<string_name, string>;
}
};
/**
* TODO: [βœ”] Check ModelRequirements in runtime
*/

@@ -10,3 +10,3 @@ import { string_promptbook_url, string_version } from '../typeAliases';

*/
export interface PromptbookJson {
export type PromptbookJson = {
/**

@@ -44,3 +44,3 @@ * Unique identifier of the promptbook

readonly promptTemplates: Array<PromptTemplateJson>;
}
};
/**

@@ -47,0 +47,0 @@ * TODO: [🧠] Best format of this code?

@@ -13,3 +13,3 @@ import { ExpectFormatCommand } from '../Command';

*/
export interface NaturalTemplateJson extends PromptTemplateJsonCommon {
export type NaturalTemplateJson = PromptTemplateJsonCommon & {
readonly executionType: 'PROMPT_TEMPLATE';

@@ -21,3 +21,3 @@ /**

readonly modelRequirements: ModelRequirements;
}
};
/**

@@ -24,0 +24,0 @@ * Units of text measurement

@@ -5,3 +5,3 @@ import { string_name } from '../typeAliases';

*/
export interface PromptTemplateParameterJson {
export type PromptTemplateParameterJson = {
/**

@@ -26,2 +26,2 @@ * Name of the parameter

readonly description?: string;
}
};

@@ -6,3 +6,3 @@ import { ExecutionType } from './ExecutionTypes';

*/
export interface TaskProgress {
export type TaskProgress = {
/**

@@ -43,2 +43,2 @@ * The unique name of the task.

readonly parameterValue: string | null;
}
};

@@ -329,13 +329,2 @@ /**

/**
* Full profile of the person with his email and web (like in package.json)
*/
export interface IPersonProfile {
readonly name?: string_person_fullname;
/**
* Note: Photos are taken from Gravatar by email
*/
readonly email?: string_email;
readonly url?: string_url;
}
/**
* Semantic helper

@@ -347,16 +336,2 @@ *

/**
* License with its type and url like in package.json
*/
export interface ILicense {
readonly type?: string_license;
readonly url?: string;
}
/**
* Repository with its type and url like in package.json
*/
export interface IRepository {
readonly type?: string | 'git';
readonly url?: string;
}
/**
* Semantic helper for attributes

@@ -397,3 +372,2 @@ *

* TODO: Probably use enum
* TODO: Rename - remove string_ prefix like ITranslateLanguageCode
*/

@@ -400,0 +374,0 @@ export type string_translate_language = 'en' | 'cs';

@@ -6,3 +6,3 @@ /**

*/
export interface MarkdownStructure {
export type MarkdownStructure = {
/**

@@ -26,2 +26,2 @@ * The section level of the markdown file.

sections: MarkdownStructure[];
}
};
{
"name": "@promptbook/remote-client",
"version": "0.37.0",
"version": "0.38.0",
"description": "Library to supercharge your use of large language models",

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

"peerDependencies": {
"@promptbook/core": "0.37.0"
"@promptbook/core": "0.38.0"
},

@@ -43,0 +43,0 @@ "main": "./umd/index.umd.js",

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

export interface CommonExecutionToolsOptions {
export type CommonExecutionToolsOptions = {
/**

@@ -6,5 +6,5 @@ * If true, the internal executions will be logged

readonly isVerbose?: boolean;
}
};
/**
* TODO: [🧠][πŸ’™] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
*/
import { PromptbookJson } from '../_packages/types.index';
import { ExecutionTools } from './ExecutionTools';
import { PromptbookExecutor } from './PromptbookExecutor';
export interface CreatePromptbookExecutorSettings {
export type CreatePromptbookExecutorSettings = {
/**

@@ -11,3 +11,3 @@ * When executor does not satisfy expectations it will be retried this amount of times

readonly maxExecutionAttempts: number;
}
};
/**

@@ -14,0 +14,0 @@ * Options for creating a promptbook executor

@@ -9,3 +9,3 @@ import { NaturalExecutionTools } from './NaturalExecutionTools';

*/
export interface ExecutionTools {
export type ExecutionTools = {
/**

@@ -26,2 +26,2 @@ * Tools for executing prompts to large language models like GPT-4

userInterface: UserInterfaceTools;
}
};

@@ -10,3 +10,3 @@ import { Prompt } from '../types/Prompt';

*/
export interface NaturalExecutionTools {
export type NaturalExecutionTools = {
/**

@@ -20,3 +20,3 @@ * Use a chat model

gptComplete(prompt: Prompt): Promise<PromptCompletionResult>;
}
};
/**

@@ -23,0 +23,0 @@ * TODO: [🏳] gptChat -> chat, gptComplete -> complete, translate

@@ -6,3 +6,3 @@ import { string_token } from '../../../.././types/typeAliases';

*/
export interface OpenAiExecutionToolsOptions extends CommonExecutionToolsOptions {
export type OpenAiExecutionToolsOptions = CommonExecutionToolsOptions & {
/**

@@ -17,2 +17,2 @@ * OpenAI API key

user?: string_token;
}
};

@@ -5,3 +5,3 @@ import type { PromptbookLibrary } from '../../../../../classes/PromptbookLibrary';

import type { NaturalExecutionTools } from '../../../../NaturalExecutionTools';
export interface RemoteServerOptions extends CommonExecutionToolsOptions {
export type RemoteServerOptions = CommonExecutionToolsOptions & {
/**

@@ -28,2 +28,2 @@ * Port on which the server will listen

createNaturalExecutionTools(clientId: client_id): NaturalExecutionTools;
}
};

@@ -6,3 +6,3 @@ import type { client_id, string_uri } from '../../../.././types/typeAliases';

*/
export interface RemoteNaturalExecutionToolsOptions extends CommonExecutionToolsOptions {
export type RemoteNaturalExecutionToolsOptions = CommonExecutionToolsOptions & {
/**

@@ -24,2 +24,2 @@ * URL of the remote PROMPTBOOK server

readonly clientId: client_id;
}
};

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

*/
export interface CallbackInterfaceToolsOptions extends CommonExecutionToolsOptions {
export type CallbackInterfaceToolsOptions = CommonExecutionToolsOptions & {
/**

@@ -13,2 +13,2 @@ * The callback function to be called when promptDialog is called

callback(prompt: UserInterfaceToolsPromptDialogOptions): Promisable<string>;
}
};

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

*/
export interface PromptbookExecutor {
export type PromptbookExecutor = {
(inputParameters: Record<string_name, string>, onProgress: (taskProgress: TaskProgress) => Promisable<void>): Promise<{

@@ -37,5 +37,5 @@ /**

}>;
}
};
/**
* TODO: [🧠] Should this file be in /execution or /types folder?
*/

@@ -17,5 +17,4 @@ import type { number_positive_or_zero, number_tokens, number_usd, string_date_iso8601, string_model_name } from '.././types/typeAliases';

*/
export interface PromptChatResult extends PromptCommonResult {
}
export interface PromptCommonResult {
export type PromptChatResult = PromptCommonResult & {};
export type PromptCommonResult = {
/**

@@ -69,3 +68,3 @@ * Exact text response from the model

readonly rawResponse: object;
}
};
/**

@@ -72,0 +71,0 @@ * TODO: [🧠] Maybe timing more accurate then seconds?

@@ -8,9 +8,9 @@ import { string_name, string_script } from '.././types/typeAliases';

*/
export interface ScriptExecutionTools {
export type ScriptExecutionTools = {
execute(options: ScriptExecutionToolsExecuteOptions): Promise<string>;
}
};
/**
* Input for the script execution
*/
export interface ScriptExecutionToolsExecuteOptions {
export type ScriptExecutionToolsExecuteOptions = {
/**

@@ -35,5 +35,5 @@ * Language of the script

script: string_script;
}
};
/**
* TODO: [🧠][πŸ’™] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
*/
*/

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

import { IAutomaticTranslator } from './IAutomaticTranslator';
import { AutomaticTranslator } from './AutomaticTranslator';
/**
* This will wrap an automatic translator and log each translation into the console
*/
export declare class DebugAutomaticTranslator implements IAutomaticTranslator {
export declare class DebugAutomaticTranslator implements AutomaticTranslator {
private readonly automaticTranslator;
constructor(automaticTranslator: IAutomaticTranslator);
constructor(automaticTranslator: AutomaticTranslator);
translate(message: string): Promise<string>;
}

@@ -1,5 +0,5 @@

import { IAutomaticTranslator } from './IAutomaticTranslator';
export declare class FakeAutomaticTranslator implements IAutomaticTranslator {
import { AutomaticTranslator } from './AutomaticTranslator';
export declare class FakeAutomaticTranslator implements AutomaticTranslator {
constructor();
translate(message: string): string;
}

@@ -1,11 +0,11 @@

import { IAutomaticTranslator } from './IAutomaticTranslator';
import { ITranslatorOptions } from './ITranslatorOptions';
interface ILindatAutomaticTranslatorOptions extends ITranslatorOptions {
import { AutomaticTranslator } from './AutomaticTranslator';
import { TranslatorOptions } from './TranslatorOptions';
interface LindatAutomaticTranslatorOptions extends TranslatorOptions {
apiUrl: URL;
}
export declare class LindatAutomaticTranslator implements IAutomaticTranslator {
export declare class LindatAutomaticTranslator implements AutomaticTranslator {
private readonly options;
constructor(options: ILindatAutomaticTranslatorOptions);
constructor(options: LindatAutomaticTranslatorOptions);
translate(message: string): Promise<string>;
}
export {};

@@ -1,5 +0,5 @@

import { IAutomaticTranslator } from './automatic-translators/IAutomaticTranslator';
import { ITranslatorOptions } from './automatic-translators/ITranslatorOptions';
import { AutomaticTranslator } from './automatic-translators/AutomaticTranslator';
import { TranslatorOptions } from './automatic-translators/TranslatorOptions';
export declare function translateMessages({ automaticTranslator, from, to, }: {
automaticTranslator: IAutomaticTranslator;
} & ITranslatorOptions): Promise<void>;
automaticTranslator: AutomaticTranslator;
} & TranslatorOptions): Promise<void>;

@@ -7,3 +7,3 @@ import { number_integer, number_positive } from '../types/typeAliases';

*/
export interface UserInterfaceTools {
export type UserInterfaceTools = {
/**

@@ -16,4 +16,4 @@ * Asks the user to answer a free-text (multiline) question

promptDialog(options: UserInterfaceToolsPromptDialogOptions): Promise<string>;
}
export interface UserInterfaceToolsPromptDialogOptions {
};
export type UserInterfaceToolsPromptDialogOptions = {
/**

@@ -47,2 +47,2 @@ * Prompt title

priority: number_integer & number_positive;
}
};

@@ -16,6 +16,6 @@ import type { string_markdown_text, string_name, string_version } from '.././types/typeAliases';

*/
export interface PromptbookUrlCommand {
export type PromptbookUrlCommand = {
readonly type: 'PROMPTBOOK_URL';
readonly promptbookUrl: URL;
}
};
/**

@@ -27,6 +27,6 @@ * PromptbookVersion command tells which version is .promptbook file using

*/
export interface PromptbookVersionCommand {
export type PromptbookVersionCommand = {
readonly type: 'PROMPTBOOK_VERSION';
readonly promptbookVersion: string_version;
}
};
/**

@@ -36,21 +36,21 @@ * Execute command tells how to execute the section

*/
export interface ExecuteCommand {
export type ExecuteCommand = {
readonly type: 'EXECUTE';
readonly executionType: ExecutionType;
}
};
/**
* Model command tells which model and modelRequirements to use for the prompt template. execution
*/
export interface ModelCommand {
export type ModelCommand = {
readonly type: 'MODEL';
readonly key: keyof ModelRequirements;
readonly value: any;
}
};
/**
* Joker parameter is used instead of executing the prompt template if it meet the expectations requirements
*/
export interface JokerCommand {
export type JokerCommand = {
readonly type: 'JOKER';
readonly parameterName: string_name;
}
};
/**

@@ -63,3 +63,3 @@ * Parameter command describes one parameter of the prompt template

*/
export interface ParameterCommand {
export type ParameterCommand = {
readonly type: 'PARAMETER';

@@ -70,3 +70,3 @@ readonly isInput: boolean;

readonly parameterDescription: string_markdown_text | null;
}
};
/**

@@ -76,6 +76,6 @@ * Postprocess command describes which function to use for postprocessing

*/
export interface PostprocessCommand {
export type PostprocessCommand = {
readonly type: 'POSTPROCESS';
readonly functionName: string_name;
}
};
/**

@@ -92,3 +92,3 @@ * Expect command describes the desired output of the prompt template (after post-processing)

*/
export interface ExpectAmountCommand {
export type ExpectAmountCommand = {
readonly type: 'EXPECT_AMOUNT';

@@ -98,9 +98,9 @@ readonly sign: 'EXACTLY' | 'MINIMUM' | 'MAXIMUM';

readonly amount: ExpectationAmount;
}
};
/**
* Represents a command that expects a specific format.
*/
export interface ExpectFormatCommand {
export type ExpectFormatCommand = {
readonly type: 'EXPECT_FORMAT';
readonly format: 'JSON';
}
};

@@ -10,3 +10,3 @@ import { string_model_name } from './typeAliases';

*/
export type ModelVariant = (typeof MODEL_VARIANTS)[number];
export type ModelVariant = typeof MODEL_VARIANTS[number];
/**

@@ -17,3 +17,3 @@ * Abstract way to specify the LLM. It does not specify the LLM with concrete version itself, only the requirements for the LLM.

*/
export interface ModelRequirements {
export type ModelRequirements = {
/**

@@ -39,3 +39,3 @@ * Model variant describes the very general type of the model

readonly maxTokens?: number;
}
};
/**

@@ -42,0 +42,0 @@ * TODO: Maybe figure out better word than "variant"

@@ -8,3 +8,3 @@ import type { string_name, string_prompt, string_promptbook_url_with_hashtemplate, string_title } from '.././types/typeAliases';

*/
export interface Prompt {
export type Prompt = {
/**

@@ -39,5 +39,5 @@ * The title of the prompt

readonly parameters: Record<string_name, string>;
}
};
/**
* TODO: [βœ”] Check ModelRequirements in runtime
*/

@@ -10,3 +10,3 @@ import { string_promptbook_url, string_version } from '../typeAliases';

*/
export interface PromptbookJson {
export type PromptbookJson = {
/**

@@ -44,3 +44,3 @@ * Unique identifier of the promptbook

readonly promptTemplates: Array<PromptTemplateJson>;
}
};
/**

@@ -47,0 +47,0 @@ * TODO: [🧠] Best format of this code?

@@ -13,3 +13,3 @@ import { ExpectFormatCommand } from '../Command';

*/
export interface NaturalTemplateJson extends PromptTemplateJsonCommon {
export type NaturalTemplateJson = PromptTemplateJsonCommon & {
readonly executionType: 'PROMPT_TEMPLATE';

@@ -21,3 +21,3 @@ /**

readonly modelRequirements: ModelRequirements;
}
};
/**

@@ -24,0 +24,0 @@ * Units of text measurement

@@ -5,3 +5,3 @@ import { string_name } from '../typeAliases';

*/
export interface PromptTemplateParameterJson {
export type PromptTemplateParameterJson = {
/**

@@ -26,2 +26,2 @@ * Name of the parameter

readonly description?: string;
}
};

@@ -6,3 +6,3 @@ import { ExecutionType } from './ExecutionTypes';

*/
export interface TaskProgress {
export type TaskProgress = {
/**

@@ -43,2 +43,2 @@ * The unique name of the task.

readonly parameterValue: string | null;
}
};

@@ -329,13 +329,2 @@ /**

/**
* Full profile of the person with his email and web (like in package.json)
*/
export interface IPersonProfile {
readonly name?: string_person_fullname;
/**
* Note: Photos are taken from Gravatar by email
*/
readonly email?: string_email;
readonly url?: string_url;
}
/**
* Semantic helper

@@ -347,16 +336,2 @@ *

/**
* License with its type and url like in package.json
*/
export interface ILicense {
readonly type?: string_license;
readonly url?: string;
}
/**
* Repository with its type and url like in package.json
*/
export interface IRepository {
readonly type?: string | 'git';
readonly url?: string;
}
/**
* Semantic helper for attributes

@@ -397,3 +372,2 @@ *

* TODO: Probably use enum
* TODO: Rename - remove string_ prefix like ITranslateLanguageCode
*/

@@ -400,0 +374,0 @@ export type string_translate_language = 'en' | 'cs';

@@ -6,3 +6,3 @@ /**

*/
export interface MarkdownStructure {
export type MarkdownStructure = {
/**

@@ -26,2 +26,2 @@ * The section level of the markdown file.

sections: MarkdownStructure[];
}
};
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