From 3fee7250206cb6bbf21e0621701f25f2f73dc216 Mon Sep 17 00:00:00 2001 From: Matthew Lipski Date: Tue, 21 Apr 2026 12:31:06 +0200 Subject: [PATCH 1/2] Fixed clicking non-editable links opening 2 new tabs instead of 1 --- .../tiptap-extensions/Link/helpers/clickHandler.ts | 10 ++++++++-- .../core/src/extensions/tiptap-extensions/Link/link.ts | 2 ++ .../blocknoteHTML/hardbreak/between-links.html | 4 ++++ .../__snapshots__/blocknoteHTML/hardbreak/link.html | 4 ++++ .../__snapshots__/blocknoteHTML/link/adjacent.html | 4 ++++ .../export/__snapshots__/blocknoteHTML/link/basic.html | 2 ++ .../__snapshots__/blocknoteHTML/link/styled.html | 4 ++++ .../__snapshots__/html/hardbreak/between-links.html | 4 ++++ .../export/__snapshots__/html/hardbreak/link.html | 4 ++++ .../export/__snapshots__/html/link/adjacent.html | 4 ++++ .../export/__snapshots__/html/link/basic.html | 2 ++ .../export/__snapshots__/html/link/styled.html | 4 ++++ 12 files changed, 46 insertions(+), 2 deletions(-) diff --git a/packages/core/src/extensions/tiptap-extensions/Link/helpers/clickHandler.ts b/packages/core/src/extensions/tiptap-extensions/Link/helpers/clickHandler.ts index fe31821e77..ba8f9fa131 100644 --- a/packages/core/src/extensions/tiptap-extensions/Link/helpers/clickHandler.ts +++ b/packages/core/src/extensions/tiptap-extensions/Link/helpers/clickHandler.ts @@ -23,7 +23,11 @@ export function clickHandler(options: ClickHandlerOptions): Plugin { let link: HTMLAnchorElement | null = null; - if (event.target instanceof HTMLAnchorElement) { + if ( + event.target instanceof HTMLAnchorElement && + // Differentiate between link inline content and read-only links. + event.target.getAttribute("data-inline-content-type") === "link" + ) { link = event.target; } else { const target = event.target as HTMLElement | null; @@ -35,7 +39,9 @@ export function clickHandler(options: ClickHandlerOptions): Plugin { // Intentionally limit the lookup to the editor root. // Using tag names like DIV as boundaries breaks with custom NodeViews, - link = target.closest("a"); + link = target.closest( + 'a[data-inline-content-type="link"]', + ); if (link && !root.contains(link)) { link = null; diff --git a/packages/core/src/extensions/tiptap-extensions/Link/link.ts b/packages/core/src/extensions/tiptap-extensions/Link/link.ts index c0c1811d4f..b6ac0fa5e6 100644 --- a/packages/core/src/extensions/tiptap-extensions/Link/link.ts +++ b/packages/core/src/extensions/tiptap-extensions/Link/link.ts @@ -12,6 +12,8 @@ const DEFAULT_PROTOCOL = "https"; const HTML_ATTRIBUTES = { target: "_blank", rel: "noopener noreferrer nofollow", + className: "bn-inline-content-section", + "data-inline-content-type": "link", }; // Pre-compiled regex for URI protocol validation. diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/between-links.html b/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/between-links.html index 9e4b427c62..fbe9ef135f 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/between-links.html +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/between-links.html @@ -6,12 +6,16 @@ Link1
Link2

diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/link.html b/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/link.html index 4cae02d67b..691a663449 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/link.html +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/link.html @@ -6,12 +6,16 @@ Link1
Link1

diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/link/adjacent.html b/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/link/adjacent.html index 2408c611ac..b89f21cd59 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/link/adjacent.html +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/link/adjacent.html @@ -6,11 +6,15 @@ Website Website2

diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/link/basic.html b/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/link/basic.html index 3daea90831..bfc8c80945 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/link/basic.html +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/link/basic.html @@ -6,6 +6,8 @@ Website

diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/link/styled.html b/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/link/styled.html index 2b9d4cb574..6c67039ff9 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/link/styled.html +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/link/styled.html @@ -7,12 +7,16 @@ Web site

diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/html/hardbreak/between-links.html b/tests/src/unit/core/formatConversion/export/__snapshots__/html/hardbreak/between-links.html index 701b5d4213..7b074b0120 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/html/hardbreak/between-links.html +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/html/hardbreak/between-links.html @@ -2,12 +2,16 @@ Link1
Link2

\ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/html/hardbreak/link.html b/tests/src/unit/core/formatConversion/export/__snapshots__/html/hardbreak/link.html index 2c762aedc5..aab38c859f 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/html/hardbreak/link.html +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/html/hardbreak/link.html @@ -2,12 +2,16 @@ Link1
Link1

\ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/html/link/adjacent.html b/tests/src/unit/core/formatConversion/export/__snapshots__/html/link/adjacent.html index db99691d33..e37cee5aa7 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/html/link/adjacent.html +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/html/link/adjacent.html @@ -2,11 +2,15 @@ Website Website2

\ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/html/link/basic.html b/tests/src/unit/core/formatConversion/export/__snapshots__/html/link/basic.html index 4b61e8c582..6174bf9428 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/html/link/basic.html +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/html/link/basic.html @@ -2,6 +2,8 @@ Website

\ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/html/link/styled.html b/tests/src/unit/core/formatConversion/export/__snapshots__/html/link/styled.html index fb7737f7f8..fd2832b117 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/html/link/styled.html +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/html/link/styled.html @@ -3,12 +3,16 @@ Web site

\ No newline at end of file From 85a83208fcc811a6bb8ae5c9d2f0870906a823fc Mon Sep 17 00:00:00 2001 From: Nick the Sick Date: Wed, 22 Apr 2026 15:11:42 +0200 Subject: [PATCH 2/2] fix: migrate MSW snapshot hashes after schema change to link HTML The link refactor changed the HTML representation of tags by adding classname="bn-inline-content-section" data-inline-content-type="link" attributes. This changed the request bodies sent to LLM providers in tests, which broke the MD5 hash-based MSW snapshot filenames. Additionally, the test runtime now captures actual request headers (authorization, content-type, etc.) instead of empty arrays, further changing the hashes. 57 snapshot files were migrated (56 via script + 1 manual fix): - Old-hash files deleted, new-hash files created with the same valid 200 response bodies transplanted from the originals. ## How MSW Snapshot Hashing Works Each test records HTTP requests via msw-snapshot. The snapshot filename includes an MD5 hash computed from: [method, url.origin, url.pathname, sorted(searchParams), sorted(headers), body] See createRequestHash() in each test file (e.g. htmlBlocks.test.ts:22). The hash function is toHashString() from msw-snapshot, which does: crypto.createHash('md5').update(JSON.stringify(array), 'binary').digest('hex') ## How to Migrate Snapshots When Schema Changes When a code change alters the HTML/content sent to LLM providers, the request body changes, which changes the hash, which means snapshot files won't be found by filename. ### Step 1: Run the tests to create duplicate snapshots cd packages/xl-ai && npm run test Tests with hash mismatches will try to fetch from real servers (which will fail without API keys), creating NEW snapshot files with correct hashes but 401 error responses alongside the OLD files with valid 200 responses. The validateTestEnvironment test will report duplicates. ### Step 2: Identify duplicate pairs For each test directory under __msw_snapshots__/{provider}/{model}/, look for snapshot pairs with the same test name prefix but different hashes. The OLD file (valid 200 response, older mtime) needs its response transplanted into the NEW file (401 error, newer mtime). ### Step 3: Transplant responses For each duplicate pair: 1. Read the response body from the OLD file (status 200) 2. Write that response into the NEW file (replacing the 401 error) 3. Delete the OLD file This can be scripted in Python: import json, os, glob from collections import defaultdict base = 'packages/xl-ai/src/api/formats/html-blocks/__snapshots__' files = glob.glob(f'{base}/**/*.json', recursive=True) # Group by test name prefix (everything before the hash) groups = defaultdict(list) for f in files: name = os.path.basename(f) # Pattern: testname_N_hash.json prefix = '_'.join(name.rsplit('_', 1)[:-1]) groups[prefix].append(f) for prefix, paths in groups.items(): if len(paths) == 2: # Identify old (200) vs new (401) by checking response status for p in paths: data = json.load(open(p)) if data['response']['status'] == 200: old_file, old_data = p, data else: new_file = p # Transplant response new_data = json.load(open(new_file)) new_data['response'] = old_data['response'] json.dump(new_data, open(new_file, 'w'), indent=2) os.remove(old_file) ### Step 4: Handle edge cases Some tests may fail with 'TypeError: unusable' at Request.clone in msw-snapshot. This happens when a snapshot hash changed but the test crashes before creating a new file (no duplicate pair to migrate). To fix these: 1. Add debug logging in createSnapshotPath to print the computed hash 2. Run the failing test to get the new hash 3. Rename the old snapshot file to use the new hash 4. Remove the debug logging ### Step 5: Verify cd packages/xl-ai && npm run test All tests should pass and the duplicate validation test should be green. --- ...h_1_801ad86e0c3a4562338793805e66a52f.json} | 25 +++++++++++++++++-- ...n_1_b6ecf36636295d284db3ba7243cd4835.json} | 25 +++++++++++++++++-- ...h_1_3c276441275032fe98b12356026537a0.json} | 17 +++++++++++-- ...n_1_0207de852025d2c0a1d417a7d66fa03c.json} | 17 +++++++++++-- ...h_1_937647a13580b4dbb611e3de3b2c8788.json} | 17 +++++++++++-- ...n_1_d9ea724851130649f405ff50190452b5.json} | 17 +++++++++++-- ...k_1_afd5ee1bda075c7482d1861d03ad0a29.json} | 25 +++++++++++++++++-- ...k_1_9a26ba1fa4692c62b4f519ed3669fdc5.json} | 17 +++++++++++-- ...k_1_2fd92a4c2642fff1ef49d65014aa1ac3.json} | 17 +++++++++++-- ...k_1_fd54b2fefac722ab5057252b68c4faec.json} | 25 +++++++++++++++++-- ...k_1_93038afbc107d8439571e6287fc76a8f.json} | 25 +++++++++++++++++-- ...n_1_7035efab1f6d9e5a46dde12d39f9ed19.json} | 25 +++++++++++++++++-- ...e_1_467258028a5a6bef3542c1a5417d4b3d.json} | 25 +++++++++++++++++-- ...k_1_90c0b37bad31f3b9b0d15c492c610d0b.json} | 25 +++++++++++++++++-- ...n_1_3e8b04b91ca15c467180df1c60c9e1b2.json} | 25 +++++++++++++++++-- ...t_1_3551fccc96307281574c2c96eaa05002.json} | 25 +++++++++++++++++-- ...p_1_e7ef562479ab33624bfa2bd75c4d1f5e.json} | 25 +++++++++++++++++-- ...t_1_3a3fa0950f819e8073475e78106b353d.json} | 25 +++++++++++++++++-- ...)_1_7a05ed5acf369206dda586e41235430b.json} | 25 +++++++++++++++++-- ...)_1_0d9c02b01414a68a2dab4af392179183.json} | 25 +++++++++++++++++-- ...n_1_ade79bca32d420b4323b2a888817b5d5.json} | 25 +++++++++++++++++-- ...t_1_f90879213f18f8b8e13748443299b6dc.json} | 25 +++++++++++++++++-- ...p_1_3f8e13d1cfa75e24cd4e0dfb0eab9ef4.json} | 25 +++++++++++++++++-- ...t_1_07d3d8730ff541c3a2bf5e53c6707dac.json} | 25 +++++++++++++++++-- ...e_1_6cc7ad0b6e2c278095f03deb353e4c9b.json} | 0 ...k_1_17fe180166622808ade902a2eccad8aa.json} | 17 +++++++++++-- ...k_1_a055d5e9dcf9d3ce1e1cddf57b441dc1.json} | 17 +++++++++++-- ...n_1_7692c767dc159df75724f2a49cc38b0e.json} | 17 +++++++++++-- ...e_1_b81e76afad4cf5e84bd6815d2bc8d069.json} | 17 +++++++++++-- ...k_1_da7d1e5e03db624c6007dc8137fc3588.json} | 17 +++++++++++-- ...n_1_758855f114117cd6c8f70c7caa84cc68.json} | 17 +++++++++++-- ...t_1_222775b0c617ba9bcada86cd238b6d64.json} | 17 +++++++++++-- ...p_1_ad74c153b3f0beb850955148f0a42c78.json} | 17 +++++++++++-- ...t_1_4bf0b01b1e009966973599ebc2194362.json} | 17 +++++++++++-- ...)_1_5ce19f53eaf195c6e284c91b0db7d586.json} | 17 +++++++++++-- ...)_1_0f8ce96b644d6bd531f0558208cf5790.json} | 17 +++++++++++-- ...n_1_1cf9377128e689feac5e5e13a1d0e26f.json} | 17 +++++++++++-- ...t_1_260e8bc6dd5c9cbd0650701e6d95ada3.json} | 17 +++++++++++-- ...p_1_339e6b8d82d281185c6ccbcd1809374f.json} | 17 +++++++++++-- ...t_1_ff26ae30546f4e0d4279e60e4b7a1fbf.json} | 17 +++++++++++-- ...e_1_d9cbf71a8b55c8be0b247c3bb200c59c.json} | 17 +++++++++++-- ...k_1_d1f45ba6fee8787529137c920d6bc58e.json} | 17 +++++++++++-- ...k_1_c9489269d9a2d4353eda54289ed7f395.json} | 17 +++++++++++-- ...n_1_416931598559b3e7e906647a66f0b8b1.json} | 17 +++++++++++-- ...e_1_9728e4dd714a6a14ce441d72378dd67a.json} | 17 +++++++++++-- ...k_1_198059a270dbbb88db8f1cba97503205.json} | 17 +++++++++++-- ...n_1_9313219c085c3b39c7c14c00f388b4be.json} | 17 +++++++++++-- ...t_1_f7a4c2a7fc5e362c3484586f45b2501d.json} | 17 +++++++++++-- ...p_1_38090ebbfaca38fca97b1e4f0a0dd942.json} | 17 +++++++++++-- ...t_1_6374879c3f8fbc16db7c43304d2faacd.json} | 17 +++++++++++-- ...)_1_0afac4d00d3f0bbdfd251a8394b6ff28.json} | 17 +++++++++++-- ...)_1_00156bb4dd5722d44e0ff5332561928a.json} | 17 +++++++++++-- ...n_1_24abe901176e9d834f9542d0b26e82ae.json} | 17 +++++++++++-- ...t_1_3f479c81e81f4f9460df3af74ddd2207.json} | 17 +++++++++++-- ...p_1_6012638796e6e00b242b43642bb90a7a.json} | 17 +++++++++++-- ...t_1_04e027a89c6d4e69a0f805d5c8987e2c.json} | 17 +++++++++++-- ...e_1_72aecf62b6c9c807411d248d46a62eea.json} | 17 +++++++++++-- 57 files changed, 984 insertions(+), 112 deletions(-) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{add and update paragraph_1_380a0c02b5089b38247457135c044cf7.json => add and update paragraph_1_801ad86e0c3a4562338793805e66a52f.json} (77%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{add paragraph and update selection_1_298b51bb28c5f95ab9a00205d4e38460.json => add paragraph and update selection_1_b6ecf36636295d284db3ba7243cd4835.json} (77%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{add and update paragraph_1_f6253c11196abdbeae0f898cc9df85eb.json => add and update paragraph_1_3c276441275032fe98b12356026537a0.json} (66%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{add paragraph and update selection_1_dc29d735348684d1ec3e290ad8c03a71.json => add paragraph and update selection_1_0207de852025d2c0a1d417a7d66fa03c.json} (66%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{add and update paragraph_1_a27ae10badcc3913a00eb86f77ac64db.json => add and update paragraph_1_937647a13580b4dbb611e3de3b2c8788.json} (92%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{add paragraph and update selection_1_86f10ca461ee44e74ae571fb9f214338.json => add paragraph and update selection_1_d9ea724851130649f405ff50190452b5.json} (92%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{delete first block_1_91346200727a71ab9ad8c5d014835688.json => delete first block_1_afd5ee1bda075c7482d1861d03ad0a29.json} (69%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{delete first block_1_150a539024aa981c9f6bcb068875a6c9.json => delete first block_1_9a26ba1fa4692c62b4f519ed3669fdc5.json} (66%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{delete first block_1_1b3c4ac85d448677697457098332ceba.json => delete first block_1_2fd92a4c2642fff1ef49d65014aa1ac3.json} (88%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{drop mark and link and change text within mark_1_fe3cac9da9d1e17a20ee8c0c4380d925.json => drop mark and link and change text within mark_1_fd54b2fefac722ab5057252b68c4faec.json} (72%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{drop mark and link_1_f6ee881e6d3b4cd9553256523e67683a.json => drop mark and link_1_93038afbc107d8439571e6287fc76a8f.json} (72%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{plain source block, add mention_1_ccd752aefdbc2252a5a09bebac393afb.json => plain source block, add mention_1_7035efab1f6d9e5a46dde12d39f9ed19.json} (75%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{standard update_1_c44a31a1631a3a10efcd5e17645998f1.json => standard update_1_467258028a5a6bef3542c1a5417d4b3d.json} (70%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{styles + ic in source block, remove mark_1_df177a6a4f26b0fbcba307c6d21cab76.json => styles + ic in source block, remove mark_1_90c0b37bad31f3b9b0d15c492c610d0b.json} (79%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{styles + ic in source block, remove mention_1_4ba9f3411694f807e85e8e33f4b3c8cd.json => styles + ic in source block, remove mention_1_3e8b04b91ca15c467180df1c60c9e1b2.json} (77%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{styles + ic in source block, replace content_1_f5b001d0f8415a00e8b043f3e3e33535.json => styles + ic in source block, replace content_1_3551fccc96307281574c2c96eaa05002.json} (71%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{styles + ic in source block, update mention prop_1_c197e3f5ce1dbc1a68765acbd198881a.json => styles + ic in source block, update mention prop_1_e7ef562479ab33624bfa2bd75c4d1f5e.json} (79%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{styles + ic in source block, update text_1_a0b93418bb2a5c0049e0a5c896f72191.json => styles + ic in source block, update text_1_3a3fa0950f819e8073475e78106b353d.json} (79%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{styles + ic in target block, add mark (paragraph)_1_fb2285b8d362cb8adcf78f6039ad3058.json => styles + ic in target block, add mark (paragraph)_1_7a05ed5acf369206dda586e41235430b.json} (72%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{styles + ic in target block, add mark (word)_1_e0087b91327576eaff9f8d4d368e0a03.json => styles + ic in target block, add mark (word)_1_0d9c02b01414a68a2dab4af392179183.json} (73%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{translate selection_1_4706b49daa5ad7afe9dfadded2e335c5.json => translate selection_1_ade79bca32d420b4323b2a888817b5d5.json} (72%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{update block prop and content_1_5bb684c9ae46815b5367a39bd42d5257.json => update block prop and content_1_f90879213f18f8b8e13748443299b6dc.json} (72%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{update block prop_1_8469a78802d46f3d9ec74dd1fbf49fd8.json => update block prop_1_3f8e13d1cfa75e24cd4e0dfb0eab9ef4.json} (72%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{update block type and content_1_226cc5d7352c8c7e58a15d064543518c.json => update block type and content_1_07d3d8730ff541c3a2bf5e53c6707dac.json} (72%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/{update block type_1_c4cc00889532e0baa73998da5e79c303.json => update block type_1_6cc7ad0b6e2c278095f03deb353e4c9b.json} (100%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{drop mark and link and change text within mark_1_e5c77f0f881e77f6ee27a25f203ffdcb.json => drop mark and link and change text within mark_1_17fe180166622808ade902a2eccad8aa.json} (65%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{drop mark and link_1_b93576392cb38dc57acd85f7fc55c6cd.json => drop mark and link_1_a055d5e9dcf9d3ce1e1cddf57b441dc1.json} (66%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{plain source block, add mention_1_b18afae076d7f7f423477f1e1bc5813a.json => plain source block, add mention_1_7692c767dc159df75724f2a49cc38b0e.json} (66%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{standard update_1_529e09ae665507a31316cb632f5cabcd.json => standard update_1_b81e76afad4cf5e84bd6815d2bc8d069.json} (66%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in source block, remove mark_1_20036398e12cf4a20b50024ad5f30018.json => styles + ic in source block, remove mark_1_da7d1e5e03db624c6007dc8137fc3588.json} (68%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in source block, remove mention_1_ed131f0383e7709a4e5fae2df28af29a.json => styles + ic in source block, remove mention_1_758855f114117cd6c8f70c7caa84cc68.json} (67%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in source block, replace content_1_51bfdc443e43bbf18599fcc3a16c5683.json => styles + ic in source block, replace content_1_222775b0c617ba9bcada86cd238b6d64.json} (66%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in source block, update mention prop_1_7641f5691799d2666855c113b6659b71.json => styles + ic in source block, update mention prop_1_ad74c153b3f0beb850955148f0a42c78.json} (68%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in source block, update text_1_8fcb24a91437026c480205de77507871.json => styles + ic in source block, update text_1_4bf0b01b1e009966973599ebc2194362.json} (68%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in target block, add mark (paragraph)_1_be126322b804c53145dbd35a6aa1131f.json => styles + ic in target block, add mark (paragraph)_1_5ce19f53eaf195c6e284c91b0db7d586.json} (66%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{styles + ic in target block, add mark (word)_1_ec13a3b1d4f97b79148833b507295ffa.json => styles + ic in target block, add mark (word)_1_0f8ce96b644d6bd531f0558208cf5790.json} (66%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{translate selection_1_f1a2ffb178b441d40625b8f110e3290f.json => translate selection_1_1cf9377128e689feac5e5e13a1d0e26f.json} (66%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{update block prop and content_1_8557c5a4249c324adfff5d243645e3de.json => update block prop and content_1_260e8bc6dd5c9cbd0650701e6d95ada3.json} (66%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{update block prop_1_16dda1caa1f43ab624eb28a605179dd3.json => update block prop_1_339e6b8d82d281185c6ccbcd1809374f.json} (66%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{update block type and content_1_8b167672c96bf3c69b9b146eb4f26451.json => update block type and content_1_ff26ae30546f4e0d4279e60e4b7a1fbf.json} (66%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/{update block type_1_7326b3d0db43c8f399aba2bc44c80194.json => update block type_1_d9cbf71a8b55c8be0b247c3bb200c59c.json} (66%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{drop mark and link and change text within mark_1_94f36faff958747b5d66a185e268bba7.json => drop mark and link and change text within mark_1_d1f45ba6fee8787529137c920d6bc58e.json} (90%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{drop mark and link_1_60bf97139612cd25b1f99502383df8aa.json => drop mark and link_1_c9489269d9a2d4353eda54289ed7f395.json} (90%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{plain source block, add mention_1_d5759fe9868f60a47538d31361c68b3c.json => plain source block, add mention_1_416931598559b3e7e906647a66f0b8b1.json} (91%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{standard update_1_f6a167a6ea376d70d84dd9aac6ac7bb3.json => standard update_1_9728e4dd714a6a14ce441d72378dd67a.json} (89%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{styles + ic in source block, remove mark_1_990c696cfe9af87de056328060fd1f93.json => styles + ic in source block, remove mark_1_198059a270dbbb88db8f1cba97503205.json} (94%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{styles + ic in source block, remove mention_1_fd4deb4dce4d79ae14939fda71c510fd.json => styles + ic in source block, remove mention_1_9313219c085c3b39c7c14c00f388b4be.json} (93%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{styles + ic in source block, replace content_1_6cd810cd03bff509578637fe27d13a92.json => styles + ic in source block, replace content_1_f7a4c2a7fc5e362c3484586f45b2501d.json} (89%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{styles + ic in source block, update mention prop_1_f0e30d1d6cbc94e6b7dcb8abb7e0221f.json => styles + ic in source block, update mention prop_1_38090ebbfaca38fca97b1e4f0a0dd942.json} (94%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{styles + ic in source block, update text_1_1104dff815f18f8f786fb7d4e4522d47.json => styles + ic in source block, update text_1_6374879c3f8fbc16db7c43304d2faacd.json} (94%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{styles + ic in target block, add mark (paragraph)_1_e2f4cdb3df42b17c74cd1d2d00d2f8d5.json => styles + ic in target block, add mark (paragraph)_1_0afac4d00d3f0bbdfd251a8394b6ff28.json} (90%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{styles + ic in target block, add mark (word)_1_6b5073ce92485be7974a344d50247b4a.json => styles + ic in target block, add mark (word)_1_00156bb4dd5722d44e0ff5332561928a.json} (90%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{translate selection_1_d343e10867cc7b3d9850847c99826b61.json => translate selection_1_24abe901176e9d834f9542d0b26e82ae.json} (89%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{update block prop and content_1_780bfe04d42dd48e9115cba7c4582c01.json => update block prop and content_1_3f479c81e81f4f9460df3af74ddd2207.json} (90%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{update block prop_1_667c03220ba6e678d0c91b9de092484b.json => update block prop_1_6012638796e6e00b242b43642bb90a7a.json} (90%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{update block type and content_1_f3c6521f6f12dc50dc16d0bbc277a858.json => update block type and content_1_04e027a89c6d4e69a0f805d5c8987e2c.json} (90%) rename packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/{update block type_1_7c4fbdcabcec0568ade27d2b47afbaab.json => update block type_1_72aecf62b6c9c807411d248d46a62eea.json} (90%) diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_380a0c02b5089b38247457135c044cf7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_801ad86e0c3a4562338793805e66a52f.json similarity index 77% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_380a0c02b5089b38247457135c044cf7.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_801ad86e0c3a4562338793805e66a52f.json index f27c0f4cbd..17cb4f5a39 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_380a0c02b5089b38247457135c044cf7.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_801ad86e0c3a4562338793805e66a52f.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add paragraph and update selection_1_298b51bb28c5f95ab9a00205d4e38460.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add paragraph and update selection_1_b6ecf36636295d284db3ba7243cd4835.json similarity index 77% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add paragraph and update selection_1_298b51bb28c5f95ab9a00205d4e38460.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add paragraph and update selection_1_b6ecf36636295d284db3ba7243cd4835.json index 4c5381201b..a838ce9887 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add paragraph and update selection_1_298b51bb28c5f95ab9a00205d4e38460.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add paragraph and update selection_1_b6ecf36636295d284db3ba7243cd4835.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello,

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):\"},{\"type\":\"text\",\"text\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a paragraph with the text 'You look great today!' before the selection and translate selection to German\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello,

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):\"},{\"type\":\"text\",\"text\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"add a paragraph with the text 'You look great today!' before the selection and translate selection to German\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_f6253c11196abdbeae0f898cc9df85eb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_3c276441275032fe98b12356026537a0.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_f6253c11196abdbeae0f898cc9df85eb.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_3c276441275032fe98b12356026537a0.json index 369dab7df1..2a80ef2c4b 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_f6253c11196abdbeae0f898cc9df85eb.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_3c276441275032fe98b12356026537a0.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_dc29d735348684d1ec3e290ad8c03a71.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_0207de852025d2c0a1d417a7d66fa03c.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_dc29d735348684d1ec3e290ad8c03a71.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_0207de852025d2c0a1d417a7d66fa03c.json index a1215c6d16..4e41813c1f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_dc29d735348684d1ec3e290ad8c03a71.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_0207de852025d2c0a1d417a7d66fa03c.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello,

\\\"}]This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' before the selection and translate selection to German\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello,

\\\"}]This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"add a paragraph with the text 'You look great today!' before the selection and translate selection to German\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_a27ae10badcc3913a00eb86f77ac64db.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_937647a13580b4dbb611e3de3b2c8788.json similarity index 92% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_a27ae10badcc3913a00eb86f77ac64db.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_937647a13580b4dbb611e3de3b2c8788.json index 3c8c38137a..47f0b8028b 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_a27ae10badcc3913a00eb86f77ac64db.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_937647a13580b4dbb611e3de3b2c8788.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a new paragraph with the text 'You look great today!' after the first paragraph and translate first 'Hello, world' to dutch\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_86f10ca461ee44e74ae571fb9f214338.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_d9ea724851130649f405ff50190452b5.json similarity index 92% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_86f10ca461ee44e74ae571fb9f214338.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_d9ea724851130649f405ff50190452b5.json index 41e7f245f4..42c2b39c8c 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_86f10ca461ee44e74ae571fb9f214338.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_d9ea724851130649f405ff50190452b5.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello,

\\\"}]\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' before the selection and translate selection to German\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello,

\\\"}]\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"add a paragraph with the text 'You look great today!' before the selection and translate selection to German\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_91346200727a71ab9ad8c5d014835688.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_afd5ee1bda075c7482d1861d03ad0a29.json similarity index 69% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_91346200727a71ab9ad8c5d014835688.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_afd5ee1bda075c7482d1861d03ad0a29.json index cd9f61961f..5300fdf5b7 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_91346200727a71ab9ad8c5d014835688.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_afd5ee1bda075c7482d1861d03ad0a29.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_150a539024aa981c9f6bcb068875a6c9.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_9a26ba1fa4692c62b4f519ed3669fdc5.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_150a539024aa981c9f6bcb068875a6c9.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_9a26ba1fa4692c62b4f519ed3669fdc5.json index 7295e28681..bb5eaf6f2c 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_150a539024aa981c9f6bcb068875a6c9.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_9a26ba1fa4692c62b4f519ed3669fdc5.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"delete the first paragraph\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"delete the first paragraph\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_1b3c4ac85d448677697457098332ceba.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_2fd92a4c2642fff1ef49d65014aa1ac3.json similarity index 88% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_1b3c4ac85d448677697457098332ceba.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_2fd92a4c2642fff1ef49d65014aa1ac3.json index c6665d1949..814ffc9d70 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_1b3c4ac85d448677697457098332ceba.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_2fd92a4c2642fff1ef49d65014aa1ac3.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"delete the first paragraph\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_fe3cac9da9d1e17a20ee8c0c4380d925.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_fd54b2fefac722ab5057252b68c4faec.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_fe3cac9da9d1e17a20ee8c0c4380d925.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_fd54b2fefac722ab5057252b68c4faec.json index 8eb74d80fb..91288a6156 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_fe3cac9da9d1e17a20ee8c0c4380d925.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_fd54b2fefac722ab5057252b68c4faec.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_f6ee881e6d3b4cd9553256523e67683a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_93038afbc107d8439571e6287fc76a8f.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_f6ee881e6d3b4cd9553256523e67683a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_93038afbc107d8439571e6287fc76a8f.json index 7c544f01e8..01edd35bd9 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_f6ee881e6d3b4cd9553256523e67683a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_93038afbc107d8439571e6287fc76a8f.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_ccd752aefdbc2252a5a09bebac393afb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_7035efab1f6d9e5a46dde12d39f9ed19.json similarity index 75% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_ccd752aefdbc2252a5a09bebac393afb.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_7035efab1f6d9e5a46dde12d39f9ed19.json index 583f74e72f..bc4e3fc826 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_ccd752aefdbc2252a5a09bebac393afb.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_7035efab1f6d9e5a46dde12d39f9ed19.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_c44a31a1631a3a10efcd5e17645998f1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_467258028a5a6bef3542c1a5417d4b3d.json similarity index 70% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_c44a31a1631a3a10efcd5e17645998f1.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_467258028a5a6bef3542c1a5417d4b3d.json index 6c661ae541..dea1f47b37 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_c44a31a1631a3a10efcd5e17645998f1.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_467258028a5a6bef3542c1a5417d4b3d.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_df177a6a4f26b0fbcba307c6d21cab76.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_90c0b37bad31f3b9b0d15c492c610d0b.json similarity index 79% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_df177a6a4f26b0fbcba307c6d21cab76.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_90c0b37bad31f3b9b0d15c492c610d0b.json index 9d99a67db6..1f4c83cef1 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_df177a6a4f26b0fbcba307c6d21cab76.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_90c0b37bad31f3b9b0d15c492c610d0b.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_4ba9f3411694f807e85e8e33f4b3c8cd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_3e8b04b91ca15c467180df1c60c9e1b2.json similarity index 77% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_4ba9f3411694f807e85e8e33f4b3c8cd.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_3e8b04b91ca15c467180df1c60c9e1b2.json index 20f13a4e94..418d42818a 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_4ba9f3411694f807e85e8e33f4b3c8cd.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_3e8b04b91ca15c467180df1c60c9e1b2.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_f5b001d0f8415a00e8b043f3e3e33535.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_3551fccc96307281574c2c96eaa05002.json similarity index 71% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_f5b001d0f8415a00e8b043f3e3e33535.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_3551fccc96307281574c2c96eaa05002.json index 44f04c2711..38aa7114d8 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_f5b001d0f8415a00e8b043f3e3e33535.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_3551fccc96307281574c2c96eaa05002.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_c197e3f5ce1dbc1a68765acbd198881a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_e7ef562479ab33624bfa2bd75c4d1f5e.json similarity index 79% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_c197e3f5ce1dbc1a68765acbd198881a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_e7ef562479ab33624bfa2bd75c4d1f5e.json index 2d719ce333..c4862b6867 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_c197e3f5ce1dbc1a68765acbd198881a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_e7ef562479ab33624bfa2bd75c4d1f5e.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_a0b93418bb2a5c0049e0a5c896f72191.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_3a3fa0950f819e8073475e78106b353d.json similarity index 79% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_a0b93418bb2a5c0049e0a5c896f72191.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_3a3fa0950f819e8073475e78106b353d.json index b6ed9fe796..aff55ef011 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_a0b93418bb2a5c0049e0a5c896f72191.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_3a3fa0950f819e8073475e78106b353d.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_fb2285b8d362cb8adcf78f6039ad3058.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_7a05ed5acf369206dda586e41235430b.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_fb2285b8d362cb8adcf78f6039ad3058.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_7a05ed5acf369206dda586e41235430b.json index 06890c2090..92ee3b08ab 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_fb2285b8d362cb8adcf78f6039ad3058.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_7a05ed5acf369206dda586e41235430b.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_e0087b91327576eaff9f8d4d368e0a03.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_0d9c02b01414a68a2dab4af392179183.json similarity index 73% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_e0087b91327576eaff9f8d4d368e0a03.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_0d9c02b01414a68a2dab4af392179183.json index bf9a4944f5..6ada120256 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_e0087b91327576eaff9f8d4d368e0a03.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_0d9c02b01414a68a2dab4af392179183.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_4706b49daa5ad7afe9dfadded2e335c5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_ade79bca32d420b4323b2a888817b5d5.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_4706b49daa5ad7afe9dfadded2e335c5.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_ade79bca32d420b4323b2a888817b5d5.json index 3a897ed622..dfc1595250 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_4706b49daa5ad7afe9dfadded2e335c5.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_ade79bca32d420b4323b2a888817b5d5.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello,

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):\"},{\"type\":\"text\",\"text\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello,

\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):\"},{\"type\":\"text\",\"text\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_5bb684c9ae46815b5367a39bd42d5257.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_f90879213f18f8b8e13748443299b6dc.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_5bb684c9ae46815b5367a39bd42d5257.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_f90879213f18f8b8e13748443299b6dc.json index 50078a7a22..93f6d6b339 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_5bb684c9ae46815b5367a39bd42d5257.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_f90879213f18f8b8e13748443299b6dc.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_8469a78802d46f3d9ec74dd1fbf49fd8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_3f8e13d1cfa75e24cd4e0dfb0eab9ef4.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_8469a78802d46f3d9ec74dd1fbf49fd8.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_3f8e13d1cfa75e24cd4e0dfb0eab9ef4.json index bc2bae4de7..ce8a307c89 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_8469a78802d46f3d9ec74dd1fbf49fd8.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_3f8e13d1cfa75e24cd4e0dfb0eab9ef4.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph right aligned\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph right aligned\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_226cc5d7352c8c7e58a15d064543518c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_07d3d8730ff541c3a2bf5e53c6707dac.json similarity index 72% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_226cc5d7352c8c7e58a15d064543518c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_07d3d8730ff541c3a2bf5e53c6707dac.json index 08e8d0a896..70c61a4455 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_226cc5d7352c8c7e58a15d064543518c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_07d3d8730ff541c3a2bf5e53c6707dac.json @@ -2,8 +2,29 @@ "request": { "method": "POST", "url": "https://api.anthropic.com/v1/messages", - "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", - "headers": [], + "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":64000,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"}],\"messages\":[{\"role\":\"assistant\",\"content\":[{\"type\":\"text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"name\":\"applyDocumentOperations\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":{\"type\":\"any\"},\"stream\":true}", + "headers": [ + [ + "anthropic-beta", + "fine-grained-tool-streaming-2025-05-14" + ], + [ + "anthropic-version", + "2023-06-01" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/anthropic/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ], + [ + "x-api-key", + "not-available-in-ci" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_c4cc00889532e0baa73998da5e79c303.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_6cc7ad0b6e2c278095f03deb353e4c9b.json similarity index 100% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_c4cc00889532e0baa73998da5e79c303.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_6cc7ad0b6e2c278095f03deb353e4c9b.json diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_e5c77f0f881e77f6ee27a25f203ffdcb.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_17fe180166622808ade902a2eccad8aa.json similarity index 65% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_e5c77f0f881e77f6ee27a25f203ffdcb.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_17fe180166622808ade902a2eccad8aa.json index 44277745ba..86cf47e52c 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_e5c77f0f881e77f6ee27a25f203ffdcb.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_17fe180166622808ade902a2eccad8aa.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_b93576392cb38dc57acd85f7fc55c6cd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_a055d5e9dcf9d3ce1e1cddf57b441dc1.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_b93576392cb38dc57acd85f7fc55c6cd.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_a055d5e9dcf9d3ce1e1cddf57b441dc1.json index 66510ce8dc..9c7c6aadea 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_b93576392cb38dc57acd85f7fc55c6cd.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_a055d5e9dcf9d3ce1e1cddf57b441dc1.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_b18afae076d7f7f423477f1e1bc5813a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_7692c767dc159df75724f2a49cc38b0e.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_b18afae076d7f7f423477f1e1bc5813a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_7692c767dc159df75724f2a49cc38b0e.json index 62bfe269be..e69c8a1cff 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_b18afae076d7f7f423477f1e1bc5813a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_7692c767dc159df75724f2a49cc38b0e.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_529e09ae665507a31316cb632f5cabcd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_b81e76afad4cf5e84bd6815d2bc8d069.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_529e09ae665507a31316cb632f5cabcd.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_b81e76afad4cf5e84bd6815d2bc8d069.json index c5b665e689..e778aaca31 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_529e09ae665507a31316cb632f5cabcd.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_b81e76afad4cf5e84bd6815d2bc8d069.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_20036398e12cf4a20b50024ad5f30018.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_da7d1e5e03db624c6007dc8137fc3588.json similarity index 68% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_20036398e12cf4a20b50024ad5f30018.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_da7d1e5e03db624c6007dc8137fc3588.json index 8b12b184b5..5178b27856 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_20036398e12cf4a20b50024ad5f30018.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_da7d1e5e03db624c6007dc8137fc3588.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_ed131f0383e7709a4e5fae2df28af29a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_758855f114117cd6c8f70c7caa84cc68.json similarity index 67% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_ed131f0383e7709a4e5fae2df28af29a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_758855f114117cd6c8f70c7caa84cc68.json index 3038e2a09a..5d64e8febf 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_ed131f0383e7709a4e5fae2df28af29a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_758855f114117cd6c8f70c7caa84cc68.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_51bfdc443e43bbf18599fcc3a16c5683.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_222775b0c617ba9bcada86cd238b6d64.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_51bfdc443e43bbf18599fcc3a16c5683.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_222775b0c617ba9bcada86cd238b6d64.json index 812efd8c9d..4bad856005 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_51bfdc443e43bbf18599fcc3a16c5683.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_222775b0c617ba9bcada86cd238b6d64.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_7641f5691799d2666855c113b6659b71.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_ad74c153b3f0beb850955148f0a42c78.json similarity index 68% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_7641f5691799d2666855c113b6659b71.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_ad74c153b3f0beb850955148f0a42c78.json index 05452f7742..8e44760e5f 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_7641f5691799d2666855c113b6659b71.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_ad74c153b3f0beb850955148f0a42c78.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_8fcb24a91437026c480205de77507871.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_4bf0b01b1e009966973599ebc2194362.json similarity index 68% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_8fcb24a91437026c480205de77507871.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_4bf0b01b1e009966973599ebc2194362.json index 04e06bbde4..f3e0f8c04c 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_8fcb24a91437026c480205de77507871.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_4bf0b01b1e009966973599ebc2194362.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_be126322b804c53145dbd35a6aa1131f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_5ce19f53eaf195c6e284c91b0db7d586.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_be126322b804c53145dbd35a6aa1131f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_5ce19f53eaf195c6e284c91b0db7d586.json index 3760882743..e6f6557f11 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_be126322b804c53145dbd35a6aa1131f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_5ce19f53eaf195c6e284c91b0db7d586.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_ec13a3b1d4f97b79148833b507295ffa.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_0f8ce96b644d6bd531f0558208cf5790.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_ec13a3b1d4f97b79148833b507295ffa.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_0f8ce96b644d6bd531f0558208cf5790.json index 245e84c358..1d1065da27 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_ec13a3b1d4f97b79148833b507295ffa.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_0f8ce96b644d6bd531f0558208cf5790.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_f1a2ffb178b441d40625b8f110e3290f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_1cf9377128e689feac5e5e13a1d0e26f.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_f1a2ffb178b441d40625b8f110e3290f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_1cf9377128e689feac5e5e13a1d0e26f.json index f972d7a861..ba1d3d025d 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_f1a2ffb178b441d40625b8f110e3290f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_1cf9377128e689feac5e5e13a1d0e26f.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello,

\\\"}]This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello,

\\\"}]This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_8557c5a4249c324adfff5d243645e3de.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_260e8bc6dd5c9cbd0650701e6d95ada3.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_8557c5a4249c324adfff5d243645e3de.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_260e8bc6dd5c9cbd0650701e6d95ada3.json index 23dd266599..82d73acbb5 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_8557c5a4249c324adfff5d243645e3de.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_260e8bc6dd5c9cbd0650701e6d95ada3.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_16dda1caa1f43ab624eb28a605179dd3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_339e6b8d82d281185c6ccbcd1809374f.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_16dda1caa1f43ab624eb28a605179dd3.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_339e6b8d82d281185c6ccbcd1809374f.json index 8c5740dc72..01e33786f8 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_16dda1caa1f43ab624eb28a605179dd3.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_339e6b8d82d281185c6ccbcd1809374f.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_8b167672c96bf3c69b9b146eb4f26451.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_ff26ae30546f4e0d4279e60e4b7a1fbf.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_8b167672c96bf3c69b9b146eb4f26451.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_ff26ae30546f4e0d4279e60e4b7a1fbf.json index 8e578c399a..0e993d6871 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_8b167672c96bf3c69b9b146eb4f26451.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_ff26ae30546f4e0d4279e60e4b7a1fbf.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_7326b3d0db43c8f399aba2bc44c80194.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_d9cbf71a8b55c8be0b247c3bb200c59c.json similarity index 66% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_7326b3d0db43c8f399aba2bc44c80194.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_d9cbf71a8b55c8be0b247c3bb200c59c.json index c7d2c8b42d..94dca71924 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_7326b3d0db43c8f399aba2bc44c80194.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_d9cbf71a8b55c8be0b247c3bb200c59c.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.groq.com/openai/v1/chat/completions", - "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"llama-3.3-70b-versatile\",\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/groq/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_94f36faff958747b5d66a185e268bba7.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_d1f45ba6fee8787529137c920d6bc58e.json similarity index 90% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_94f36faff958747b5d66a185e268bba7.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_d1f45ba6fee8787529137c920d6bc58e.json index b618e169d5..7828001204 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_94f36faff958747b5d66a185e268bba7.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_d1f45ba6fee8787529137c920d6bc58e.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_60bf97139612cd25b1f99502383df8aa.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_c9489269d9a2d4353eda54289ed7f395.json similarity index 90% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_60bf97139612cd25b1f99502383df8aa.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_c9489269d9a2d4353eda54289ed7f395.json index 57739d10bc..5c110de741 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_60bf97139612cd25b1f99502383df8aa.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_c9489269d9a2d4353eda54289ed7f395.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_d5759fe9868f60a47538d31361c68b3c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_416931598559b3e7e906647a66f0b8b1.json similarity index 91% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_d5759fe9868f60a47538d31361c68b3c.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_416931598559b3e7e906647a66f0b8b1.json index 3a823cb720..c084b5dcaf 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_d5759fe9868f60a47538d31361c68b3c.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_416931598559b3e7e906647a66f0b8b1.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_f6a167a6ea376d70d84dd9aac6ac7bb3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_9728e4dd714a6a14ce441d72378dd67a.json similarity index 89% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_f6a167a6ea376d70d84dd9aac6ac7bb3.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_9728e4dd714a6a14ce441d72378dd67a.json index e147797b0f..d151e649ad 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_f6a167a6ea376d70d84dd9aac6ac7bb3.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_9728e4dd714a6a14ce441d72378dd67a.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_990c696cfe9af87de056328060fd1f93.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_198059a270dbbb88db8f1cba97503205.json similarity index 94% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_990c696cfe9af87de056328060fd1f93.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_198059a270dbbb88db8f1cba97503205.json index 48cab99917..7eb5789ee6 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_990c696cfe9af87de056328060fd1f93.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_198059a270dbbb88db8f1cba97503205.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_fd4deb4dce4d79ae14939fda71c510fd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_9313219c085c3b39c7c14c00f388b4be.json similarity index 93% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_fd4deb4dce4d79ae14939fda71c510fd.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_9313219c085c3b39c7c14c00f388b4be.json index fc2363fdf3..9d91395de9 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_fd4deb4dce4d79ae14939fda71c510fd.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_9313219c085c3b39c7c14c00f388b4be.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_6cd810cd03bff509578637fe27d13a92.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_f7a4c2a7fc5e362c3484586f45b2501d.json similarity index 89% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_6cd810cd03bff509578637fe27d13a92.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_f7a4c2a7fc5e362c3484586f45b2501d.json index f789eb926d..2d00fde690 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_6cd810cd03bff509578637fe27d13a92.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_f7a4c2a7fc5e362c3484586f45b2501d.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_f0e30d1d6cbc94e6b7dcb8abb7e0221f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_38090ebbfaca38fca97b1e4f0a0dd942.json similarity index 94% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_f0e30d1d6cbc94e6b7dcb8abb7e0221f.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_38090ebbfaca38fca97b1e4f0a0dd942.json index b234cbca44..3c984969c3 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_f0e30d1d6cbc94e6b7dcb8abb7e0221f.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_38090ebbfaca38fca97b1e4f0a0dd942.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_1104dff815f18f8f786fb7d4e4522d47.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_6374879c3f8fbc16db7c43304d2faacd.json similarity index 94% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_1104dff815f18f8f786fb7d4e4522d47.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_6374879c3f8fbc16db7c43304d2faacd.json index 6ed1009ec7..fe132f67e5 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_1104dff815f18f8f786fb7d4e4522d47.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_6374879c3f8fbc16db7c43304d2faacd.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_e2f4cdb3df42b17c74cd1d2d00d2f8d5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_0afac4d00d3f0bbdfd251a8394b6ff28.json similarity index 90% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_e2f4cdb3df42b17c74cd1d2d00d2f8d5.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_0afac4d00d3f0bbdfd251a8394b6ff28.json index 2b47f33773..f67596bec5 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_e2f4cdb3df42b17c74cd1d2d00d2f8d5.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_0afac4d00d3f0bbdfd251a8394b6ff28.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_6b5073ce92485be7974a344d50247b4a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_00156bb4dd5722d44e0ff5332561928a.json similarity index 90% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_6b5073ce92485be7974a344d50247b4a.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_00156bb4dd5722d44e0ff5332561928a.json index 9d2eece130..84d94e2567 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_6b5073ce92485be7974a344d50247b4a.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_00156bb4dd5722d44e0ff5332561928a.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_d343e10867cc7b3d9850847c99826b61.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_24abe901176e9d834f9542d0b26e82ae.json similarity index 89% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_d343e10867cc7b3d9850847c99826b61.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_24abe901176e9d834f9542d0b26e82ae.json index c6d53c61e5..4b9686d1c6 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_d343e10867cc7b3d9850847c99826b61.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_24abe901176e9d834f9542d0b26e82ae.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello,

\\\"}]\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"This is the latest state of the selection (ignore previous selections, you MUST issue operations against this latest version of the selection):\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello,

\\\"}]\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"This is the latest state of the entire document (INCLUDING the selected text), \\nyou can use this to find the selected text to understand the context (but you MUST NOT issue operations against this document, you MUST issue operations against the selection):\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate to German\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_780bfe04d42dd48e9115cba7c4582c01.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_3f479c81e81f4f9460df3af74ddd2207.json similarity index 90% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_780bfe04d42dd48e9115cba7c4582c01.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_3f479c81e81f4f9460df3af74ddd2207.json index 7d6aa02461..412ec36043 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_780bfe04d42dd48e9115cba7c4582c01.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_3f479c81e81f4f9460df3af74ddd2207.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_667c03220ba6e678d0c91b9de092484b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_6012638796e6e00b242b43642bb90a7a.json similarity index 90% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_667c03220ba6e678d0c91b9de092484b.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_6012638796e6e00b242b43642bb90a7a.json index 6192ff50d7..255a4f5160 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_667c03220ba6e678d0c91b9de092484b.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_6012638796e6e00b242b43642bb90a7a.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph right aligned\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph right aligned\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_f3c6521f6f12dc50dc16d0bbc277a858.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_04e027a89c6d4e69a0f805d5c8987e2c.json similarity index 90% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_f3c6521f6f12dc50dc16d0bbc277a858.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_04e027a89c6d4e69a0f805d5c8987e2c.json index 396b47c075..eb063403bd 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_f3c6521f6f12dc50dc16d0bbc277a858.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_04e027a89c6d4e69a0f805d5c8987e2c.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": { diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_7c4fbdcabcec0568ade27d2b47afbaab.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_72aecf62b6c9c807411d248d46a62eea.json similarity index 90% rename from packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_7c4fbdcabcec0568ade27d2b47afbaab.json rename to packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_72aecf62b6c9c807411d248d46a62eea.json index 0f834059e8..c9390ad2cd 100644 --- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_7c4fbdcabcec0568ade27d2b47afbaab.json +++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_72aecf62b6c9c807411d248d46a62eea.json @@ -2,8 +2,21 @@ "request": { "method": "POST", "url": "https://api.openai.com/v1/responses", - "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", - "headers": [], + "body": "{\"model\":\"gpt-4o-2024-08-06\",\"input\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\nMake sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\nList items are 1 block with 1 list item each, so block content `
  • item1
` is valid, but `
  • item1
  • item2
` is invalid. We'll merge them automatically.\\nFor code blocks, you can use the `data-language` attribute on a block (wrapped with
) to specify the language.\\n\\nIf the user requests updates to the document, use the \\\"applyDocumentOperations\\\" tool to update the document.\\n---\\nIF there is no selection active in the latest state, first, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.\\n  EXAMPLE: if user says \\\"below\\\" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor. \\n  EXAMPLE: If you want to insert content AT the cursor position (UNLESS indicated otherwise by the user), then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`\\n---\\n \"},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"There is no active selection. This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document). \\nThe cursor is BETWEEN two blocks as indicated by cursor: true.\\nPrefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"

Hello, world!

\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"

Hello, @John Doe! How are you doing? This text is blue!

\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"

Hello, world! Bold text. Link.

\\\"}]\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"applyDocumentOperations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operations\":{\"type\":\"array\",\"items\":{\"anyOf\":[{\"type\":\"object\",\"description\":\"Update a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"update\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to update\"},\"block\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single HTML element)\"}},\"required\":[\"type\",\"id\",\"block\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Insert new blocks\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"add\"]},\"referenceId\":{\"type\":\"string\",\"description\":\"MUST be an id of a block in the document\"},\"position\":{\"type\":\"string\",\"enum\":[\"before\",\"after\"],\"description\":\"`after` to add blocks AFTER (below) the block with `referenceId`, `before` to add the block BEFORE (above)\"},\"blocks\":{\"items\":{\"type\":\"string\",\"description\":\"html of block (MUST be a single, VALID HTML element)\"},\"type\":\"array\"}},\"required\":[\"type\",\"referenceId\",\"position\",\"blocks\"],\"additionalProperties\":false},{\"type\":\"object\",\"description\":\"Delete a block\",\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"delete\"]},\"id\":{\"type\":\"string\",\"description\":\"id of block to delete\"}},\"required\":[\"type\",\"id\"],\"additionalProperties\":false}]}}},\"additionalProperties\":false,\"required\":[\"operations\"]}}],\"tool_choice\":\"required\",\"stream\":true}", + "headers": [ + [ + "authorization", + "Bearer not-available-in-ci" + ], + [ + "content-type", + "application/json" + ], + [ + "user-agent", + "ai-sdk/openai/3.0.2 ai-sdk/provider-utils/4.0.2 runtime/browser" + ] + ], "cookies": [] }, "response": {