@promptbook/anthropic-claude
Advanced tools
Comparing version 0.72.0-9 to 0.72.0-10
@@ -69,2 +69,3 @@ import type { PipelineCollection } from '../collection/PipelineCollection'; | ||
import type { CollectionRemoteServerOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions'; | ||
import type { CollectionRemoteServerClientOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions'; | ||
import type { PrepareAndScrapeOptions } from '../prepare/PrepareAndScrapeOptions'; | ||
@@ -166,3 +167,2 @@ import type { Converter } from '../scrapers/_common/Converter'; | ||
import type { string_uri_part } from '../types/typeAliases'; | ||
import type { string_uriid } from '../types/typeAliases'; | ||
import type { string_hostname } from '../types/typeAliases'; | ||
@@ -174,2 +174,3 @@ import type { string_host } from '../types/typeAliases'; | ||
import type { string_uuid } from '../types/typeAliases'; | ||
import type { string_app_id } from '../types/typeAliases'; | ||
import type { string_user_id } from '../types/typeAliases'; | ||
@@ -197,2 +198,3 @@ import type { string_sha256 } from '../types/typeAliases'; | ||
import type { string_postprocessing_function_name } from '../types/typeAliases'; | ||
import type { id } from '../types/typeAliases'; | ||
import type { string_token } from '../types/typeAliases'; | ||
@@ -314,2 +316,3 @@ import type { string_license_token } from '../types/typeAliases'; | ||
export type { CollectionRemoteServerOptions }; | ||
export type { CollectionRemoteServerClientOptions }; | ||
export type { PrepareAndScrapeOptions }; | ||
@@ -411,3 +414,2 @@ export type { Converter }; | ||
export type { string_uri_part }; | ||
export type { string_uriid }; | ||
export type { string_hostname }; | ||
@@ -419,2 +421,3 @@ export type { string_host }; | ||
export type { string_uuid }; | ||
export type { string_app_id }; | ||
export type { string_user_id }; | ||
@@ -442,2 +445,3 @@ export type { string_sha256 }; | ||
export type { string_postprocessing_function_name }; | ||
export type { id }; | ||
export type { string_token }; | ||
@@ -444,0 +448,0 @@ export type { string_license_token }; |
@@ -28,5 +28,5 @@ import type { ClientOptions } from '@anthropic-ai/sdk'; | ||
isProxied: true; | ||
} & Pick<RemoteLlmExecutionToolsOptions, 'remoteUrl' | 'path'>; | ||
} & Pick<RemoteLlmExecutionToolsOptions<undefined>, 'remoteUrl' | 'path'>; | ||
/** | ||
* TODO: [π§ ][π€Ί] Detecting `user` | ||
* TODO: [π§ ][π€Ί] Pass `userId` | ||
*/ |
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions'; | ||
import type { string_name } from '../../types/typeAliases'; | ||
import type { string_token } from '../../types/typeAliases'; | ||
import type { string_user_id } from '../../types/typeAliases'; | ||
/** | ||
@@ -35,3 +36,3 @@ * Options for `AzureOpenAiExecutionTools` | ||
*/ | ||
readonly user?: string_token; | ||
readonly userId: string_user_id | null; | ||
}; |
@@ -17,2 +17,2 @@ import type { LlmExecutionTools } from '../../execution/LlmExecutionTools'; | ||
* TODO: [π§ ][π] Maybe use `isDeterministic` from options | ||
*/ | ||
*/ |
@@ -30,3 +30,3 @@ import OpenAI from 'openai'; | ||
*/ | ||
constructor(options?: OpenAiExecutionToolsOptions); | ||
constructor(options: OpenAiExecutionToolsOptions); | ||
get title(): string_title & string_markdown_text; | ||
@@ -33,0 +33,0 @@ get description(): string_markdown; |
import type { ClientOptions } from 'openai'; | ||
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions'; | ||
import type { string_token } from '../../types/typeAliases'; | ||
import type { string_user_id } from '../../types/typeAliases'; | ||
/** | ||
@@ -19,3 +19,3 @@ * Options for `OpenAiExecutionTools` | ||
*/ | ||
user?: string_token; | ||
userId: string_user_id | null; | ||
}; |
@@ -0,2 +1,4 @@ | ||
import type { string_user_id } from '../../../types/typeAliases'; | ||
import type { LlmToolsConfiguration } from '../../_common/register/LlmToolsConfiguration'; | ||
import type { CollectionRemoteServerClientOptions } from './RemoteServerOptions'; | ||
/** | ||
@@ -7,8 +9,8 @@ * Socket.io progress for remote text generation | ||
*/ | ||
export type PromptbookServer_ListModels_Request = PromptbookServer_ListModels_CollectionRequest | PromptbookServer_ListModels_AnonymousRequest; | ||
export type PromptbookServer_ListModels_CollectionRequest = { | ||
export type PromptbookServer_ListModels_Request<TCustomOptions> = PromptbookServer_ListModels_CollectionRequest<TCustomOptions> | PromptbookServer_ListModels_AnonymousRequest; | ||
export type PromptbookServer_ListModels_CollectionRequest<TCustomOptions> = CollectionRemoteServerClientOptions<TCustomOptions> & { | ||
/** | ||
* Collection mode | ||
* Application mode | ||
*/ | ||
isAnonymous: false; | ||
readonly isAnonymous: false; | ||
}; | ||
@@ -19,4 +21,11 @@ export type PromptbookServer_ListModels_AnonymousRequest = { | ||
*/ | ||
isAnonymous: true; | ||
readonly isAnonymous: true; | ||
/** | ||
* Identifier of the end user | ||
* | ||
* Note: this is passed to the certain model providers to identify misuse | ||
* Note: In anonymous mode, there is no need to identify yourself, nor does it change the actual configuration of LLM Tools (unlike in application mode) | ||
*/ | ||
readonly userId: string_user_id | null; | ||
/** | ||
* Configuration for the LLM tools | ||
@@ -29,4 +38,4 @@ */ | ||
* TODO: [π§ ][π] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'` | ||
* TODO: [π§ ][π€Ί] Pass `userId` in `PromptbookServer_ListModels_Request` | ||
* TODO: [π§ ][π€Ί] Maybe allow overriding of `userId` for each prompt - Pass `userId` in `PromptbookServer_ListModels_Request` | ||
* TODO: [π] Listing models (and checking configuration) probbably should go through REST API not Socket.io | ||
*/ |
@@ -11,6 +11,6 @@ import type { AvailableModel } from '../../../execution/AvailableModel'; | ||
*/ | ||
models: Array<AvailableModel>; | ||
readonly models: Array<AvailableModel>; | ||
} | ||
/** | ||
* TODO: [π] Listing models (and checking configuration) probbably should go through REST API not Socket.io | ||
*/ | ||
*/ |
import type { Prompt } from '../../../types/Prompt'; | ||
import type { string_user_id } from '../../../types/typeAliases'; | ||
import type { LlmToolsConfiguration } from '../../_common/register/LlmToolsConfiguration'; | ||
import type { CollectionRemoteServerClientOptions } from './RemoteServerOptions'; | ||
/** | ||
@@ -9,16 +10,9 @@ * Socket.io progress for remote text generation | ||
*/ | ||
export type PromptbookServer_Prompt_Request = PromptbookServer_Prompt_CollectionRequest | PromptbookServer_Prompt_AnonymousRequest; | ||
export type PromptbookServer_Prompt_CollectionRequest = { | ||
export type PromptbookServer_Prompt_Request<TCustomOptions> = PromptbookServer_Prompt_CollectionRequest<TCustomOptions> | PromptbookServer_Prompt_AnonymousRequest; | ||
export type PromptbookServer_Prompt_CollectionRequest<TCustomOptions> = CollectionRemoteServerClientOptions<TCustomOptions> & { | ||
/** | ||
* Collection mode | ||
* Application mode | ||
*/ | ||
readonly isAnonymous: false; | ||
/** | ||
* Identifier of the end user | ||
* | ||
* Note: this is passed to the certain model providers to identify misuse | ||
* Note: In anonymous mode it is not required to identify | ||
*/ | ||
readonly userId: string_user_id; | ||
/** | ||
* The Prompt to execute | ||
@@ -37,5 +31,5 @@ */ | ||
* Note: this is passed to the certain model providers to identify misuse | ||
* Note: In anonymous mode it is not required to identify | ||
* Note: In anonymous mode, there is no need to identify yourself, nor does it change the actual configuration of LLM Tools (unlike in application mode) | ||
*/ | ||
readonly userId?: string_user_id; | ||
readonly userId: string_user_id | null; | ||
/** | ||
@@ -42,0 +36,0 @@ * Configuration for the LLM tools |
@@ -11,3 +11,3 @@ import type { PromptResult } from '../../../execution/PromptResult'; | ||
*/ | ||
promptResult: PromptResult; | ||
readonly promptResult: PromptResult; | ||
} |
@@ -6,2 +6,3 @@ import type { CommonToolsOptions } from '../../../execution/CommonToolsOptions'; | ||
import type { LlmToolsConfiguration } from '../../_common/register/LlmToolsConfiguration'; | ||
import type { CollectionRemoteServerClientOptions } from './RemoteServerOptions'; | ||
/** | ||
@@ -12,3 +13,3 @@ * Options for `RemoteLlmExecutionTools` | ||
*/ | ||
export type RemoteLlmExecutionToolsOptions = CommonToolsOptions & { | ||
export type RemoteLlmExecutionToolsOptions<TCustomOptions> = CommonToolsOptions & { | ||
/** | ||
@@ -34,3 +35,3 @@ * URL of the remote PROMPTBOOK server | ||
*/ | ||
isAnonymous: true; | ||
readonly isAnonymous: true; | ||
/** | ||
@@ -43,18 +44,12 @@ * Configuration for the LLM tools | ||
* | ||
* Note: this is passed to the certain model providers to identify misuse | ||
* Note: In anonymous mode it is not required to identify | ||
* Note: This is passed to the certain model providers to identify misuse | ||
* Note: In anonymous mode, there is no need to identify yourself, nor does it change the actual configuration of LLM Tools (unlike in application mode). | ||
*/ | ||
readonly userId?: string_user_id; | ||
} | { | ||
readonly userId: string_user_id | null; | ||
} | ({ | ||
/** | ||
* Use anonymous server with client identification and fixed collection | ||
*/ | ||
isAnonymous: false; | ||
/** | ||
* Identifier of the end user | ||
* | ||
* Note: this is passed to the certain model providers to identify misuse | ||
*/ | ||
readonly userId: string_user_id; | ||
}); | ||
readonly isAnonymous: false; | ||
} & CollectionRemoteServerClientOptions<TCustomOptions>)); | ||
/** | ||
@@ -61,0 +56,0 @@ * TODO: [π§ ][π] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'` |
import type { PipelineCollection } from '../../../collection/PipelineCollection'; | ||
import type { CommonToolsOptions } from '../../../execution/CommonToolsOptions'; | ||
import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools'; | ||
import type { string_app_id } from '../../../types/typeAliases'; | ||
import type { string_uri } from '../../../types/typeAliases'; | ||
@@ -11,3 +12,3 @@ import type { string_user_id } from '../../../types/typeAliases'; | ||
* | ||
* 1) **Collection mode** Server will recieve `collection` and execute prompts only from this collection | ||
* 1) **Application mode** Server will recieve `collection` and execute prompts only from this collection | ||
* 2) **Anonymous mode** Server will recieve full `LlmToolsConfiguration` (with api keys) and just acts as a proxy | ||
@@ -21,3 +22,3 @@ * In anonymous mode, `collection` will be ignored and any prompt will be executed | ||
*/ | ||
export type RemoteServerOptions = CommonToolsOptions & { | ||
export type RemoteServerOptions<TCustomOptions> = CommonToolsOptions & { | ||
/** | ||
@@ -34,3 +35,3 @@ * Port on which the server will listen | ||
readonly path: string_uri; | ||
} & (AnonymousRemoteServerOptions | CollectionRemoteServerOptions | (AnonymousRemoteServerOptions & CollectionRemoteServerOptions)); | ||
} & (AnonymousRemoteServerOptions | CollectionRemoteServerOptions<TCustomOptions> | (AnonymousRemoteServerOptions & CollectionRemoteServerOptions<TCustomOptions>)); | ||
export type AnonymousRemoteServerOptions = { | ||
@@ -42,7 +43,7 @@ /** | ||
}; | ||
export type CollectionRemoteServerOptions = { | ||
export type CollectionRemoteServerOptions<TCustomOptions> = { | ||
/** | ||
* Enable collection mode | ||
* Enable application mode | ||
*/ | ||
readonly isCollectionModeAllowed: true; | ||
readonly isApplicationModeAllowed: true; | ||
/** | ||
@@ -57,7 +58,20 @@ * Promptbook collection to use | ||
*/ | ||
createLlmExecutionTools(userId: string_user_id | undefined): LlmExecutionTools; | ||
createLlmExecutionTools(options: CollectionRemoteServerClientOptions<TCustomOptions>): LlmExecutionTools; | ||
}; | ||
export type CollectionRemoteServerClientOptions<TCustomOptions> = { | ||
/** | ||
* @@@ | ||
*/ | ||
readonly appId: string_app_id | null; | ||
/** | ||
* @@@ | ||
*/ | ||
readonly userId: string_user_id | null; | ||
/** | ||
* @@@ | ||
*/ | ||
readonly customOptions?: TCustomOptions; | ||
}; | ||
/** | ||
* TODO: Constrain anonymous mode for specific models / providers | ||
* TODO: [π§ ][π€Ί] Remove `createLlmExecutionTools`, pass just `llmExecutionTools` | ||
*/ |
@@ -22,5 +22,5 @@ import type { AvailableModel } from '../../execution/AvailableModel'; | ||
*/ | ||
export declare class RemoteLlmExecutionTools implements LlmExecutionTools { | ||
protected readonly options: RemoteLlmExecutionToolsOptions; | ||
constructor(options: RemoteLlmExecutionToolsOptions); | ||
export declare class RemoteLlmExecutionTools<TCustomOptions = undefined> implements LlmExecutionTools { | ||
protected readonly options: RemoteLlmExecutionToolsOptions<TCustomOptions>; | ||
constructor(options: RemoteLlmExecutionToolsOptions<TCustomOptions>); | ||
get title(): string_title & string_markdown_text; | ||
@@ -27,0 +27,0 @@ get description(): string_markdown; |
@@ -12,3 +12,3 @@ import type { IDestroyable } from 'destroyable'; | ||
*/ | ||
export declare function startRemoteServer(options: RemoteServerOptions): IDestroyable; | ||
export declare function startRemoteServer<TCustomOptions = undefined>(options: RemoteServerOptions<TCustomOptions>): IDestroyable; | ||
/** | ||
@@ -15,0 +15,0 @@ * TODO: Maybe use `$asDeeplyFrozenSerializableJson` |
@@ -110,2 +110,3 @@ import type { FormatCommand } from '../commands/FORMAT/FormatCommand'; | ||
* TODO: [π³] Add options for translation - maybe create `TranslationPrompt` | ||
* TODO: [π§ ][π€Ί] Maybe allow overriding of `userId` for each prompt | ||
*/ |
@@ -354,8 +354,2 @@ import type { TupleToUnion } from 'type-fest'; | ||
/** | ||
* Semantic helper, ID of the board used in URL and API | ||
* | ||
* For example `"9SeSQTupmQHwuSrLi"` <- TODO: !! Update | ||
*/ | ||
export type string_uriid = string_uri_part; | ||
/** | ||
* Semantic helper | ||
@@ -403,6 +397,14 @@ * | ||
/** | ||
* End user identifier; | ||
* Application identifier | ||
* | ||
* @@@ | ||
*/ | ||
export type string_user_id = string; | ||
export type string_app_id = id; | ||
/** | ||
* End user identifier | ||
* | ||
* @@@ | ||
*/ | ||
export type string_user_id = id; | ||
/** | ||
* Semantic helper | ||
@@ -528,2 +530,3 @@ * | ||
export type string_postprocessing_function_name = string; | ||
export type id = string | number; | ||
export type string_token = string; | ||
@@ -530,0 +533,0 @@ export type string_license_token = string_token; |
{ | ||
"name": "@promptbook/anthropic-claude", | ||
"version": "0.72.0-9", | ||
"version": "0.72.0-10", | ||
"description": "Supercharge your use of large language models", | ||
@@ -54,3 +54,3 @@ "private": false, | ||
"peerDependencies": { | ||
"@promptbook/core": "0.72.0-9" | ||
"@promptbook/core": "0.72.0-10" | ||
}, | ||
@@ -57,0 +57,0 @@ "dependencies": { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
729281
13944