@promptbook/openai 0.101.0-2 โ 0.101.0-21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -29
- package/esm/index.es.js +266 -177
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/components.index.d.ts +20 -0
- package/esm/typings/src/_packages/core.index.d.ts +14 -0
- package/esm/typings/src/_packages/types.index.d.ts +14 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +41 -3
- package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +3 -0
- package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +4 -22
- package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.d.ts +1 -26
- package/esm/typings/src/book-2.0/agent-source/parseParameters.d.ts +13 -0
- package/esm/typings/src/book-2.0/commitments/ACTION/ACTION.d.ts +2 -8
- package/esm/typings/src/book-2.0/commitments/DELETE/DELETE.d.ts +35 -0
- package/esm/typings/src/book-2.0/commitments/FORMAT/FORMAT.d.ts +2 -8
- package/esm/typings/src/book-2.0/commitments/GOAL/GOAL.d.ts +33 -0
- package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +0 -6
- package/esm/typings/src/book-2.0/commitments/MEMORY/MEMORY.d.ts +34 -0
- package/esm/typings/src/book-2.0/commitments/MESSAGE/MESSAGE.d.ts +35 -0
- package/esm/typings/src/book-2.0/commitments/META/META.d.ts +56 -0
- package/esm/typings/src/book-2.0/commitments/META_IMAGE/META_IMAGE.d.ts +0 -6
- package/esm/typings/src/book-2.0/commitments/META_LINK/META_LINK.d.ts +0 -6
- package/esm/typings/src/book-2.0/commitments/MODEL/MODEL.d.ts +25 -10
- package/esm/typings/src/book-2.0/commitments/NOTE/NOTE.d.ts +2 -8
- package/esm/typings/src/book-2.0/commitments/PERSONA/PERSONA.d.ts +2 -8
- package/esm/typings/src/book-2.0/commitments/RULE/RULE.d.ts +0 -12
- package/esm/typings/src/book-2.0/commitments/SAMPLE/SAMPLE.d.ts +0 -12
- package/esm/typings/src/book-2.0/commitments/SCENARIO/SCENARIO.d.ts +34 -0
- package/esm/typings/src/book-2.0/commitments/STYLE/STYLE.d.ts +2 -8
- package/esm/typings/src/book-2.0/commitments/_base/createEmptyAgentModelRequirements.d.ts +1 -1
- package/esm/typings/src/book-2.0/commitments/index.d.ts +7 -3
- package/esm/typings/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +3 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarChip/AvatarChip.d.ts +5 -2
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +3 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/MockedChat.d.ts +63 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/index.d.ts +3 -0
- package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +18 -0
- package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +2 -12
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +29 -0
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +13 -0
- package/esm/typings/src/book-components/Chat/hooks/index.d.ts +2 -0
- package/esm/typings/src/book-components/Chat/hooks/useChatAutoScroll.d.ts +41 -0
- package/esm/typings/src/book-components/Chat/hooks/useSendMessageToLlmChat.d.ts +44 -0
- package/esm/typings/src/book-components/Chat/utils/parseMessageButtons.d.ts +22 -0
- package/esm/typings/src/book-components/icons/PauseIcon.d.ts +8 -0
- package/esm/typings/src/book-components/icons/PlayIcon.d.ts +8 -0
- package/esm/typings/src/execution/PromptResult.d.ts +2 -4
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -2
- package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +1 -3
- package/esm/typings/src/formats/csv/CsvFormatError.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +1 -2
- package/esm/typings/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +8 -2
- package/esm/typings/src/llm-providers/_common/utils/removeUnsupportedModelRequirements.d.ts +25 -0
- package/esm/typings/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +7 -18
- package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +11 -0
- package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +2 -1
- package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +58 -0
- package/esm/typings/src/llm-providers/agent/createAgentLlmExecutionTools.d.ts +29 -0
- package/esm/typings/src/llm-providers/agent/playground/playground.d.ts +8 -0
- package/esm/typings/src/llm-providers/agent/register-configuration.d.ts +11 -0
- package/esm/typings/src/llm-providers/agent/register-constructor.d.ts +13 -0
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +3 -8
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +4 -5
- package/esm/typings/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -0
- package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +4 -10
- package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +4 -6
- package/esm/typings/src/llm-providers/ollama/OllamaExecutionTools.d.ts +3 -3
- package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +16 -8
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +3 -8
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +5 -14
- package/esm/typings/src/personas/preparePersona.d.ts +1 -0
- package/esm/typings/src/remote-server/openapi-types.d.ts +31 -31
- package/esm/typings/src/scrapers/markdown/MarkdownScraper.d.ts +1 -2
- package/esm/typings/src/types/ModelRequirements.d.ts +2 -4
- package/esm/typings/src/utils/color/utils/colorSaturation.d.ts +1 -1
- package/esm/typings/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +1 -1
- package/esm/typings/src/utils/markdown/humanizeAiText.d.ts +1 -1
- package/esm/typings/src/utils/markdown/promptbookifyAiText.d.ts +2 -2
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +266 -177
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/book-2.0/utils/extractAgentMetadata.d.ts +0 -17
- package/esm/typings/src/book-2.0/utils/extractProfileImageFromSystemMessage.d.ts +0 -12
- package/esm/typings/src/book-components/Chat/examples/ChatMarkdownDemo.d.ts +0 -16
- package/esm/typings/src/expectations/drafts/isDomainNameFree.d.ts +0 -10
- package/esm/typings/src/expectations/drafts/isGithubNameFree.d.ts +0 -10
- package/esm/typings/src/llm-providers/_common/profiles/llmProviderProfiles.d.ts +0 -81
- /package/esm/typings/src/llm-providers/_common/{profiles/test/llmProviderProfiles.test.d.ts โ utils/removeUnsupportedModelRequirements.test.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -48,28 +48,32 @@ npm i ptbk
|
|
|
48
48
|
npm install @promptbook/openai
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
OpenAI integration for Promptbook, providing execution tools for OpenAI GPT models, OpenAI Assistants, and OpenAI-compatible APIs within the Promptbook ecosystem.
|
|
52
52
|
|
|
53
53
|
## ๐ฏ Purpose and Motivation
|
|
54
54
|
|
|
55
|
-
This package bridges the gap between Promptbook's unified pipeline execution system and OpenAI's powerful language models. It provides a standardized interface for accessing OpenAI's various services while maintaining compatibility with Promptbook's execution framework.
|
|
55
|
+
This package bridges the gap between Promptbook's unified pipeline execution system and OpenAI's powerful language models. It provides a standardized interface for accessing OpenAI's various services while maintaining compatibility with Promptbook's execution framework, enabling seamless integration with different OpenAI offerings.
|
|
56
56
|
|
|
57
57
|
## ๐ง High-Level Functionality
|
|
58
58
|
|
|
59
59
|
The package offers three main integration paths:
|
|
60
|
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
60
|
+
|
|
61
|
+
- **Standard OpenAI API**: Direct integration with OpenAI's chat completions and embeddings
|
|
62
|
+
- **OpenAI Assistants**: Integration with OpenAI's Assistant API (GPTs)
|
|
63
|
+
- **OpenAI-Compatible APIs**: Support for third-party APIs that follow OpenAI's interface
|
|
64
|
+
- **Model Management**: Automatic model selection and configuration
|
|
65
|
+
- **Usage Tracking**: Built-in monitoring for tokens and costs
|
|
63
66
|
|
|
64
67
|
## โจ Key Features
|
|
65
68
|
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
69
|
+
- ๐ค **Multiple OpenAI Integrations** - Support for standard API, Assistants, and compatible services
|
|
70
|
+
- ๐ **Seamless Provider Switching** - Easy integration with other LLM providers
|
|
71
|
+
- ๐ฏ **Model Selection** - Access to all available OpenAI models with automatic selection
|
|
72
|
+
- ๐ง **Configuration Flexibility** - Support for custom endpoints, API keys, and parameters
|
|
73
|
+
- ๐ **Usage Tracking** - Built-in token usage and cost monitoring
|
|
74
|
+
- ๐ก๏ธ **Error Handling** - Comprehensive error handling and retry logic
|
|
75
|
+
- ๐ **Performance Optimization** - Caching and request optimization
|
|
76
|
+
- ๐ **OpenAI-Compatible Server** - Use Promptbook books as OpenAI-compatible models
|
|
73
77
|
|
|
74
78
|
## ๐งก Usage
|
|
75
79
|
|
|
@@ -323,36 +327,46 @@ This allows you to:
|
|
|
323
327
|
- Integrate Promptbook into existing OpenAI-based applications
|
|
324
328
|
- Use Promptbook books as models in other AI frameworks
|
|
325
329
|
|
|
330
|
+
|
|
331
|
+
|
|
326
332
|
## ๐ฆ Exported Entities
|
|
327
333
|
|
|
328
334
|
### Version Information
|
|
329
|
-
|
|
330
|
-
-
|
|
335
|
+
|
|
336
|
+
- `BOOK_LANGUAGE_VERSION` - Current book language version
|
|
337
|
+
- `PROMPTBOOK_ENGINE_VERSION` - Current engine version
|
|
331
338
|
|
|
332
339
|
### Execution Tools Creation Functions
|
|
333
|
-
|
|
334
|
-
-
|
|
335
|
-
-
|
|
340
|
+
|
|
341
|
+
- `createOpenAiAssistantExecutionTools` - Create OpenAI Assistant execution tools
|
|
342
|
+
- `createOpenAiCompatibleExecutionTools` - Create OpenAI-compatible execution tools
|
|
343
|
+
- `createOpenAiExecutionTools` - Create standard OpenAI execution tools
|
|
336
344
|
|
|
337
345
|
### Model Information
|
|
338
|
-
|
|
346
|
+
|
|
347
|
+
- `OPENAI_MODELS` - Available OpenAI models configuration
|
|
339
348
|
|
|
340
349
|
### Execution Tools Classes
|
|
341
|
-
|
|
342
|
-
-
|
|
343
|
-
-
|
|
350
|
+
|
|
351
|
+
- `OpenAiAssistantExecutionTools` - OpenAI Assistant execution tools class
|
|
352
|
+
- `OpenAiCompatibleExecutionTools` - OpenAI-compatible execution tools class
|
|
353
|
+
- `OpenAiExecutionTools` - Standard OpenAI execution tools class
|
|
344
354
|
|
|
345
355
|
### Configuration Types
|
|
346
|
-
|
|
347
|
-
-
|
|
348
|
-
-
|
|
349
|
-
-
|
|
350
|
-
-
|
|
356
|
+
|
|
357
|
+
- `OpenAiAssistantExecutionToolsOptions` - Configuration options for OpenAI Assistant tools (type)
|
|
358
|
+
- `OpenAiCompatibleExecutionToolsOptions` - Configuration options for OpenAI-compatible tools (type)
|
|
359
|
+
- `OpenAiCompatibleExecutionToolsNonProxiedOptions` - Non-proxied configuration options (type)
|
|
360
|
+
- `OpenAiCompatibleExecutionToolsProxiedOptions` - Proxied configuration options (type)
|
|
361
|
+
- `OpenAiExecutionToolsOptions` - Configuration options for standard OpenAI tools (type)
|
|
351
362
|
|
|
352
363
|
### Provider Registrations
|
|
353
|
-
|
|
354
|
-
-
|
|
355
|
-
-
|
|
364
|
+
|
|
365
|
+
- `_OpenAiRegistration` - Standard OpenAI provider registration
|
|
366
|
+
- `_OpenAiAssistantRegistration` - OpenAI Assistant provider registration
|
|
367
|
+
- `_OpenAiCompatibleRegistration` - OpenAI-compatible provider registration
|
|
368
|
+
|
|
369
|
+
> ๐ก This package provides OpenAI integration for promptbook applications. For the core functionality, see [@promptbook/core](#-packages) or install all packages with `npm i ptbk`
|
|
356
370
|
|
|
357
371
|
|
|
358
372
|
---
|