@promptbook/browser 0.104.0-11 → 0.104.0-12
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/esm/index.es.js +64 -23
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/types.index.d.ts +2 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +1 -0
- package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +5 -0
- package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirements.tools.test.d.ts +1 -0
- package/esm/typings/src/commitments/META/META_DESCRIPTION.d.ts +41 -0
- package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +2 -2
- 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 -1
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +1 -1
- package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/utils/mapToolsToOpenAi.d.ts +8 -0
- package/esm/typings/src/search-engines/SearchResult.d.ts +4 -4
- package/esm/typings/src/search-engines/bing/BingSearchEngine.d.ts +1 -1
- package/esm/typings/src/search-engines/dummy/DummySearchEngine.d.ts +1 -1
- package/esm/typings/src/types/LlmToolDefinition.d.ts +20 -0
- package/esm/typings/src/types/ModelRequirements.d.ts +13 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +64 -23
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -19,7 +19,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
19
19
|
* @generated
|
|
20
20
|
* @see https://github.com/webgptorg/promptbook
|
|
21
21
|
*/
|
|
22
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.104.0-
|
|
22
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.104.0-12';
|
|
23
23
|
/**
|
|
24
24
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
25
25
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -5716,19 +5716,37 @@ class UseBrowserCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
5716
5716
|
`);
|
|
5717
5717
|
}
|
|
5718
5718
|
applyToAgentModelRequirements(requirements, content) {
|
|
5719
|
-
// We simply mark that browser capability is enabled in metadata
|
|
5720
|
-
// Get existing metadata
|
|
5721
|
-
const existingMetadata = requirements.metadata || {};
|
|
5722
5719
|
// Get existing tools array or create new one
|
|
5723
|
-
const existingTools =
|
|
5724
|
-
// Add '
|
|
5725
|
-
const updatedTools = existingTools.
|
|
5726
|
-
|
|
5720
|
+
const existingTools = requirements.tools || [];
|
|
5721
|
+
// Add 'web_browser' to tools if not already present
|
|
5722
|
+
const updatedTools = existingTools.some((tool) => tool.name === 'web_browser')
|
|
5723
|
+
? existingTools
|
|
5724
|
+
: [
|
|
5725
|
+
...existingTools,
|
|
5726
|
+
{
|
|
5727
|
+
name: 'web_browser',
|
|
5728
|
+
description: spaceTrim$1(`
|
|
5729
|
+
A tool that can browse the web.
|
|
5730
|
+
Use this tool when you need to access specific websites or browse the internet.
|
|
5731
|
+
`),
|
|
5732
|
+
parameters: {
|
|
5733
|
+
type: 'object',
|
|
5734
|
+
properties: {
|
|
5735
|
+
url: {
|
|
5736
|
+
type: 'string',
|
|
5737
|
+
description: 'The URL to browse',
|
|
5738
|
+
},
|
|
5739
|
+
},
|
|
5740
|
+
required: ['url'],
|
|
5741
|
+
},
|
|
5742
|
+
},
|
|
5743
|
+
];
|
|
5744
|
+
// Return requirements with updated tools and metadata
|
|
5727
5745
|
return {
|
|
5728
5746
|
...requirements,
|
|
5747
|
+
tools: updatedTools,
|
|
5729
5748
|
metadata: {
|
|
5730
|
-
...
|
|
5731
|
-
tools: updatedTools,
|
|
5749
|
+
...requirements.metadata,
|
|
5732
5750
|
useBrowser: true,
|
|
5733
5751
|
},
|
|
5734
5752
|
};
|
|
@@ -5821,13 +5839,13 @@ class UseMcpCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
5821
5839
|
* The `USE SEARCH ENGINE` commitment indicates that the agent should utilize a search engine tool
|
|
5822
5840
|
* to access and retrieve up-to-date information from the internet when necessary.
|
|
5823
5841
|
*
|
|
5824
|
-
* The content following `USE SEARCH ENGINE` is
|
|
5842
|
+
* The content following `USE SEARCH ENGINE` is an arbitrary text that the agent should know (e.g. search scope or instructions).
|
|
5825
5843
|
*
|
|
5826
5844
|
* Example usage in agent source:
|
|
5827
5845
|
*
|
|
5828
5846
|
* ```book
|
|
5829
5847
|
* USE SEARCH ENGINE
|
|
5830
|
-
* USE SEARCH ENGINE
|
|
5848
|
+
* USE SEARCH ENGINE Hledej informace o Přemyslovcích
|
|
5831
5849
|
* ```
|
|
5832
5850
|
*
|
|
5833
5851
|
* @private [🪔] Maybe export the commitments through some package
|
|
@@ -5859,7 +5877,7 @@ class UseSearchEngineCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
5859
5877
|
|
|
5860
5878
|
## Key aspects
|
|
5861
5879
|
|
|
5862
|
-
- The content following \`USE SEARCH ENGINE\` is
|
|
5880
|
+
- The content following \`USE SEARCH ENGINE\` is an arbitrary text that the agent should know (e.g. search scope or instructions).
|
|
5863
5881
|
- The actual search engine tool usage is handled by the agent runtime
|
|
5864
5882
|
- Allows the agent to search for current information from the web
|
|
5865
5883
|
- Useful for research tasks, finding facts, and accessing dynamic content
|
|
@@ -5884,20 +5902,39 @@ class UseSearchEngineCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
5884
5902
|
`);
|
|
5885
5903
|
}
|
|
5886
5904
|
applyToAgentModelRequirements(requirements, content) {
|
|
5887
|
-
// We simply mark that search engine capability is enabled in metadata
|
|
5888
|
-
// Get existing metadata
|
|
5889
|
-
const existingMetadata = requirements.metadata || {};
|
|
5890
5905
|
// Get existing tools array or create new one
|
|
5891
|
-
const existingTools =
|
|
5892
|
-
// Add '
|
|
5893
|
-
const updatedTools = existingTools.
|
|
5894
|
-
|
|
5906
|
+
const existingTools = requirements.tools || [];
|
|
5907
|
+
// Add 'web_search' to tools if not already present
|
|
5908
|
+
const updatedTools = existingTools.some((tool) => tool.name === 'web_search')
|
|
5909
|
+
? existingTools
|
|
5910
|
+
: [
|
|
5911
|
+
...existingTools,
|
|
5912
|
+
{
|
|
5913
|
+
name: 'web_search',
|
|
5914
|
+
description: spaceTrim$1(`
|
|
5915
|
+
Search the internet for information.
|
|
5916
|
+
Use this tool when you need to find up-to-date information or facts that you don't know.
|
|
5917
|
+
${!content ? '' : `Search scope / instructions: ${content}`}
|
|
5918
|
+
`),
|
|
5919
|
+
parameters: {
|
|
5920
|
+
type: 'object',
|
|
5921
|
+
properties: {
|
|
5922
|
+
query: {
|
|
5923
|
+
type: 'string',
|
|
5924
|
+
description: 'The search query',
|
|
5925
|
+
},
|
|
5926
|
+
},
|
|
5927
|
+
required: ['query'],
|
|
5928
|
+
},
|
|
5929
|
+
},
|
|
5930
|
+
];
|
|
5931
|
+
// Return requirements with updated tools and metadata
|
|
5895
5932
|
return {
|
|
5896
5933
|
...requirements,
|
|
5934
|
+
tools: updatedTools,
|
|
5897
5935
|
metadata: {
|
|
5898
|
-
...
|
|
5899
|
-
|
|
5900
|
-
useSearchEngine: true,
|
|
5936
|
+
...requirements.metadata,
|
|
5937
|
+
useSearchEngine: content || true,
|
|
5901
5938
|
},
|
|
5902
5939
|
};
|
|
5903
5940
|
}
|
|
@@ -6362,6 +6399,10 @@ function parseAgentSource(agentSource) {
|
|
|
6362
6399
|
meta.image = spaceTrim$2(commitment.content);
|
|
6363
6400
|
continue;
|
|
6364
6401
|
}
|
|
6402
|
+
if (commitment.type === 'META DESCRIPTION') {
|
|
6403
|
+
meta.description = spaceTrim$2(commitment.content);
|
|
6404
|
+
continue;
|
|
6405
|
+
}
|
|
6365
6406
|
if (commitment.type === 'META COLOR') {
|
|
6366
6407
|
meta.color = normalizeSeparator(commitment.content);
|
|
6367
6408
|
continue;
|