diff --git a/docs/content/docs/ai/getting-started.mdx b/docs/content/docs/ai/getting-started.mdx
deleted file mode 100644
index 3a78811210..0000000000
--- a/docs/content/docs/ai/getting-started.mdx
+++ /dev/null
@@ -1,106 +0,0 @@
----
-title: Getting Started with BlockNote AI
-description: Add AI functionality to your BlockNote rich text editor
-imageTitle: BlockNote AI
----
-
-This guide walks you through the steps to add AI functionality to your BlockNote rich text editor.
-
-First, install the `@blocknote/xl-ai` package:
-
-```bash
-npm install @blocknote/xl-ai
-```
-
-## Creating a Model
-
-BlockNote AI uses the the [AI SDK](https://ai-sdk.dev/docs/foundations/overview) to standardize integrating artificial intelligence (AI) models across [supported providers](https://ai-sdk.dev/docs/foundations/providers-and-models).
-
-As a first step, you'll need to register a new model with the AI SDK. For example, for Llama hosted on Groq:
-
-```bash
-npm install @ai-sdk/groq
-```
-
-```ts
-import { createGroq } from "@ai-sdk/groq";
-
-const provider = createGroq({
- apiKey: "YOUR_GROQ_API_KEY",
-});
-
-const model = provider("llama-3.3-70b-versatile");
-```
-
- Hello, world! How are you? Hello, world! How are you? You look great today! Hello, world! How are you? You look great today! Hello, world! How are you? You look great today! Hello, world! How are you? Hello, world! How are you? You lo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ok\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" great \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"toda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"y! Hello, world! How are you? \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"You l\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ook\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" great tod\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ay!<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p>\\\"]\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1113,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":94} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_83b238d8e21398ee970fac58c746fe19.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_83b238d8e21398ee970fac58c746fe19.json
new file mode 100644
index 0000000000..8d0a34ebc4
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (start)_1_83b238d8e21398ee970fac58c746fe19.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content ` Hello, world! How are you? You\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" look\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" great tod\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ay! Hello, world! How are you? Hello, world! How are you? Hello, world! How are you? Hello, world! How are you? Hello, world! How are you? Hello, world! How are you? Hello, world! How are you? Hello, world! How are you? Hello, world! How are you? Hello, world! How are you? Hello, world! How are you? Hello, world! How are you? Hello, world! How are you? Hello, world! How are you? You look great today! Hello, world! How are you? You look great today! Hello, world! How are you? You look great today! Hello, world! How are you? Hello, world! How are you? Hello, world! How are you? Hello, world! How are you? Hello, world! How are you? Hello, world! How are you? You look great today! You look great today! You look great today! You look great today! Hello, world! How are you? You look great today! You look great today! You look great today! You look great today! Hello, world! How are you? You look great today! You look great today! You look great today! You look great today! Hello, world! How are you? Hello, world! How are you? You look great today! You look great today! You look great today! Hello, world! How are you? You look great today! You look great today! You look great today! Hello, world! How are you? You look great today! You look great today! You look great today! Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hallo, wereld! You look great today! Hello Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. You look great today! Hallo Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hallo\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\", wereld! You \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"look grea\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"toda\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"y! Hello Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. You look \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"great today\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"! H\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"allo Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hallo, wereld! You look great today! Hello Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. You look great today! Hallo Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hallo, wereld! You look great today! Hallo, wereld! You look great today! Hallo, wereld! You look great today! Hallo, wereld! You look great today! Hello Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hallo You look great today! Hallo You look great today! Hallo You look great today! Hallo You look great today! Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hallo, wereld! You look great today! Hallo, wereld! You look great today! Hallo, wereld! You look great today! Hello Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. You look great today! Hallo You look great today! Hallo You look great today! Hallo Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Colored text Aligned text Colored text Aligned text Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hi, world! Bold the text. Link. Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Bold text. Link. I need to buy: Apples APPLES I need to buy: Apples I NEED TO BUY: Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, @Jane Doe! Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hallo, Welt! Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, @John Doe! How are you doing? This text is blue! Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello! How are you doing? This text is blue! Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, updated content Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, @Jane Doe! How are you doing? This text is blue! Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau! Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Hello Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hallo Apples Bananas I need to buy: Apples Bananas Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. What's up, world! Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Colored text Aligned text Co\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lored\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" tex\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t A\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lign\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ed text Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hi, \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"worl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d! Bold \"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"the tex\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t. Li\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"nk\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\". Hello, world! Hello, @John Doe! How are you doing? This text is blue! Hello, world! Bold text. Link. Hel\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lo, world!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" Bold text\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\". Link\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\". I need to buy: Apples" would first result in an empty paragraph,
- // wait for more content before adding the block
- continue;
- }
+ if (
+ chunk.isPossiblyPartial &&
+ isEmptyParagraph(
+ jsonToolCall.blocks[jsonToolCall.blocks.length - 1],
+ )
+ ) {
+ // for example, a parsing just "
" would first result in an empty paragraph,
+ // wait for more content before adding the block
+ return true;
+ }
- for (let i = 0; i < jsonToolCall.blocks.length; i++) {
- const block = jsonToolCall.blocks[i];
- const tr = editor.prosemirrorState.tr;
+ for (let i = 0; i < jsonToolCall.blocks.length; i++) {
+ const block = jsonToolCall.blocks[i];
+ const tr = editor.prosemirrorState.tr;
- let agentSteps: AgentStep[] = [];
- if (i < addedBlockIds.length) {
- // we have already added this block, so we need to update it
- const tool = await config.rebaseTool(addedBlockIds[i], editor);
- const steps = updateToReplaceSteps(
- {
- id: addedBlockIds[i],
- block,
- },
- tool.doc,
- false,
- );
+ let agentSteps: AgentStep[] = [];
+ if (i < addedBlockIds.length) {
+ // we have already added this block, so we need to update it
+ const tool = await config.rebaseTool(addedBlockIds[i], editor);
+ const steps = updateToReplaceSteps(
+ {
+ id: addedBlockIds[i],
+ block,
+ },
+ tool.doc,
+ false,
+ );
- const inverted = steps.map((step) => step.map(tool.invertMap)!);
+ const inverted = steps.map((step) => step.map(tool.invertMap)!);
- for (const step of inverted) {
- tr.step(step.map(tr.mapping)!);
- }
- agentSteps = getStepsAsAgent(tr);
- // don't spend time "selecting" the block as an agent, as we're continuing a previous update
- agentSteps = agentSteps.filter((step) => step.type !== "select");
- } else {
- // we are adding a new block, so we need to insert it
- const mappedReferenceId =
- operation.position === "after"
- ? referenceIdMap[operation.referenceId]
- : undefined;
+ for (const step of inverted) {
+ tr.step(step.map(tr.mapping)!);
+ }
+ agentSteps = getStepsAsAgent(tr);
+ // don't spend time "selecting" the block as an agent, as we're continuing a previous update
+ agentSteps = agentSteps.filter(
+ (step) => step.type !== "select",
+ );
+ } else {
+ // we are adding a new block, so we need to insert it
+ const mappedReferenceId =
+ operation.position === "after"
+ ? referenceIdMap[operation.referenceId]
+ : undefined;
- const ret = insertBlocks(
- tr,
- [block],
- i > 0
- ? addedBlockIds[i - 1]
- : mappedReferenceId || operation.referenceId,
- i > 0 ? "after" : operation.position,
- );
- addedBlockIds.push(...ret.map((r) => r.id));
- agentSteps = getStepsAsAgent(tr);
- }
+ const ret = insertBlocks(
+ tr,
+ [block],
+ i > 0
+ ? addedBlockIds[i - 1]
+ : mappedReferenceId || operation.referenceId,
+ i > 0 ? "after" : operation.position,
+ );
+ addedBlockIds.push(...ret.map((r) => r.id));
+ agentSteps = getStepsAsAgent(tr);
+ }
- if (agentSteps.find((step) => step.type === "replace")) {
+ // if (agentSteps.find((step) => step.type === "replace")) {
// throw new Error("unexpected: replace step in add operation");
// this is unexpected but we've been able to see this when:
// adding a list item, because
first gets parsed as paragraph, that then gets turned into a list
- }
+ // }
- for (const step of agentSteps) {
- if (options.withDelays) {
- await delayAgentStep(step);
+ for (const step of agentSteps) {
+ if (options.withDelays) {
+ await delayAgentStep(step);
+ }
+ editor.transact((tr) => {
+ applyAgentStep(tr, step);
+ });
+ options.onBlockUpdate?.(addedBlockIds[i]);
}
- editor.transact((tr) => {
- applyAgentStep(tr, step);
- });
- options.onBlockUpdate?.(addedBlockIds[i]);
}
- }
- if (!chunk.isPossiblyPartial) {
- if (operation.position === "after") {
- referenceIdMap[operation.referenceId] =
- addedBlockIds[addedBlockIds.length - 1];
+ if (!chunk.isPossiblyPartial) {
+ if (operation.position === "after") {
+ referenceIdMap[operation.referenceId] =
+ addedBlockIds[addedBlockIds.length - 1];
+ }
}
- }
- }
+
+ return true;
+ },
+ };
},
});
};
diff --git a/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts b/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts
index 6a81d0d469..2bd41b1e00 100644
--- a/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts
+++ b/packages/xl-ai/src/api/formats/base-tools/createUpdateBlockTool.ts
@@ -8,12 +8,7 @@ import {
} from "../../../prosemirror/agent.js";
import { updateToReplaceSteps } from "../../../prosemirror/changeset.js";
import { RebaseTool } from "../../../prosemirror/rebaseTool.js";
-import {
- Result,
- StreamTool,
- streamTool,
- StreamToolCall,
-} from "../../../streamTool/streamTool.js";
+import { Result, streamTool } from "../../../streamTool/streamTool.js";
export type UpdateBlockToolCall
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Code
\",\"
\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1142,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":115,\"service_tier\":\"standard\"}}",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_bec242b33b36b7c791d5079283365125.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_bec242b33b36b7c791d5079283365125.json
deleted file mode 100644
index a4d3dfc577..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a list (end)_1_bec242b33b36b7c791d5079283365125.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages",
- "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `console.log('hello world');
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\",\"
\"]}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1128,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":103,\"service_tier\":\"standard\"}}",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_8d2756d2f902e1a1c5aac5be1490fb37.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_8d2756d2f902e1a1c5aac5be1490fb37.json
deleted file mode 100644
index cb20038637..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/add a new paragraph (empty doc)_1_8d2756d2f902e1a1c5aac5be1490fb37.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages",
- "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"\\\"},{\\\"cursor\\\":true}]\"},{\"type\":\"text\",\"text\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"type\":\"text\",\"text\":\"The user asks you to do the following:\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"tools\":[{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\":\"tool\",\"name\":\"json\"}}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"msg_01MC458FbyBAnTpfqSAgHJ8s\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_011UmFiSs3GR3NShpNMNLR9J\",\"name\":\"json\",\"input\":{\"operations\":[{\"type\":\"update\",\"id\":\"ref1$\",\"block\":\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"conso\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"le.log\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"('he\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"llo world');\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\"]}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1118,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":111}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_ca2502e6ccea5088da25c3f548a88adc.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_ca2502e6ccea5088da25c3f548a88adc.json
new file mode 100644
index 0000000000..61d37e8f92
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add a new paragraph (empty doc)_1_ca2502e6ccea5088da25c3f548a88adc.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"\\\"},{\\\"cursor\\\":true}]\"},{\"type\":\"text\",\"text\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01TTpZunpRFo6XMRwFnTab65\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1081,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01NbuB5m8nLsgaWbJS3AUavp\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operations\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f1\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-d65595a4-9879-44c7-ac75-e925f6e96c0f\",\"object\":\"chat.completion\",\"created\":1758112746,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"qvcwj4mxf\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.08464388,\"prompt_tokens\":804,\"prompt_time\":0.075697153,\"completion_tokens\":29,\"completion_time\":0.067848407,\"total_tokens\":833,\"total_time\":0.14354556},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01k5btz2r8fvttd0ac571zn36d\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (end)_1_afed58570a68bee9f3eaaeb74bd21481.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (end)_1_afed58570a68bee9f3eaaeb74bd21481.json
deleted file mode 100644
index ed2bccd239..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/add a new paragraph (end)_1_afed58570a68bee9f3eaaeb74bd21481.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-37b04888-a742-4a48-b808-ecfca77834fa\",\"object\":\"chat.completion.chunk\",\"created\":1758783555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztphc7f0j85995eq2zqryg\"}}\n\ndata: {\"id\":\"chatcmpl-37b04888-a742-4a48-b808-ecfca77834fa\",\"object\":\"chat.completion.chunk\",\"created\":1758783555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"00kkp36kc\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-37b04888-a742-4a48-b808-ecfca77834fa\",\"object\":\"chat.completion.chunk\",\"created\":1758783555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztphc7f0j85995eq2zqryg\",\"usage\":{\"queue_time\":0.14394342,\"prompt_tokens\":798,\"prompt_time\":0.066320232,\"completion_tokens\":33,\"completion_time\":0.09610912,\"total_tokens\":831,\"total_time\":0.162429352}},\"usage\":{\"queue_time\":0.14394342,\"prompt_tokens\":798,\"prompt_time\":0.066320232,\"completion_tokens\":33,\"completion_time\":0.09610912,\"total_tokens\":831,\"total_time\":0.162429352}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_fe59ff1267687115e7e961232d04f24b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_fe59ff1267687115e7e961232d04f24b.json
deleted file mode 100644
index f683a08a01..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (empty doc)_1_fe59ff1267687115e7e961232d04f24b.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-f71eec30-c95a-4939-944d-fdc00e242821\",\"object\":\"chat.completion.chunk\",\"created\":1758112652,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5btw6ytek0r16s3sthtx9se\"}}\n\ndata: {\"id\":\"chatcmpl-f71eec30-c95a-4939-944d-fdc00e242821\",\"object\":\"chat.completion.chunk\",\"created\":1758112652,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"6s9rm4q77\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eYou look great today!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f71eec30-c95a-4939-944d-fdc00e242821\",\"object\":\"chat.completion.chunk\",\"created\":1758112652,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5btw6ytek0r16s3sthtx9se\",\"usage\":{\"queue_time\":0.168351773,\"prompt_tokens\":804,\"prompt_time\":0.073329341,\"completion_tokens\":29,\"completion_time\":0.069905777,\"total_tokens\":833,\"total_time\":0.143235118}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_1979d1c04b36b4f2eca4cf56d08fa9ff.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_1979d1c04b36b4f2eca4cf56d08fa9ff.json
deleted file mode 100644
index 47497bd92a..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add a new paragraph (end)_1_1979d1c04b36b4f2eca4cf56d08fa9ff.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Code
\\\",\\\"
\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 577,\n \"completion_tokens\": 54,\n \"total_tokens\": 631,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_d8165fc89a6e7197e2d91a383efd4b02.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_d8165fc89a6e7197e2d91a383efd4b02.json
deleted file mode 100644
index 425b52ebd5..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a list (end)_1_d8165fc89a6e7197e2d91a383efd4b02.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `console.log('hello world');
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\",\\\"
\\\"]}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 561,\n \"completion_tokens\": 49,\n \"total_tokens\": 610,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_f995fb9d1a58b0de101fa3438590e799.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_f995fb9d1a58b0de101fa3438590e799.json
deleted file mode 100644
index 0ba75a5db8..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/add a new paragraph (empty doc)_1_f995fb9d1a58b0de101fa3438590e799.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlorADht1R3YGusHopMVIZvp7kqQ\",\n \"object\": \"chat.completion\",\n \"created\": 1758113101,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_OX2cyQQ9EMN0MNdexm6rAI6m\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"write a new paragraph with the text 'You look great today!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_1lF7mVkB2AdUiZ0zi77AacUz\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"wNhXVX6cSgdp1\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jBXRIPZvx\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ZMZLKbIOXtM1O1u\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"s0R5oKhmfmuIjxh\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"267KioOzKNHJtg\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hwNFoVPIaC2SY\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NZ9xZZY16bbNRL\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"T\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"U7xRh4HpBYbj1P\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"M7\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hK9cSXXgP6FKVc\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"A6Mv2Yju32D470\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Eh1OA3DggkzjlW\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5s\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ft\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">You\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"b3RBRDL2CLGdJDX\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" look\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hbJVneslejOlOe\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" great\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"28lpVtr66C8oS\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" today\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nLet94iFQ23qt\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"iN\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XU\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"O\"}\n\ndata: {\"id\":\"chatcmpl-CGlq5JeOhTFWi2ZgMxNdedbin7BON\",\"object\":\"chat.completion.chunk\",\"created\":1758113177,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"8G6eGDz\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_101445be13e5db1922d2422ca47b6666.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_101445be13e5db1922d2422ca47b6666.json
deleted file mode 100644
index a93d0e458d..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/add a new paragraph (end)_1_101445be13e5db1922d2422ca47b6666.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Code
\\\",\\\"
\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":59,\"item_id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"console.log('hello world');Code
\\\",\\\"
\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":60,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"console.log('hello world');Code
\\\",\\\"
\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":61,\"response\":{\"id\":\"resp_68d4e7d109e48194af28a13eee7d8cd400bf99f43c7482b6\",\"object\":\"response\",\"created_at\":1758783441,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7d198cc8194b6e5a9a0488c185f00bf99f43c7482b6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"console.log('hello world');Code
\\\",\\\"
\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":632,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":687},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_acd39fdc6762628fe6f6f97d96d70a78.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_acd39fdc6762628fe6f6f97d96d70a78.json
new file mode 100644
index 0000000000..6188aaf56a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a list (end)_1_acd39fdc6762628fe6f6f97d96d70a78.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `console.log('hello world');
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\",\\\"
\\\"]}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":54,\"item_id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
\\\",\\\"
\\\"]}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":55,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
\\\",\\\"
\\\"]}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":56,\"response\":{\"id\":\"resp_68d4e7cf047c8196af4dedb3d1d0f73d0676329e74b5c2cf\",\"object\":\"response\",\"created_at\":1758783439,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7cfb48481968218dc89e46ff0b20676329e74b5c2cf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
\\\",\\\"
\\\"]}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":616,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":666},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_3912ffdff061476f701b59e0f28a5515.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_3912ffdff061476f701b59e0f28a5515.json
new file mode 100644
index 0000000000..f239da856c
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add a new paragraph (empty doc)_1_3912ffdff061476f701b59e0f28a5515.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7d305508190889ec835751773250bfa6fe27e617b3b\",\"object\":\"response\",\"created_at\":1758783443,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7d305508190889ec835751773250bfa6fe27e617b3b\",\"object\":\"response\",\"created_at\":1758783443,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"5qyCQmD6LNyZHm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"NR1aao\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"M9Y7D6Ua0rVhY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"XOPac27XcmbMSu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"Ot1WWp2AuD6H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"FHf9hQg56yxGk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"wSJ9sINvev\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"6NBZdV5wtowRb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"a8KDwdhU8Vib32\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WmFmNFSmFnirt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"bbKsKliXLhu0e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"maOUKCZDbLSmTz6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"NKjNtohkVJA71oh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"rFCt2O7itzG3N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"C6TTEeKrdWE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"nSxsUudX8bLIm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"AtSsst0UjUjPONf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"gFxud1fmg1zDRBw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\">You\",\"logprobs\":[],\"obfuscation\":\"cECUfT1Ma84Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\" look\",\"logprobs\":[],\"obfuscation\":\"QRcP28jhm9M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\" great\",\"logprobs\":[],\"obfuscation\":\"KWMe6POTaf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\" today\",\"logprobs\":[],\"obfuscation\":\"9sz17rUHq3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"tpTSUZeqLTEGp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"oDC4r4uRS61urbj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"qP41TrMjf8QsaQT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"7pHXS00r44KxtM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"x7oW3wrJh3cFeK\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7d38fdc8190ba96d9f6858a67fa0bfa6fe27e617b3b\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Code
\\\",\\\"
\\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":58,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"console.log('hello world');Code
\\\",\\\"
\\\"]}]}\",\"call_id\":\"call_X4U9TjMOwTocVPpy8TRfvDbt\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":59,\"response\":{\"id\":\"resp_68d4e7af7dac8190a74530a69cb68f170289e878de34b6ac\",\"object\":\"response\",\"created_at\":1758783407,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7b0176c8190b1b0d330bb2c1b620289e878de34b6ac\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"console.log('hello world');Code
\\\",\\\"
\\\"]}]}\",\"call_id\":\"call_X4U9TjMOwTocVPpy8TRfvDbt\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":569,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":55,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":624},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_ac04492f6c52be72c3dc24214a0cf744.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_ac04492f6c52be72c3dc24214a0cf744.json
new file mode 100644
index 0000000000..d73b1c06c3
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a list (end)_1_ac04492f6c52be72c3dc24214a0cf744.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `console.log('hello world');
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
\\\",\\\"
\\\"]}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":53,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
\\\",\\\"
\\\"]}]}\",\"call_id\":\"call_uxYgx7L7SEANkbb6LpJJ52Bs\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":54,\"response\":{\"id\":\"resp_68d4e7ae47f88194b73d9c04ce0b84320b8012f9bd63ebbd\",\"object\":\"response\",\"created_at\":1758783406,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7aec0248194a8344f69ffa6cd890b8012f9bd63ebbd\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"add\\\",\\\"referenceId\\\":\\\"ref2$\\\",\\\"position\\\":\\\"after\\\",\\\"blocks\\\":[\\\"
\\\",\\\"
\\\"]}]}\",\"call_id\":\"call_uxYgx7L7SEANkbb6LpJJ52Bs\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":553,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":50,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":603},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_5b51dd620d4b53f36159ec97780b2929.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_5b51dd620d4b53f36159ec97780b2929.json
new file mode 100644
index 0000000000..af7b6242f5
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add a new paragraph (empty doc)_1_5b51dd620d4b53f36159ec97780b2929.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"\\\"},{\\\"cursor\\\":true}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Because the document is empty, first update the empty block before adding new blocks.\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"write a new paragraph with the text 'You look great today!'\"}]}],\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7b120988195a3564e6287b82df70b4e59e9535dcdce\",\"object\":\"response\",\"created_at\":1758783409,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7b120988195a3564e6287b82df70b4e59e9535dcdce\",\"object\":\"response\",\"created_at\":1758783409,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_b1wtebmTEkTsa9YT1pnoWvLB\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"xGvIJS1FtddzQ2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"o3Szqk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"knOtJdD2DV8BT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"utq28MZLfxYFhn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"7HeeZZLhNge6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"cHYpAhqaiObys\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"JSbBNn9hSF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"TqHozEhG0MiZ7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"yWZ6TNksEQVzXe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"HZucIMr6B1MNJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"p9uGx4iubxXb4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"eBUNJ82WGpfip9T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"SbdZZI6xQzuJmqg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"RPe6ITSCzyL59\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"34TFSQwlQb0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"MDg6cyFVh3szL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"RaGsFxlMHjLDMI8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"wwtY8D1EwQyGI7y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\">You\",\"obfuscation\":\"BrKAcxTmRJrE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\" look\",\"obfuscation\":\"Zbz7CZLvUam\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\" great\",\"obfuscation\":\"3B8kD7Bini\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\" today\",\"obfuscation\":\"3CKc7lQkxh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"zfqNqLMkpTdkv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"9eyVM0DCSc5dKEX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"cypofRQlEkZcvmk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"cyKjv5fAXBx0YG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"IW8CHEYMPVquGV\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7b1f11c8195b30f1dab4eb2ad410b4e59e9535dcdce\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"
\"},{\"type\":\"update\",\"id\":\"ref3$\",\"block\":\"
\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":983,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":101,\"service_tier\":\"standard\"}}",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/update block prop and content_1_67f8ed4835e5bf0e13830ee0fa1cf8c8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block prop and content_1_67f8ed4835e5bf0e13830ee0fa1cf8c8.json
deleted file mode 100644
index 13fc10dc1b..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block prop and content_1_67f8ed4835e5bf0e13830ee0fa1cf8c8.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages",
- "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1268,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":77,\"service_tier\":\"standard\"}}",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/update block type_1_8196a2ed33ecf8a9e47b5faf61fcc937.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_8196a2ed33ecf8a9e47b5faf61fcc937.json
deleted file mode 100644
index e317cf4066..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (non-streaming)/update block type_1_8196a2ed33ecf8a9e47b5faf61fcc937.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=anthropic&url=https%3A%2F%2Fapi.anthropic.com%2Fv1%2Fmessages",
- "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"temperature\":0,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\"}]}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":75,\"service_tier\":\"standard\"}}",
- "headers": []
- }
-}
\ No newline at end of file
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)/clear block formatting_1_327facc19973ed5bf5dfbb06bc842f58.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)/clear block formatting_1_327facc19973ed5bf5dfbb06bc842f58.json
new file mode 100644
index 0000000000..2546bc9356
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/clear block formatting_1_327facc19973ed5bf5dfbb06bc842f58.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List items are 1 block with 1 list item each, so block content `
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
` is valid, but `
` is invalid. We'll merge them automatically.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"
block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"}]\"},{\"type\":\"text\",\"text\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph uppercase\"}]}],\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_014L8gC6UAq8bp7QppPB3y2N\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1100,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01Lg2YNghf1zmp6JnSuLhS9C\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ope\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rations\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"update\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"1$\\\",\\\"block\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"I NE\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ED TO BUY:<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p>\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1100,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":85} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_91c94c8501e2f1d5d25c8e9c360dd3d1.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_91c94c8501e2f1d5d25c8e9c360dd3d1.json
new file mode 100644
index 0000000000..96105480fe
--- /dev/null
+++ 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_91c94c8501e2f1d5d25c8e9c360dd3d1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"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.
\\\"}]\"},{\"type\":\"text\",\"text\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01RHWdfe3GttBYFD8uymp3hb\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01EtHJqkA1WcbHgsnKBQqn9S\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"o\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"per\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ati\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ons\\\": [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"update\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\\\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef1$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"block\\\":\\\"Hello,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"@Jane Do\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!
\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1255,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":108} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_adde6c9d6144449d4c436ed39a9afcb1.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_adde6c9d6144449d4c436ed39a9afcb1.json
new file mode 100644
index 0000000000..7b6c6fe833
--- /dev/null
+++ 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_adde6c9d6144449d4c436ed39a9afcb1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"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.
\\\"}]\"},{\"type\":\"text\",\"text\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01K89m33oXhseDaoihmZZhks\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01VbfEL5BFHto2moN6AhvgVX\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operatio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\\\",\\\"id\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"ref1$\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"block\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>Hallo, We\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lt!\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":85} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_4d2b9b00dc36b2bb12aae561adde829e.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_4d2b9b00dc36b2bb12aae561adde829e.json
new file mode 100644
index 0000000000..e5579c4e72
--- /dev/null
+++ 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_4d2b9b00dc36b2bb12aae561adde829e.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"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.
\\\"}]\"},{\"type\":\"text\",\"text\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01DBgNaUXJ7tf1JNN2UW4S7q\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1247,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01WyvDfvjy9ktfdr49g5c5vC\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"operatio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"[{\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\":\\\"updat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"ref2$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"block\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hel\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lo, @John\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" Doe\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"! How a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"re you d\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"oing\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"? This te\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"xt is blue!<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/span>
\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1247,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":159} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_06ade1c91064a7b257315d7cfb3dae1c.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_06ade1c91064a7b257315d7cfb3dae1c.json
new file mode 100644
index 0000000000..407ae41c80
--- /dev/null
+++ 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_06ade1c91064a7b257315d7cfb3dae1c.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"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.
\\\"}]\"},{\"type\":\"text\",\"text\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01VWWDSMaVw5PSXGyGgPVaNT\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1264,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":9,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01Cko3mbKoa29sywhK5CW6PB\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ope\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ions\\\": [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\\\",\\\"i\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\":\\\"ref2\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"block\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"Hello! H\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ow are \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"you doing?\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"strong> \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Thi\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s text i\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s blu\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"
\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1264,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":136} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_24881d7683d6ecbd852f58f6580259f4.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_24881d7683d6ecbd852f58f6580259f4.json
new file mode 100644
index 0000000000..3237953e59
--- /dev/null
+++ 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_24881d7683d6ecbd852f58f6580259f4.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"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.
\\\"}]\"},{\"type\":\"text\",\"text\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_019WbBWd2h9YZpiX4Rrm4GUp\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1254,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":9,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01DgxzxsKRTwNzqccDGNLBAj\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ations\\\": [{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"type\\\":\\\"up\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"da\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f2$\\\",\\\"block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"Hello,\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" updated\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" content\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"
\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1254,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":82} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_1c9a4f955e0248798e87ab2412de660d.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_1c9a4f955e0248798e87ab2412de660d.json
new file mode 100644
index 0000000000..67f4604f4b
--- /dev/null
+++ 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_1c9a4f955e0248798e87ab2412de660d.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"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.
\\\"}]\"},{\"type\":\"text\",\"text\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_015pJyps6S5YiRLVqSCZnoRA\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1246,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01LnuGKKLbDv3pepj4Aed8nQ\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operatio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"update\\\",\\\"i\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"d\\\":\\\"ref2$\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"bloc\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"Hel\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lo, @J\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ane Do\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e! How a\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" you\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" doing\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"?\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"strong> <\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"spa\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"n st\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"yle=\\\\\\\"color\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\": rgb(11, \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"11\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"0, 153);\\\\\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\" data-sty\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"le-t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype=\\\\\\\"te\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"xtColor\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\\\\\" data\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"-value=\\\\\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ue\\\\\\\" \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"da\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ta-editab\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"le=\\\\\\\"\\\\\\\">Th\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"is text is b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lue\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!
\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1246,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":165} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_9e3a8c2b7c0c40aa89c4b52ccf040007.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_9e3a8c2b7c0c40aa89c4b52ccf040007.json
new file mode 100644
index 0000000000..58623e1b39
--- /dev/null
+++ 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_9e3a8c2b7c0c40aa89c4b52ccf040007.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"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.
\\\"}]\"},{\"type\":\"text\",\"text\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01N6gguFbmrpB3zPNjTV8Qze\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1256,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01TGKKHKnfNjJzgv5tkY2z8C\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"op\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"erations\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ate\\\",\\\"id\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f2$\\\",\\\"block\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"Hallo, \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"@J\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"oh\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"n D\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"oe\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"! <\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"strong>Wie \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"geht e\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s dir?<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/s\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"trong> Die\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ser Text i\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"st blau\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"span\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\">
\\\"}]}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1256,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":171} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_d4c19bfff5993efff243e799e4055cc9.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_d4c19bfff5993efff243e799e4055cc9.json
new file mode 100644
index 0000000000..abe7d54ccc
--- /dev/null
+++ 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_d4c19bfff5993efff243e799e4055cc9.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"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.
\\\"}]\"},{\"type\":\"text\",\"text\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01627EKhkLMKM1YfPmyjQizq\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1243,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":14,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01LdYkLMWitySqsvr8FNPdWQ\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ion\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s\\\": [{\\\"type\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"upda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"re\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"f1$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"strong>He\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"llo, world\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1243,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":85} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_e31071ae9ad80a23786ec0afc5106c32.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_e31071ae9ad80a23786ec0afc5106c32.json
new file mode 100644
index 0000000000..3cbe3ab07d
--- /dev/null
+++ 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_e31071ae9ad80a23786ec0afc5106c32.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"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.
\\\"}]\"},{\"type\":\"text\",\"text\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_014QMhbYAsD6Mam73kEccqyw\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1251,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_016xYmjNXJLrvVDbtQDhDXqg\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operatio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"typ\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\":\\\"update\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ref1$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"b\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\":\\\"He\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"llo, world!\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"<\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p>\\\"}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1251,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":86}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_efc8d37a125c48a5d0af15ecaf8e4b20.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_efc8d37a125c48a5d0af15ecaf8e4b20.json
new file mode 100644
index 0000000000..2a5339ab7e
--- /dev/null
+++ 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_efc8d37a125c48a5d0af15ecaf8e4b20.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List 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.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello
\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"Hello, world!
\\\"},{\\\"block\\\":\\\"Hello, @John Doe! How are you doing? This text is blue!
\\\"},{\\\"block\\\":\\\"Hello, world! Bold text. Link.
\\\"}]\"}],\"messages\":[{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_016ydVFMkR31aTbroxEAtZGc\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1060,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":12,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01RPXHoaopVHdtZWFheCZuyb\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"o\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pe\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"rations\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"update\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"id\\\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef2$\\\",\\\"b\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"lock\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"Hallo<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\">\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1060,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":81} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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)/turn paragraphs into list_1_3ba9845d9c519b43ddbadaddb122d431.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)/turn paragraphs into list_1_3ba9845d9c519b43ddbadaddb122d431.json
new file mode 100644
index 0000000000..79a24cab4e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/turn paragraphs into list_1_3ba9845d9c519b43ddbadaddb122d431.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List 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.\\n This is the selection as an array of html blocks:\"},{\"type\":\"text\",\"text\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Bananas
\\\"}]\"},{\"type\":\"text\",\"text\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"block\\\":\\\"Apples
\\\"},{\\\"block\\\":\\\"Bananas
\\\"}]\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_014K6CNAX5tbFU1Gw6uWChfS\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":961,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":15,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01RzTizFiGwvLVxC3GFVvTS3\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"op\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"eratio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"up\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"date\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\\\":\\\"ref2$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\\\"bl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ock\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"- A\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pples\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"li>
\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"},{\\\"type\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pdate\\\",\\\"id\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef3$\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"block\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"- Banana\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"s<\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/li>
\\\"}\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":961,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":129} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_4f6fdb800f1928aed2629f707b95b0da.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_4f6fdb800f1928aed2629f707b95b0da.json
new file mode 100644
index 0000000000..c9936efa47
--- /dev/null
+++ 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_4f6fdb800f1928aed2629f707b95b0da.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"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.
\\\"}]\"},{\"type\":\"text\",\"text\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01L99utQ9mBCxR3ppqt7YCnN\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1258,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_016tU1TWK2qZCVTcMUeQEdpq\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"operati\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ons\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\" [{\\\"t\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ype\\\":\\\"updat\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e\\\",\\\"id\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"ref\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"1$\\\",\\\"bloc\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"k\\\":\\\"What\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"'s up, \"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"world!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p>\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1258,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":93} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_b25dd6e47055e54d58f1fd1f18feb14d.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_b25dd6e47055e54d58f1fd1f18feb14d.json
new file mode 100644
index 0000000000..a2e80e76b9
--- /dev/null
+++ 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_b25dd6e47055e54d58f1fd1f18feb14d.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"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.
\\\"}]\"},{\"type\":\"text\",\"text\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_019kwHkF3Kx6zNyKfrFMrCPE\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01VD5oiJ6pNFixdAfJbqREu7\",\"name\":\"applyDocumentOperations\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"op\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"erations\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": [{\\\"type\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\\\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ate\\\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"id\\\":\\\"ref1$\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"block\\\":\\\"<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"p styl\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"e=\\\\\\\"text-\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"align: righ\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"t;\\\\\\\">\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hello, w\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"orld!<\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"/p>\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":91} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_de3f09510d3c3eee14653fe5799dbae7.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_de3f09510d3c3eee14653fe5799dbae7.json
new file mode 100644
index 0000000000..092fbeb7d6
--- /dev/null
+++ 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_de3f09510d3c3eee14653fe5799dbae7.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"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.
\\\"}]\"},{\"type\":\"text\",\"text\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01NjK3YpTUqen9fN6aq95pWX\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1258,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01B4gv765bCEAvV2r6Kkn64q\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"oper\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"atio\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ns\\\": [{\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"type\\\":\\\"upd\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ate\\\",\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"id\\\":\\\"ref1$\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\",\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"block\\\":\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"What's up, w\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"orld!\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"
\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1258,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":85} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_d805af33ab12e1bf8f2cb1a055a91fbd.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_d805af33ab12e1bf8f2cb1a055a91fbd.json
new file mode 100644
index 0000000000..1b912ca85a
--- /dev/null
+++ 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_d805af33ab12e1bf8f2cb1a055a91fbd.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "method": "POST",
+ "url": "https://api.anthropic.com/v1/messages",
+ "body": "{\"model\":\"claude-3-7-sonnet-latest\",\"max_tokens\":4096,\"system\":[{\"type\":\"text\",\"text\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"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.
\\\"}]\"},{\"type\":\"text\",\"text\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"make the first paragraph a heading\"}]}],\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01Dct1y6cHK3zr6sAm4TYqES\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-7-sonnet-20250219\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":11,\"service_tier\":\"standard\"}} }\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01U8jVttrTVfGGFKWvBbrCD2\",\"name\":\"applyDocumentOperations\",\"input\":{}} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"ope\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ra\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"tions\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\": [\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"type\\\":\\\"u\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"pda\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"te\\\",\\\"id\\\":\\\"r\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"ef1\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"$\\\",\\\"block\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\":\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"\"} }\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"Hello, world\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"!
\\\"}]}\"} }\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0 }\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":1245,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":83} }\n\nevent: message_stop\ndata: {\"type\":\"message_stop\" }\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 (non-streaming)/clear block formatting_1_350ecafb238090fa055692a72ae42198.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/clear block formatting_1_350ecafb238090fa055692a72ae42198.json
deleted file mode 100644
index 5e98bf4545..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/clear block formatting_1_350ecafb238090fa055692a72ae42198.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Colored text
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Aligned text
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"clear the formatting (colors and alignment)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-f38d95e3-c265-45c6-a279-5fde0aa8ba1e\",\"object\":\"chat.completion\",\"created\":1758112754,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"rqfr2rp20\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eColored text\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAligned text\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.093303647,\"prompt_tokens\":859,\"prompt_time\":0.065896195,\"completion_tokens\":59,\"completion_time\":0.125717433,\"total_tokens\":918,\"total_time\":0.191613628},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btzarke2krsbcczn0tpxzd\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/drop mark and link and change text within mark_1_4c51960ed572671e7cf73db4566e3d99.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_4c51960ed572671e7cf73db4566e3d99.json
deleted file mode 100644
index 11cf5bbf33..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link and change text within mark_1_4c51960ed572671e7cf73db4566e3d99.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-15cf615d-e36d-463b-b84f-467e3afc49ec\",\"object\":\"chat.completion\",\"created\":1758112753,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"rtjxcxane\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHi, world! Bold the text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.08603614,\"prompt_tokens\":960,\"prompt_time\":0.089924362,\"completion_tokens\":39,\"completion_time\":0.076131604,\"total_tokens\":999,\"total_time\":0.166055966},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btz9bbe2e9cky4eb929xp5\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/drop mark and link_1_7a6d23fe91e74cf9675ae6e6124fd126.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_7a6d23fe91e74cf9675ae6e6124fd126.json
deleted file mode 100644
index 4677123f06..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/drop mark and link_1_7a6d23fe91e74cf9675ae6e6124fd126.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-17b67970-fce8-4ccd-881f-66a47540309c\",\"object\":\"chat.completion\",\"created\":1758112761,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"zdvrkac2k\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, world! Bold text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.085895811,\"prompt_tokens\":954,\"prompt_time\":0.11500097,\"completion_tokens\":37,\"completion_time\":0.100138151,\"total_tokens\":991,\"total_time\":0.215139121},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01k5btzhacft79zdq5ybcf2a3m\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/modify nested content_1_2535147f7b24a35891e156c4b19d8ffe.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify nested content_1_2535147f7b24a35891e156c4b19d8ffe.json
deleted file mode 100644
index a4e52c8cf1..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify nested content_1_2535147f7b24a35891e156c4b19d8ffe.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-31117f6b-75f9-403d-84c0-f4a78a571063\",\"object\":\"chat.completion\",\"created\":1758112753,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"7f8nwj6tn\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAPPLES\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.085357545,\"prompt_tokens\":819,\"prompt_time\":0.083527899,\"completion_tokens\":28,\"completion_time\":0.068270667,\"total_tokens\":847,\"total_time\":0.151798566},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01k5btza1se2htzgb8zknn1p92\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/modify parent content_1_70beec3279ca4894a71d425293fc3ead.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify parent content_1_70beec3279ca4894a71d425293fc3ead.json
deleted file mode 100644
index 27d2490b42..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/modify parent content_1_70beec3279ca4894a71d425293fc3ead.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-ab642a3c-21b3-4458-adaf-71b88287d040\",\"object\":\"chat.completion\",\"created\":1758112754,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"vd3q5mjgw\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eI NEED TO BUY:\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.087788734,\"prompt_tokens\":821,\"prompt_time\":0.074584331,\"completion_tokens\":33,\"completion_time\":0.075417942,\"total_tokens\":854,\"total_time\":0.150002273},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btzaepfsy94xvae1y63326\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/plain source block, add mention_1_01fbf08ac456e3dbbd64103c41f21a4d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_01fbf08ac456e3dbbd64103c41f21a4d.json
deleted file mode 100644
index 6aedd8f681..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/plain source block, add mention_1_01fbf08ac456e3dbbd64103c41f21a4d.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-afe0dd8d-8f02-482d-8c3c-4cd3841d843b\",\"object\":\"chat.completion\",\"created\":1758112751,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"wyhg98e2e\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.166522262,\"prompt_tokens\":952,\"prompt_time\":0.08071759,\"completion_tokens\":52,\"completion_time\":0.101782396,\"total_tokens\":1004,\"total_time\":0.182499986},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_4d4005649c\",\"x_groq\":{\"id\":\"req_01k5btz7vsfsstdcgbb40zs0nn\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/standard update_1_51020afd3498ab35dc016c36e1e0c6b8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_51020afd3498ab35dc016c36e1e0c6b8.json
deleted file mode 100644
index 2baffa3f60..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/standard update_1_51020afd3498ab35dc016c36e1e0c6b8.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-39f097a2-667a-43bd-a17d-b0c9d3cfb644\",\"object\":\"chat.completion\",\"created\":1758112746,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"57rvn6p5a\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, Welt!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.084368128,\"prompt_tokens\":943,\"prompt_time\":0.079126227,\"completion_tokens\":34,\"completion_time\":0.107007369,\"total_tokens\":977,\"total_time\":0.186133596},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01k5btz320fse9934j938wrqbr\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/styles + ic in source block, remove mark_1_ad61d6ba098240616fe2106324f993e4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_ad61d6ba098240616fe2106324f993e4.json
deleted file mode 100644
index 8dd15f6f5f..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mark_1_ad61d6ba098240616fe2106324f993e4.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-f9e71b67-5450-4d12-8d2a-a7d3f6779d55\",\"object\":\"chat.completion\",\"created\":1758113299,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"ssxg295zp\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! How are you doing? \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.166768861,\"prompt_tokens\":945,\"prompt_time\":0.08303688,\"completion_tokens\":99,\"completion_time\":0.171461053,\"total_tokens\":1044,\"total_time\":0.254497933},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_4d4005649c\",\"x_groq\":{\"id\":\"req_01k5bvfya4etvvr7te0etzxgwd\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/styles + ic in source block, remove mention_1_75f14cc4df749a9a1a0a838d62ae2678.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_75f14cc4df749a9a1a0a838d62ae2678.json
deleted file mode 100644
index 07864a1877..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, remove mention_1_75f14cc4df749a9a1a0a838d62ae2678.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-f35a51e6-0767-46e5-8fe9-5f3243dd9539\",\"object\":\"chat.completion\",\"created\":1758112750,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"b7fa0erb6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.091975708,\"prompt_tokens\":961,\"prompt_time\":0.072977039,\"completion_tokens\":81,\"completion_time\":0.152069195,\"total_tokens\":1042,\"total_time\":0.225046234},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btz6mce2c9j37txcw4mgz5\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/styles + ic in source block, replace content_1_35f272b43423355f2a5dbbd1e49b4366.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, replace content_1_35f272b43423355f2a5dbbd1e49b4366.json
deleted file mode 100644
index a8475cb169..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, replace content_1_35f272b43423355f2a5dbbd1e49b4366.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-5fbd9d89-9eec-4d84-b463-3eddbd80a572\",\"object\":\"chat.completion\",\"created\":1758112749,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"kmg5kk4w3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, updated content\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.085052088,\"prompt_tokens\":951,\"prompt_time\":0.085216352,\"completion_tokens\":29,\"completion_time\":0.061744151,\"total_tokens\":980,\"total_time\":0.146960503},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01k5btz59dfsmajcxeejyqggw4\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/styles + ic in source block, update mention prop_1_f60fdbb256106a235e820360bc2195ca.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_f60fdbb256106a235e820360bc2195ca.json
deleted file mode 100644
index 20493638d7..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update mention prop_1_f60fdbb256106a235e820360bc2195ca.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-f2beaf21-728f-4721-bde7-39f3e9b6a577\",\"object\":\"chat.completion\",\"created\":1758112761,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"e1n61yp7n\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.092638797,\"prompt_tokens\":943,\"prompt_time\":0.071674968,\"completion_tokens\":103,\"completion_time\":0.196202009,\"total_tokens\":1046,\"total_time\":0.267876977},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btzgwse2w9q8qk6bxjy5bt\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/styles + ic in source block, update text_1_5853e0d779926ddd5b628ed248c652f0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update text_1_5853e0d779926ddd5b628ed248c652f0.json
deleted file mode 100644
index ae37307f1b..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in source block, update text_1_5853e0d779926ddd5b628ed248c652f0.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-9ea03bff-b285-4f80-9581-30560fb6c33d\",\"object\":\"chat.completion\",\"created\":1758114034,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"9h12d96qx\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eWie geht es dir?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eDieser Text ist blau!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.169492052,\"prompt_tokens\":952,\"prompt_time\":0.084552484,\"completion_tokens\":106,\"completion_time\":0.221967353,\"total_tokens\":1058,\"total_time\":0.306519837},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_4d4005649c\",\"x_groq\":{\"id\":\"req_01k5bw6c6hft4tprrdvae7hsn8\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_865f7c1246731fba1044fe8d23bfab53.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (paragraph)_1_865f7c1246731fba1044fe8d23bfab53.json
deleted file mode 100644
index 5ed73dd9e2..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (paragraph)_1_865f7c1246731fba1044fe8d23bfab53.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-a346e7b8-2182-4ff3-8935-ea413dbb19a5\",\"object\":\"chat.completion\",\"created\":1758112751,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"px83b6d45\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003e\\\\u003cstrong\\\\u003eHello, world!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.142623814,\"prompt_tokens\":941,\"prompt_time\":0.091884803,\"completion_tokens\":37,\"completion_time\":0.107921431,\"total_tokens\":978,\"total_time\":0.199806234},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_21854da540\",\"x_groq\":{\"id\":\"req_01k5btz7eee2d9mepg4at5g36p\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/styles + ic in target block, add mark (word)_1_c9082ff81f975fcc97a7b4564ed31cf6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (word)_1_c9082ff81f975fcc97a7b4564ed31cf6.json
deleted file mode 100644
index 44df58c49e..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/styles + ic in target block, add mark (word)_1_c9082ff81f975fcc97a7b4564ed31cf6.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-b92eea24-5531-4528-8487-ca270422a1d3\",\"object\":\"chat.completion\",\"created\":1758112750,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"zdf0b0jha\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cstrong\\\\u003eworld!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.166605488,\"prompt_tokens\":948,\"prompt_time\":0.082441187,\"completion_tokens\":33,\"completion_time\":0.101207657,\"total_tokens\":981,\"total_time\":0.183648844},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_4d4005649c\",\"x_groq\":{\"id\":\"req_01k5btz71afssa311s15cqgyeg\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/translate selection_1_e40023b9b9cf64ea508c42520ce54a92.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translate selection_1_e40023b9b9cf64ea508c42520ce54a92.json
deleted file mode 100644
index a4b6be3614..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/translate selection_1_e40023b9b9cf64ea508c42520ce54a92.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List 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.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello
\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"Hello, world!
\\\"},{\\\"block\\\":\\\"Hello, @John Doe! How are you doing? This text is blue!
\\\"},{\\\"block\\\":\\\"Hello, world! Bold text. Link.
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-bad78f23-6ea6-4c25-a8b1-51b174cc57e6\",\"object\":\"chat.completion\",\"created\":1758112747,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"4g9v9nsj8\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.084155641,\"prompt_tokens\":784,\"prompt_time\":0.065738539,\"completion_tokens\":31,\"completion_time\":0.065473216,\"total_tokens\":815,\"total_time\":0.131211755},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btz3cyfsf9829x9p7wb4xm\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/turn paragraphs into list_1_739c4ae60051cce107204609e30188d6.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/turn paragraphs into list_1_739c4ae60051cce107204609e30188d6.json
deleted file mode 100644
index 278530ac15..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/turn paragraphs into list_1_739c4ae60051cce107204609e30188d6.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List 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.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Bananas
\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"block\\\":\\\"Apples
\\\"},{\\\"block\\\":\\\"Bananas
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-e1cc001e-649a-4db7-9d45-758e16016672\",\"object\":\"chat.completion\",\"created\":1758112753,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"nmmbjfh0d\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.087624781,\"prompt_tokens\":704,\"prompt_time\":0.059396698,\"completion_tokens\":65,\"completion_time\":0.134694452,\"total_tokens\":769,\"total_time\":0.19409115},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btz9nkfswvktvbmyazeg09\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/update block prop and content_1_5a277f291beced18ef6642e6452c04f8.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_5a277f291beced18ef6642e6452c04f8.json
deleted file mode 100644
index da74d72657..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop and content_1_5a277f291beced18ef6642e6452c04f8.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-1aaf21f4-5b17-4459-be76-92812db0b518\",\"object\":\"chat.completion\",\"created\":1758112748,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"t6ssv81cm\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\\\u003eWhat's up, world!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.084567259,\"prompt_tokens\":955,\"prompt_time\":0.081947819,\"completion_tokens\":37,\"completion_time\":0.112192401,\"total_tokens\":992,\"total_time\":0.19414022},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btz4yje28aw8rghzat58e0\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/update block prop_1_8194a0fd672e45b8537bb497f8ad3bb0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_8194a0fd672e45b8537bb497f8ad3bb0.json
deleted file mode 100644
index 7971a544f8..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block prop_1_8194a0fd672e45b8537bb497f8ad3bb0.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-43a0de16-23b6-4717-ad83-ca37bff9e2ce\",\"object\":\"chat.completion\",\"created\":1758112747,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"dz5xb4324\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\\\u003eHello, world!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.168558608,\"prompt_tokens\":943,\"prompt_time\":0.08278354,\"completion_tokens\":39,\"completion_time\":0.091890941,\"total_tokens\":982,\"total_time\":0.174674481},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_4d4005649c\",\"x_groq\":{\"id\":\"req_01k5btz41ze28bqdv9pc5a0q2d\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/update block type and content_1_808d14b549ccb577b7baa1c33e8433d1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_808d14b549ccb577b7baa1c33e8433d1.json
deleted file mode 100644
index 57a4d0ca14..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type and content_1_808d14b549ccb577b7baa1c33e8433d1.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-85f0a2e4-8e9b-4d3c-b6c5-4c0c093a78c3\",\"object\":\"chat.completion\",\"created\":1758112748,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"f4b00zjw4\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eWhat's up, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.087940401,\"prompt_tokens\":955,\"prompt_time\":0.078279455,\"completion_tokens\":33,\"completion_time\":0.098377544,\"total_tokens\":988,\"total_time\":0.176656999},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_3f3b593e33\",\"x_groq\":{\"id\":\"req_01k5btz4hwfshshkb1ts5mp7bs\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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 (non-streaming)/update block type_1_16f9143c5a28bfa65954cba662a9e644.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_16f9143c5a28bfa65954cba662a9e644.json
deleted file mode 100644
index f619fe5733..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (non-streaming)/update block type_1_16f9143c5a28bfa65954cba662a9e644.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\"id\":\"chatcmpl-2b9b0382-1f84-42be-8cc5-a96054e54e2f\",\"object\":\"chat.completion\",\"created\":1758112747,\"model\":\"llama-3.3-70b-versatile\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"tool_calls\":[{\"id\":\"en68vcxcs\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eHello, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"}}]},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"queue_time\":0.085493777,\"prompt_tokens\":943,\"prompt_time\":0.086119742,\"completion_tokens\":35,\"completion_time\":0.104937445,\"total_tokens\":978,\"total_time\":0.191057187},\"usage_breakdown\":null,\"system_fingerprint\":\"fp_2ddfbb0da0\",\"x_groq\":{\"id\":\"req_01k5btz3pafsf8bxt0makhgktn\"},\"service_tier\":\"on_demand\"}\n",
- "headers": []
- }
-}
\ No newline at end of file
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)/clear block formatting_1_2f6f4db35e78d9a8094fa7f0cc5a6fef.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)/clear block formatting_1_2f6f4db35e78d9a8094fa7f0cc5a6fef.json
deleted file mode 100644
index da7f34a0ed..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/clear block formatting_1_2f6f4db35e78d9a8094fa7f0cc5a6fef.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Colored text
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Aligned text
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"clear the formatting (colors and alignment)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-78ada62d-c14e-41c5-8141-216a2432bec0\",\"object\":\"chat.completion.chunk\",\"created\":1758112558,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5btsbheef2rj1fq7zs1kb81\"}}\n\ndata: {\"id\":\"chatcmpl-78ada62d-c14e-41c5-8141-216a2432bec0\",\"object\":\"chat.completion.chunk\",\"created\":1758112558,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"g8y38s3cd\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eColored text\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAligned text\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-78ada62d-c14e-41c5-8141-216a2432bec0\",\"object\":\"chat.completion.chunk\",\"created\":1758112558,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5btsbheef2rj1fq7zs1kb81\",\"usage\":{\"queue_time\":0.083550265,\"prompt_tokens\":859,\"prompt_time\":0.070453057,\"completion_tokens\":59,\"completion_time\":0.113175937,\"total_tokens\":918,\"total_time\":0.183628994}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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)/clear block formatting_1_3b802465d0bbbdbbcb387b14492eefcc.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)/clear block formatting_1_3b802465d0bbbdbbcb387b14492eefcc.json
new file mode 100644
index 0000000000..2c3ab6187d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/clear block formatting_1_3b802465d0bbbdbbcb387b14492eefcc.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Colored text
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Aligned text
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"clear the formatting (colors and alignment)\"}],\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-965353ac-e40d-49b6-a752-90b518464e71\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk9hpey6934px74m454ay\"}}\n\ndata: {\"id\":\"chatcmpl-965353ac-e40d-49b6-a752-90b518464e71\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"pznsbf1sf\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eColored text\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAligned text\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-965353ac-e40d-49b6-a752-90b518464e71\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk9hpey6934px74m454ay\",\"usage\":{\"queue_time\":0.143383351,\"prompt_tokens\":853,\"prompt_time\":0.083652147,\"completion_tokens\":53,\"completion_time\":0.102347837,\"total_tokens\":906,\"total_time\":0.185999984}},\"usage\":{\"queue_time\":0.143383351,\"prompt_tokens\":853,\"prompt_time\":0.083652147,\"completion_tokens\":53,\"completion_time\":0.102347837,\"total_tokens\":906,\"total_time\":0.185999984}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_1138449389739970ddab00e2ca2b4bca.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_1138449389739970ddab00e2ca2b4bca.json
new file mode 100644
index 0000000000..72f13cf027
--- /dev/null
+++ 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_1138449389739970ddab00e2ca2b4bca.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-ecabb3fc-edae-463e-846f-e52b349f800f\",\"object\":\"chat.completion.chunk\",\"created\":1758783447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk7rxe098nrb9ap54bj3t\"}}\n\ndata: {\"id\":\"chatcmpl-ecabb3fc-edae-463e-846f-e52b349f800f\",\"object\":\"chat.completion.chunk\",\"created\":1758783447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"q9jmph8gx\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHi, world! Bold the text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-ecabb3fc-edae-463e-846f-e52b349f800f\",\"object\":\"chat.completion.chunk\",\"created\":1758783447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk7rxe098nrb9ap54bj3t\",\"usage\":{\"queue_time\":0.167779801,\"prompt_tokens\":954,\"prompt_time\":0.077852963,\"completion_tokens\":42,\"completion_time\":0.082497339,\"total_tokens\":996,\"total_time\":0.160350302}},\"usage\":{\"queue_time\":0.167779801,\"prompt_tokens\":954,\"prompt_time\":0.077852963,\"completion_tokens\":42,\"completion_time\":0.082497339,\"total_tokens\":996,\"total_time\":0.160350302}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_f67f3cef3589a8792080e7fb090b1226.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_f67f3cef3589a8792080e7fb090b1226.json
deleted file mode 100644
index 668bda0918..0000000000
--- 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_f67f3cef3589a8792080e7fb090b1226.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-f0bd7fc4-bb7a-4a40-8b62-0477b885a841\",\"object\":\"chat.completion.chunk\",\"created\":1758112557,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5btsa0pef1s2jw8rnshdap0\"}}\n\ndata: {\"id\":\"chatcmpl-f0bd7fc4-bb7a-4a40-8b62-0477b885a841\",\"object\":\"chat.completion.chunk\",\"created\":1758112557,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"ft46cn5tk\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHi, world! Bold the text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f0bd7fc4-bb7a-4a40-8b62-0477b885a841\",\"object\":\"chat.completion.chunk\",\"created\":1758112557,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5btsa0pef1s2jw8rnshdap0\",\"usage\":{\"queue_time\":0.087974126,\"prompt_tokens\":960,\"prompt_time\":0.08541297,\"completion_tokens\":35,\"completion_time\":0.076046468,\"total_tokens\":995,\"total_time\":0.161459438}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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_2f40ee8072a0c34e771a2bd001d04b3a.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_2f40ee8072a0c34e771a2bd001d04b3a.json
new file mode 100644
index 0000000000..9bccc0baf6
--- /dev/null
+++ 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_2f40ee8072a0c34e771a2bd001d04b3a.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-5f6f9c4b-d56f-41c8-a2ef-81b0a0de6d92\",\"object\":\"chat.completion.chunk\",\"created\":1758783446,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk7cae08rnk2nqttpvx27\"}}\n\ndata: {\"id\":\"chatcmpl-5f6f9c4b-d56f-41c8-a2ef-81b0a0de6d92\",\"object\":\"chat.completion.chunk\",\"created\":1758783446,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"d8b6jv74w\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, world! Bold text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-5f6f9c4b-d56f-41c8-a2ef-81b0a0de6d92\",\"object\":\"chat.completion.chunk\",\"created\":1758783446,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk7cae08rnk2nqttpvx27\",\"usage\":{\"queue_time\":0.144757613,\"prompt_tokens\":948,\"prompt_time\":0.077655455,\"completion_tokens\":36,\"completion_time\":0.100339898,\"total_tokens\":984,\"total_time\":0.177995353}},\"usage\":{\"queue_time\":0.144757613,\"prompt_tokens\":948,\"prompt_time\":0.077655455,\"completion_tokens\":36,\"completion_time\":0.100339898,\"total_tokens\":984,\"total_time\":0.177995353}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_9056181b23b2cd23325d52c3eeb6ee16.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_9056181b23b2cd23325d52c3eeb6ee16.json
deleted file mode 100644
index 1a75bf45a2..0000000000
--- 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_9056181b23b2cd23325d52c3eeb6ee16.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-29300052-c309-4b22-8f45-78910244183f\",\"object\":\"chat.completion.chunk\",\"created\":1758112638,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5btvsgdejgb6stkz6a17920\"}}\n\ndata: {\"id\":\"chatcmpl-29300052-c309-4b22-8f45-78910244183f\",\"object\":\"chat.completion.chunk\",\"created\":1758112638,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"jz9p98nqx\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, world! Bold text. Link.\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-29300052-c309-4b22-8f45-78910244183f\",\"object\":\"chat.completion.chunk\",\"created\":1758112638,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5btvsgdejgb6stkz6a17920\",\"usage\":{\"queue_time\":0.168634066,\"prompt_tokens\":954,\"prompt_time\":0.079230455,\"completion_tokens\":37,\"completion_time\":0.105188936,\"total_tokens\":991,\"total_time\":0.184419391}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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)/modify nested content_1_3d19c192afee48b2656b6bdf3ac80415.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)/modify nested content_1_3d19c192afee48b2656b6bdf3ac80415.json
new file mode 100644
index 0000000000..4be2c93f81
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_3d19c192afee48b2656b6bdf3ac80415.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-972071f1-e35e-4d51-87b9-85234cefc524\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk8wte0av0596h5byvmyp\"}}\n\ndata: {\"id\":\"chatcmpl-972071f1-e35e-4d51-87b9-85234cefc524\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"ff7ddq74b\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAPPLES\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-972071f1-e35e-4d51-87b9-85234cefc524\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2477e04561\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk8wte0av0596h5byvmyp\",\"usage\":{\"queue_time\":0.145155619,\"prompt_tokens\":813,\"prompt_time\":0.068726179,\"completion_tokens\":31,\"completion_time\":0.067908684,\"total_tokens\":844,\"total_time\":0.136634863}},\"usage\":{\"queue_time\":0.145155619,\"prompt_tokens\":813,\"prompt_time\":0.068726179,\"completion_tokens\":31,\"completion_time\":0.067908684,\"total_tokens\":844,\"total_time\":0.136634863}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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)/modify nested content_1_85a23c1da349e0f8dac714957ed75c79.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)/modify nested content_1_85a23c1da349e0f8dac714957ed75c79.json
deleted file mode 100644
index c804614ea5..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify nested content_1_85a23c1da349e0f8dac714957ed75c79.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-2c54af4d-c5d0-43f8-b083-ac92fd5a909f\",\"object\":\"chat.completion.chunk\",\"created\":1758112610,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bttxt1ehba6jjkkpc885zy\"}}\n\ndata: {\"id\":\"chatcmpl-2c54af4d-c5d0-43f8-b083-ac92fd5a909f\",\"object\":\"chat.completion.chunk\",\"created\":1758112610,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"eyjwr16cs\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eAPPLES\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-2c54af4d-c5d0-43f8-b083-ac92fd5a909f\",\"object\":\"chat.completion.chunk\",\"created\":1758112610,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bttxt1ehba6jjkkpc885zy\",\"usage\":{\"queue_time\":0.084235733,\"prompt_tokens\":819,\"prompt_time\":0.070356533,\"completion_tokens\":33,\"completion_time\":0.091628755,\"total_tokens\":852,\"total_time\":0.161985288}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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)/modify parent content_1_5ef368a4d58c5d3af10ffe058545324d.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)/modify parent content_1_5ef368a4d58c5d3af10ffe058545324d.json
deleted file mode 100644
index c0f28605e7..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_5ef368a4d58c5d3af10ffe058545324d.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-f593ad3a-89c7-4ebb-ad6d-1b499a636d5c\",\"object\":\"chat.completion.chunk\",\"created\":1758112571,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5btsqqhefqb2xzed9shrcrb\"}}\n\ndata: {\"id\":\"chatcmpl-f593ad3a-89c7-4ebb-ad6d-1b499a636d5c\",\"object\":\"chat.completion.chunk\",\"created\":1758112571,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"cr1bz20s4\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eI NEED TO BUY:\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f593ad3a-89c7-4ebb-ad6d-1b499a636d5c\",\"object\":\"chat.completion.chunk\",\"created\":1758112571,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5btsqqhefqb2xzed9shrcrb\",\"usage\":{\"queue_time\":0.086672608,\"prompt_tokens\":821,\"prompt_time\":0.07701226,\"completion_tokens\":33,\"completion_time\":0.075395576,\"total_tokens\":854,\"total_time\":0.152407836}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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)/modify parent content_1_88d6bccbefaf007c2c02e7e007c0f70b.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)/modify parent content_1_88d6bccbefaf007c2c02e7e007c0f70b.json
new file mode 100644
index 0000000000..0cc62d93c8
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/modify parent content_1_88d6bccbefaf007c2c02e7e007c0f70b.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-465233f2-e380-4a62-afed-9e3186f9ac2e\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk97je0ats42dhpqxpy95\"}}\n\ndata: {\"id\":\"chatcmpl-465233f2-e380-4a62-afed-9e3186f9ac2e\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"1ydxzxq8x\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eI NEED TO BUY:\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-465233f2-e380-4a62-afed-9e3186f9ac2e\",\"object\":\"chat.completion.chunk\",\"created\":1758783448,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk97je0ats42dhpqxpy95\",\"usage\":{\"queue_time\":0.133331912,\"prompt_tokens\":815,\"prompt_time\":0.068012475,\"completion_tokens\":32,\"completion_time\":0.073286743,\"total_tokens\":847,\"total_time\":0.141299218}},\"usage\":{\"queue_time\":0.133331912,\"prompt_tokens\":815,\"prompt_time\":0.068012475,\"completion_tokens\":32,\"completion_time\":0.073286743,\"total_tokens\":847,\"total_time\":0.141299218}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_5ac53cae2b0994f5de466affabaad58e.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_5ac53cae2b0994f5de466affabaad58e.json
deleted file mode 100644
index ef87f46ebe..0000000000
--- 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_5ac53cae2b0994f5de466affabaad58e.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-c2885767-3548-4ae7-a8b8-030008fe4738\",\"object\":\"chat.completion.chunk\",\"created\":1758112555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts7y0fswts6h6qj05a7m6\"}}\n\ndata: {\"id\":\"chatcmpl-c2885767-3548-4ae7-a8b8-030008fe4738\",\"object\":\"chat.completion.chunk\",\"created\":1758112555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"msaf9c1mm\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-c2885767-3548-4ae7-a8b8-030008fe4738\",\"object\":\"chat.completion.chunk\",\"created\":1758112555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts7y0fswts6h6qj05a7m6\",\"usage\":{\"queue_time\":0.087923681,\"prompt_tokens\":952,\"prompt_time\":0.07852597,\"completion_tokens\":52,\"completion_time\":0.106581181,\"total_tokens\":1004,\"total_time\":0.185107151}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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_89cf6c28cb2ec992330f7c1bdc342068.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_89cf6c28cb2ec992330f7c1bdc342068.json
new file mode 100644
index 0000000000..75fd29b377
--- /dev/null
+++ 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_89cf6c28cb2ec992330f7c1bdc342068.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-caf5af7e-3c15-4dac-bb3c-ef8753e3d55e\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk6fze06andww0kjfkhy4\"}}\n\ndata: {\"id\":\"chatcmpl-caf5af7e-3c15-4dac-bb3c-ef8753e3d55e\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"jtmhkcm8c\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-caf5af7e-3c15-4dac-bb3c-ef8753e3d55e\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk6fze06andww0kjfkhy4\",\"usage\":{\"queue_time\":0.169828534,\"prompt_tokens\":946,\"prompt_time\":0.077438792,\"completion_tokens\":51,\"completion_time\":0.110801372,\"total_tokens\":997,\"total_time\":0.188240164}},\"usage\":{\"queue_time\":0.169828534,\"prompt_tokens\":946,\"prompt_time\":0.077438792,\"completion_tokens\":51,\"completion_time\":0.110801372,\"total_tokens\":997,\"total_time\":0.188240164}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_a534dfa8d9008a473a02fcb64bd645c7.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_a534dfa8d9008a473a02fcb64bd645c7.json
deleted file mode 100644
index e1cece25c4..0000000000
--- 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_a534dfa8d9008a473a02fcb64bd645c7.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-cb60c97b-e1de-4aeb-a8d0-3234487fb7ac\",\"object\":\"chat.completion.chunk\",\"created\":1758112550,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts3jyeentda86a69tbemv\"}}\n\ndata: {\"id\":\"chatcmpl-cb60c97b-e1de-4aeb-a8d0-3234487fb7ac\",\"object\":\"chat.completion.chunk\",\"created\":1758112550,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"xkhx0v1vq\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, Welt!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-cb60c97b-e1de-4aeb-a8d0-3234487fb7ac\",\"object\":\"chat.completion.chunk\",\"created\":1758112550,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts3jyeentda86a69tbemv\",\"usage\":{\"queue_time\":0.083582984,\"prompt_tokens\":943,\"prompt_time\":0.094921281,\"completion_tokens\":33,\"completion_time\":0.082310853,\"total_tokens\":976,\"total_time\":0.177232134}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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_b300195a352d5bddf97a0136eeb314e6.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_b300195a352d5bddf97a0136eeb314e6.json
new file mode 100644
index 0000000000..7227624fd3
--- /dev/null
+++ 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_b300195a352d5bddf97a0136eeb314e6.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-8b44ecae-2ea2-4247-bec0-a796217286ce\",\"object\":\"chat.completion.chunk\",\"created\":1758783440,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk1mvfzz9wa75773temf3\"}}\n\ndata: {\"id\":\"chatcmpl-8b44ecae-2ea2-4247-bec0-a796217286ce\",\"object\":\"chat.completion.chunk\",\"created\":1758783440,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"w4nesfnw7\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, Welt!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-8b44ecae-2ea2-4247-bec0-a796217286ce\",\"object\":\"chat.completion.chunk\",\"created\":1758783440,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk1mvfzz9wa75773temf3\",\"usage\":{\"queue_time\":0.250621162,\"prompt_tokens\":937,\"prompt_time\":0.075776116,\"completion_tokens\":36,\"completion_time\":0.078861683,\"total_tokens\":973,\"total_time\":0.154637799}},\"usage\":{\"queue_time\":0.250621162,\"prompt_tokens\":937,\"prompt_time\":0.075776116,\"completion_tokens\":36,\"completion_time\":0.078861683,\"total_tokens\":973,\"total_time\":0.154637799}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_008db1a44c8ee4e4d98c2e62c05f1906.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_008db1a44c8ee4e4d98c2e62c05f1906.json
new file mode 100644
index 0000000000..19feca5c5a
--- /dev/null
+++ 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_008db1a44c8ee4e4d98c2e62c05f1906.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-d59addf6-6767-47ec-b11d-3c153c0f95e5\",\"object\":\"chat.completion.chunk\",\"created\":1758783444,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk4xhe08a90de0a5q7c0p\"}}\n\ndata: {\"id\":\"chatcmpl-d59addf6-6767-47ec-b11d-3c153c0f95e5\",\"object\":\"chat.completion.chunk\",\"created\":1758783444,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"7gkfmcyzf\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! How are you doing? \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d59addf6-6767-47ec-b11d-3c153c0f95e5\",\"object\":\"chat.completion.chunk\",\"created\":1758783444,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk4xhe08a90de0a5q7c0p\",\"usage\":{\"queue_time\":0.094632691,\"prompt_tokens\":939,\"prompt_time\":0.098137394,\"completion_tokens\":97,\"completion_time\":0.166019247,\"total_tokens\":1036,\"total_time\":0.264156641}},\"usage\":{\"queue_time\":0.094632691,\"prompt_tokens\":939,\"prompt_time\":0.098137394,\"completion_tokens\":97,\"completion_time\":0.166019247,\"total_tokens\":1036,\"total_time\":0.264156641}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_db0b2afe5c635db1fbd2fd9e5c66c2a6.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_db0b2afe5c635db1fbd2fd9e5c66c2a6.json
deleted file mode 100644
index e094f8e748..0000000000
--- 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_db0b2afe5c635db1fbd2fd9e5c66c2a6.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-09e0a7ad-41b7-4977-8151-503727b53faf\",\"object\":\"chat.completion.chunk\",\"created\":1758112553,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts663fstbh9a4e20770f8\"}}\n\ndata: {\"id\":\"chatcmpl-09e0a7ad-41b7-4977-8151-503727b53faf\",\"object\":\"chat.completion.chunk\",\"created\":1758112553,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"1mq7f22g9\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! How are you doing? \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-09e0a7ad-41b7-4977-8151-503727b53faf\",\"object\":\"chat.completion.chunk\",\"created\":1758112553,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts663fstbh9a4e20770f8\",\"usage\":{\"queue_time\":0.173206301,\"prompt_tokens\":945,\"prompt_time\":0.073079821,\"completion_tokens\":99,\"completion_time\":0.171283529,\"total_tokens\":1044,\"total_time\":0.24436335}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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_698e87bd13c88c31da2b4d97ed62aa8a.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_698e87bd13c88c31da2b4d97ed62aa8a.json
deleted file mode 100644
index 7c9e102f03..0000000000
--- 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_698e87bd13c88c31da2b4d97ed62aa8a.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-b103a0ca-e124-412c-a6a6-765dada2867e\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts6p3fm494z6krgkes82h\"}}\n\ndata: {\"id\":\"chatcmpl-b103a0ca-e124-412c-a6a6-765dada2867e\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"81ksqccr8\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-b103a0ca-e124-412c-a6a6-765dada2867e\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts6p3fm494z6krgkes82h\",\"usage\":{\"queue_time\":0.168064995,\"prompt_tokens\":961,\"prompt_time\":0.079313259,\"completion_tokens\":77,\"completion_time\":0.122062332,\"total_tokens\":1038,\"total_time\":0.201375591}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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_9a1800c42b72be41038a25622ff00709.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_9a1800c42b72be41038a25622ff00709.json
new file mode 100644
index 0000000000..6ecfa94975
--- /dev/null
+++ 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_9a1800c42b72be41038a25622ff00709.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-950a4d2c-85ec-4033-980b-4f45e6b7329b\",\"object\":\"chat.completion.chunk\",\"created\":1758783444,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk5ane08ba9d151jbrmg3\"}}\n\ndata: {\"id\":\"chatcmpl-950a4d2c-85ec-4033-980b-4f45e6b7329b\",\"object\":\"chat.completion.chunk\",\"created\":1758783444,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"02x22hctr\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-950a4d2c-85ec-4033-980b-4f45e6b7329b\",\"object\":\"chat.completion.chunk\",\"created\":1758783444,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk5ane08ba9d151jbrmg3\",\"usage\":{\"queue_time\":0.141083415,\"prompt_tokens\":955,\"prompt_time\":0.109837475,\"completion_tokens\":80,\"completion_time\":0.15087099,\"total_tokens\":1035,\"total_time\":0.260708465}},\"usage\":{\"queue_time\":0.141083415,\"prompt_tokens\":955,\"prompt_time\":0.109837475,\"completion_tokens\":80,\"completion_time\":0.15087099,\"total_tokens\":1035,\"total_time\":0.260708465}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_0463e82390d623aec168d4e483a8e7c1.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_0463e82390d623aec168d4e483a8e7c1.json
new file mode 100644
index 0000000000..66a55138ee
--- /dev/null
+++ 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_0463e82390d623aec168d4e483a8e7c1.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-74e63525-5e5c-4280-ba3c-fe2e27984426\",\"object\":\"chat.completion.chunk\",\"created\":1758783443,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk3y2e01963m228rp0156\"}}\n\ndata: {\"id\":\"chatcmpl-74e63525-5e5c-4280-ba3c-fe2e27984426\",\"object\":\"chat.completion.chunk\",\"created\":1758783443,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"b69014kwr\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, updated content\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-74e63525-5e5c-4280-ba3c-fe2e27984426\",\"object\":\"chat.completion.chunk\",\"created\":1758783443,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk3y2e01963m228rp0156\",\"usage\":{\"queue_time\":0.091541682,\"prompt_tokens\":945,\"prompt_time\":0.078752951,\"completion_tokens\":32,\"completion_time\":0.07319935,\"total_tokens\":977,\"total_time\":0.151952301}},\"usage\":{\"queue_time\":0.091541682,\"prompt_tokens\":945,\"prompt_time\":0.078752951,\"completion_tokens\":32,\"completion_time\":0.07319935,\"total_tokens\":977,\"total_time\":0.151952301}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_54e5c87345fd2adc7bc1aa015fb7ed49.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_54e5c87345fd2adc7bc1aa015fb7ed49.json
deleted file mode 100644
index 68113ca3a7..0000000000
--- 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_54e5c87345fd2adc7bc1aa015fb7ed49.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-efea034c-c756-4353-b725-0f48ba2e126a\",\"object\":\"chat.completion.chunk\",\"created\":1758112553,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts5vrfst8h602n8wn8rha\"}}\n\ndata: {\"id\":\"chatcmpl-efea034c-c756-4353-b725-0f48ba2e126a\",\"object\":\"chat.completion.chunk\",\"created\":1758112553,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"v3q0a7nxz\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, updated content\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-efea034c-c756-4353-b725-0f48ba2e126a\",\"object\":\"chat.completion.chunk\",\"created\":1758112553,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts5vrfst8h602n8wn8rha\",\"usage\":{\"queue_time\":0.083994451,\"prompt_tokens\":951,\"prompt_time\":0.085350612,\"completion_tokens\":33,\"completion_time\":0.063110548,\"total_tokens\":984,\"total_time\":0.14846116}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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_cf6b0ebb12aa86b848af40e9fa5aa4c6.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_cf6b0ebb12aa86b848af40e9fa5aa4c6.json
new file mode 100644
index 0000000000..8d924a685a
--- /dev/null
+++ 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_cf6b0ebb12aa86b848af40e9fa5aa4c6.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-b97cd156-2341-49b1-bd91-a48ae11e77aa\",\"object\":\"chat.completion.chunk\",\"created\":1758783555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztphvfe3ya7tax976zxv1a\"}}\n\ndata: {\"id\":\"chatcmpl-b97cd156-2341-49b1-bd91-a48ae11e77aa\",\"object\":\"chat.completion.chunk\",\"created\":1758783555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"yspgvwnek\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-b97cd156-2341-49b1-bd91-a48ae11e77aa\",\"object\":\"chat.completion.chunk\",\"created\":1758783555,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_487c5a8475\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztphvfe3ya7tax976zxv1a\",\"usage\":{\"queue_time\":0.13352253,\"prompt_tokens\":937,\"prompt_time\":0.080579121,\"completion_tokens\":106,\"completion_time\":0.184377315,\"total_tokens\":1043,\"total_time\":0.264956436}},\"usage\":{\"queue_time\":0.13352253,\"prompt_tokens\":937,\"prompt_time\":0.080579121,\"completion_tokens\":106,\"completion_time\":0.184377315,\"total_tokens\":1043,\"total_time\":0.264956436}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_fc03fd7d02657b4546b13e3e8a3a2bee.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_fc03fd7d02657b4546b13e3e8a3a2bee.json
deleted file mode 100644
index 196da262ec..0000000000
--- 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_fc03fd7d02657b4546b13e3e8a3a2bee.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-8dc48e1a-2708-4153-8373-3f333bf210c8\",\"object\":\"chat.completion.chunk\",\"created\":1758112556,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts8ateewv2956kdm9j0aa\"}}\n\ndata: {\"id\":\"chatcmpl-8dc48e1a-2708-4153-8373-3f333bf210c8\",\"object\":\"chat.completion.chunk\",\"created\":1758112556,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"edhdg14fc\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"Jane Doe\\\\\\\"\\\\u003e@Jane Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eHow are you doing?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eThis text is blue!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-8dc48e1a-2708-4153-8373-3f333bf210c8\",\"object\":\"chat.completion.chunk\",\"created\":1758112556,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts8ateewv2956kdm9j0aa\",\"usage\":{\"queue_time\":0.938343215,\"prompt_tokens\":943,\"prompt_time\":0.063132737,\"completion_tokens\":103,\"completion_time\":0.19462829,\"total_tokens\":1046,\"total_time\":0.257761027}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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_2b8a7aa1c2a0945eb657e1784120dabc.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_2b8a7aa1c2a0945eb657e1784120dabc.json
new file mode 100644
index 0000000000..d70c997e7d
--- /dev/null
+++ 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_2b8a7aa1c2a0945eb657e1784120dabc.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-d1905bd6-099e-424f-a871-b23f8a052ab0\",\"object\":\"chat.completion.chunk\",\"created\":1758783809,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5zty9dfehcs27pxj6bthe7d\"}}\n\ndata: {\"id\":\"chatcmpl-d1905bd6-099e-424f-a871-b23f8a052ab0\",\"object\":\"chat.completion.chunk\",\"created\":1758783809,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"pgnbjbgar\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eWie geht es dir?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eDieser Text ist blau!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d1905bd6-099e-424f-a871-b23f8a052ab0\",\"object\":\"chat.completion.chunk\",\"created\":1758783809,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5zty9dfehcs27pxj6bthe7d\",\"usage\":{\"queue_time\":0.144850274,\"prompt_tokens\":946,\"prompt_time\":0.077445191,\"completion_tokens\":105,\"completion_time\":0.204622915,\"total_tokens\":1051,\"total_time\":0.282068106}},\"usage\":{\"queue_time\":0.144850274,\"prompt_tokens\":946,\"prompt_time\":0.077445191,\"completion_tokens\":105,\"completion_time\":0.204622915,\"total_tokens\":1051,\"total_time\":0.282068106}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_ae27bd5c696279c7555747ebab7f882e.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_ae27bd5c696279c7555747ebab7f882e.json
deleted file mode 100644
index c50bbc5948..0000000000
--- 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_ae27bd5c696279c7555747ebab7f882e.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-50ef35e2-b327-42ee-bd7d-65a1413e0a70\",\"object\":\"chat.completion.chunk\",\"created\":1758114041,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bw6k3eftat11dw62ej1szj\"}}\n\ndata: {\"id\":\"chatcmpl-50ef35e2-b327-42ee-bd7d-65a1413e0a70\",\"object\":\"chat.completion.chunk\",\"created\":1758114041,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"9kesd5caq\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo, \\\\u003cspan data-inline-content-type=\\\\\\\"mention\\\\\\\" data-user=\\\\\\\"John Doe\\\\\\\"\\\\u003e@John Doe\\\\u003c/span\\\\u003e! \\\\u003cstrong\\\\u003eWie geht es dir?\\\\u003c/strong\\\\u003e \\\\u003cspan style=\\\\\\\"color: rgb(11, 110, 153);\\\\\\\" data-style-type=\\\\\\\"textColor\\\\\\\" data-value=\\\\\\\"blue\\\\\\\" data-editable=\\\\\\\"\\\\\\\"\\\\u003eDieser Text ist blau!\\\\u003c/span\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-50ef35e2-b327-42ee-bd7d-65a1413e0a70\",\"object\":\"chat.completion.chunk\",\"created\":1758114041,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bw6k3eftat11dw62ej1szj\",\"usage\":{\"queue_time\":0.086288085,\"prompt_tokens\":952,\"prompt_time\":0.078529108,\"completion_tokens\":106,\"completion_time\":0.220582491,\"total_tokens\":1058,\"total_time\":0.299111599}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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_7f14399291525650d7f05c5015dd3b59.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_7f14399291525650d7f05c5015dd3b59.json
new file mode 100644
index 0000000000..2a0fceb7b3
--- /dev/null
+++ 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_7f14399291525650d7f05c5015dd3b59.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-07b94377-0d5f-4a2d-9284-13b8ac6ef720\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk66ce05a1eg9e4cd1342\"}}\n\ndata: {\"id\":\"chatcmpl-07b94377-0d5f-4a2d-9284-13b8ac6ef720\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"v5ge2cf8c\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003e\\\\u003cstrong\\\\u003eHello, world!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-07b94377-0d5f-4a2d-9284-13b8ac6ef720\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk66ce05a1eg9e4cd1342\",\"usage\":{\"queue_time\":0.087740881,\"prompt_tokens\":935,\"prompt_time\":0.077809774,\"completion_tokens\":35,\"completion_time\":0.094247314,\"total_tokens\":970,\"total_time\":0.172057088}},\"usage\":{\"queue_time\":0.087740881,\"prompt_tokens\":935,\"prompt_time\":0.077809774,\"completion_tokens\":35,\"completion_time\":0.094247314,\"total_tokens\":970,\"total_time\":0.172057088}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_ad1bbdc50acb8c57cbcb55e00134b956.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_ad1bbdc50acb8c57cbcb55e00134b956.json
deleted file mode 100644
index 49b5955420..0000000000
--- 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_ad1bbdc50acb8c57cbcb55e00134b956.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-2ef0e216-508e-4491-9e5d-c934dc091731\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts7gxeesv2t1vpykap3mz\"}}\n\ndata: {\"id\":\"chatcmpl-2ef0e216-508e-4491-9e5d-c934dc091731\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"1zaggbzc3\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003e\\\\u003cstrong\\\\u003eHello, world!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-2ef0e216-508e-4491-9e5d-c934dc091731\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts7gxeesv2t1vpykap3mz\",\"usage\":{\"queue_time\":0.168522711,\"prompt_tokens\":941,\"prompt_time\":0.078302178,\"completion_tokens\":32,\"completion_time\":0.101855477,\"total_tokens\":973,\"total_time\":0.180157655}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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_710f89bc66a6352e1c21328e600f2536.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_710f89bc66a6352e1c21328e600f2536.json
new file mode 100644
index 0000000000..1deeb5a169
--- /dev/null
+++ 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_710f89bc66a6352e1c21328e600f2536.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-19888ada-667c-4190-84d2-1d585644157f\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk5rxey4tzk8qn3s929eq\"}}\n\ndata: {\"id\":\"chatcmpl-19888ada-667c-4190-84d2-1d585644157f\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"qw3tk1n43\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cstrong\\\\u003eworld!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-19888ada-667c-4190-84d2-1d585644157f\",\"object\":\"chat.completion.chunk\",\"created\":1758783445,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk5rxey4tzk8qn3s929eq\",\"usage\":{\"queue_time\":0.203406796,\"prompt_tokens\":942,\"prompt_time\":0.077748982,\"completion_tokens\":36,\"completion_time\":0.088546668,\"total_tokens\":978,\"total_time\":0.16629565}},\"usage\":{\"queue_time\":0.203406796,\"prompt_tokens\":942,\"prompt_time\":0.077748982,\"completion_tokens\":36,\"completion_time\":0.088546668,\"total_tokens\":978,\"total_time\":0.16629565}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_f65378b4068dbaa6e4b2f12247582a3d.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_f65378b4068dbaa6e4b2f12247582a3d.json
deleted file mode 100644
index fa47b296e6..0000000000
--- 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_f65378b4068dbaa6e4b2f12247582a3d.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-1ed2b729-89c3-41d1-af45-f32ca2f4c35d\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts74vfsvrwsv9w1chvsvy\"}}\n\ndata: {\"id\":\"chatcmpl-1ed2b729-89c3-41d1-af45-f32ca2f4c35d\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"s9fa8e59a\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHello, \\\\u003cstrong\\\\u003eworld!\\\\u003c/strong\\\\u003e\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-1ed2b729-89c3-41d1-af45-f32ca2f4c35d\",\"object\":\"chat.completion.chunk\",\"created\":1758112554,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_2ddfbb0da0\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts74vfsvrwsv9w1chvsvy\",\"usage\":{\"queue_time\":0.08485247,\"prompt_tokens\":948,\"prompt_time\":0.123735528,\"completion_tokens\":37,\"completion_time\":0.099621307,\"total_tokens\":985,\"total_time\":0.223356835}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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_a4057cb73ed9ba6b58bfc3440182ab52.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_a4057cb73ed9ba6b58bfc3440182ab52.json
deleted file mode 100644
index b48635176c..0000000000
--- 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_a4057cb73ed9ba6b58bfc3440182ab52.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List 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.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello
\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"Hello, world!
\\\"},{\\\"block\\\":\\\"Hello, @John Doe! How are you doing? This text is blue!
\\\"},{\\\"block\\\":\\\"Hello, world! Bold text. Link.
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-2c1a119d-b3fe-4455-8872-d3308a2f8816\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts3ymfsp800e0zax86yzz\"}}\n\ndata: {\"id\":\"chatcmpl-2c1a119d-b3fe-4455-8872-d3308a2f8816\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"km811vn9v\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-2c1a119d-b3fe-4455-8872-d3308a2f8816\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts3ymfsp800e0zax86yzz\",\"usage\":{\"queue_time\":0.087360349,\"prompt_tokens\":784,\"prompt_time\":0.072817523,\"completion_tokens\":31,\"completion_time\":0.069651957,\"total_tokens\":815,\"total_time\":0.14246948}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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_d2ee0ac3b245b97f7a730d85a4575ac3.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_d2ee0ac3b245b97f7a730d85a4575ac3.json
new file mode 100644
index 0000000000..03aa16fe8a
--- /dev/null
+++ 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_d2ee0ac3b245b97f7a730d85a4575ac3.json
@@ -0,0 +1,15 @@
+{
+ "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 selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List 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.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello
\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-4aa29eb8-1efc-432e-bdf2-e6e12e3c3cfa\",\"object\":\"chat.completion.chunk\",\"created\":1758783441,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk233fzztw9yhzpp1g1rp\"}}\n\ndata: {\"id\":\"chatcmpl-4aa29eb8-1efc-432e-bdf2-e6e12e3c3cfa\",\"object\":\"chat.completion.chunk\",\"created\":1758783441,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"43teqva05\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp\\\\u003eHallo\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-4aa29eb8-1efc-432e-bdf2-e6e12e3c3cfa\",\"object\":\"chat.completion.chunk\",\"created\":1758783441,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4ea8b86ba0\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk233fzztw9yhzpp1g1rp\",\"usage\":{\"queue_time\":0.202438742,\"prompt_tokens\":767,\"prompt_time\":0.061756423,\"completion_tokens\":34,\"completion_time\":0.071081873,\"total_tokens\":801,\"total_time\":0.132838296}},\"usage\":{\"queue_time\":0.202438742,\"prompt_tokens\":767,\"prompt_time\":0.061756423,\"completion_tokens\":34,\"completion_time\":0.071081873,\"total_tokens\":801,\"total_time\":0.132838296}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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)/turn paragraphs into list_1_d193ecd4799fc5ca01c16b383bbfae8e.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)/turn paragraphs into list_1_d193ecd4799fc5ca01c16b383bbfae8e.json
deleted file mode 100644
index eefd784fcc..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_d193ecd4799fc5ca01c16b383bbfae8e.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List 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.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Bananas
\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"block\\\":\\\"Apples
\\\"},{\\\"block\\\":\\\"Bananas
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-fc024356-0b33-4398-b6ce-70ae2eace374\",\"object\":\"chat.completion.chunk\",\"created\":1758112557,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5btsaazfsytkzwvaz47dbbc\"}}\n\ndata: {\"id\":\"chatcmpl-fc024356-0b33-4398-b6ce-70ae2eace374\",\"object\":\"chat.completion.chunk\",\"created\":1758112557,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"kccg1rtaf\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-fc024356-0b33-4398-b6ce-70ae2eace374\",\"object\":\"chat.completion.chunk\",\"created\":1758112557,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_4d4005649c\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5btsaazfsytkzwvaz47dbbc\",\"usage\":{\"queue_time\":0.168307849,\"prompt_tokens\":704,\"prompt_time\":0.059492566,\"completion_tokens\":65,\"completion_time\":0.124675851,\"total_tokens\":769,\"total_time\":0.184168417}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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)/turn paragraphs into list_1_d2eeb79d3f7120d2c9d698e3b82c7362.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)/turn paragraphs into list_1_d2eeb79d3f7120d2c9d698e3b82c7362.json
new file mode 100644
index 0000000000..1447528156
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/turn paragraphs into list_1_d2eeb79d3f7120d2c9d698e3b82c7362.json
@@ -0,0 +1,15 @@
+{
+ "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 selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List 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.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Bananas
\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"block\\\":\\\"Apples
\\\"},{\\\"block\\\":\\\"Bananas
\\\"}]\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-dbce3a44-9172-4c20-b800-1b62ad89d217\",\"object\":\"chat.completion.chunk\",\"created\":1758783447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk84xe09sgh5p9m6kz2em\"}}\n\ndata: {\"id\":\"chatcmpl-dbce3a44-9172-4c20-b800-1b62ad89d217\",\"object\":\"chat.completion.chunk\",\"created\":1758783447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"h8cg4zpwp\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eApples\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref2$\\\",\\\"type\\\":\\\"update\\\"},{\\\"block\\\":\\\"\\\\u003cul\\\\u003e\\\\u003cli\\\\u003eBananas\\\\u003c/li\\\\u003e\\\\u003c/ul\\\\u003e\\\",\\\"id\\\":\\\"ref3$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-dbce3a44-9172-4c20-b800-1b62ad89d217\",\"object\":\"chat.completion.chunk\",\"created\":1758783447,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_155ab82e98\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk84xe09sgh5p9m6kz2em\",\"usage\":{\"queue_time\":0.537078687,\"prompt_tokens\":687,\"prompt_time\":0.052994038,\"completion_tokens\":68,\"completion_time\":0.124627288,\"total_tokens\":755,\"total_time\":0.177621326}},\"usage\":{\"queue_time\":0.537078687,\"prompt_tokens\":687,\"prompt_time\":0.052994038,\"completion_tokens\":68,\"completion_time\":0.124627288,\"total_tokens\":755,\"total_time\":0.177621326}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_cd366ecb6835f6ad416e56246d772258.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_cd366ecb6835f6ad416e56246d772258.json
deleted file mode 100644
index ef4715520f..0000000000
--- 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_cd366ecb6835f6ad416e56246d772258.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-990c46ae-e243-4030-b89e-cef2527336b9\",\"object\":\"chat.completion.chunk\",\"created\":1758112552,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts5e2fsrt8h67zd36rpxp\"}}\n\ndata: {\"id\":\"chatcmpl-990c46ae-e243-4030-b89e-cef2527336b9\",\"object\":\"chat.completion.chunk\",\"created\":1758112552,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"z0pge0x85\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\\\u003eWhat's up, world!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-990c46ae-e243-4030-b89e-cef2527336b9\",\"object\":\"chat.completion.chunk\",\"created\":1758112552,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts5e2fsrt8h67zd36rpxp\",\"usage\":{\"queue_time\":0.087500214,\"prompt_tokens\":955,\"prompt_time\":0.078356795,\"completion_tokens\":37,\"completion_time\":0.097712926,\"total_tokens\":992,\"total_time\":0.176069721}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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_e22ef915ccf69ed6d2eb9f1a04b86c20.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_e22ef915ccf69ed6d2eb9f1a04b86c20.json
new file mode 100644
index 0000000000..d548f0561e
--- /dev/null
+++ 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_e22ef915ccf69ed6d2eb9f1a04b86c20.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-fbe1b604-eb05-4a84-aa98-58d121ce74ac\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk3mmey4aya79sfng8ha3\"}}\n\ndata: {\"id\":\"chatcmpl-fbe1b604-eb05-4a84-aa98-58d121ce74ac\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"ecnrb52mg\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\\\u003eWhat's up, world!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-fbe1b604-eb05-4a84-aa98-58d121ce74ac\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_9e1e8f8435\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk3mmey4aya79sfng8ha3\",\"usage\":{\"queue_time\":0.087015992,\"prompt_tokens\":949,\"prompt_time\":0.078642555,\"completion_tokens\":44,\"completion_time\":0.077594348,\"total_tokens\":993,\"total_time\":0.156236903}},\"usage\":{\"queue_time\":0.087015992,\"prompt_tokens\":949,\"prompt_time\":0.078642555,\"completion_tokens\":44,\"completion_time\":0.077594348,\"total_tokens\":993,\"total_time\":0.156236903}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_6d4c550d09a7bfdb440308f277b85a11.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_6d4c550d09a7bfdb440308f277b85a11.json
new file mode 100644
index 0000000000..d7992d5388
--- /dev/null
+++ 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_6d4c550d09a7bfdb440308f277b85a11.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-d843fb16-a68e-49a6-88ae-4aced1a5e66b\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk2x4e07r3enkvn246nd8\"}}\n\ndata: {\"id\":\"chatcmpl-d843fb16-a68e-49a6-88ae-4aced1a5e66b\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"c800nyyst\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\\\u003eHello, world!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-d843fb16-a68e-49a6-88ae-4aced1a5e66b\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk2x4e07r3enkvn246nd8\",\"usage\":{\"queue_time\":0.143502652,\"prompt_tokens\":937,\"prompt_time\":0.077230823,\"completion_tokens\":38,\"completion_time\":0.091863369,\"total_tokens\":975,\"total_time\":0.169094192}},\"usage\":{\"queue_time\":0.143502652,\"prompt_tokens\":937,\"prompt_time\":0.077230823,\"completion_tokens\":38,\"completion_time\":0.091863369,\"total_tokens\":975,\"total_time\":0.169094192}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_dcd828e95a6f35a02dc80f83ce865246.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_dcd828e95a6f35a02dc80f83ce865246.json
deleted file mode 100644
index adcc4e4911..0000000000
--- 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_dcd828e95a6f35a02dc80f83ce865246.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-f409edff-c4a7-4c8e-866b-6c0a705c784f\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts4mzfspsqm4xwzd91wf1\"}}\n\ndata: {\"id\":\"chatcmpl-f409edff-c4a7-4c8e-866b-6c0a705c784f\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"apredbe8r\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003cp style=\\\\\\\"text-align: right;\\\\\\\"\\\\u003eHello, world!\\\\u003c/p\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-f409edff-c4a7-4c8e-866b-6c0a705c784f\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts4mzfspsqm4xwzd91wf1\",\"usage\":{\"queue_time\":0.088002713,\"prompt_tokens\":943,\"prompt_time\":0.078793395,\"completion_tokens\":40,\"completion_time\":0.097069721,\"total_tokens\":983,\"total_time\":0.175863116}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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_2448cba67be91338d1977d4a980761a6.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_2448cba67be91338d1977d4a980761a6.json
new file mode 100644
index 0000000000..baa451a00f
--- /dev/null
+++ 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_2448cba67be91338d1977d4a980761a6.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-e78c4907-7578-4da5-ba2f-155401c2ff56\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk38ke009j9wnaeejb24r\"}}\n\ndata: {\"id\":\"chatcmpl-e78c4907-7578-4da5-ba2f-155401c2ff56\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"bcwjg029p\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eWhat's up, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-e78c4907-7578-4da5-ba2f-155401c2ff56\",\"object\":\"chat.completion.chunk\",\"created\":1758783442,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_a2c262bc3a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk38ke009j9wnaeejb24r\",\"usage\":{\"queue_time\":0.168121985,\"prompt_tokens\":949,\"prompt_time\":0.078238666,\"completion_tokens\":36,\"completion_time\":0.087214503,\"total_tokens\":985,\"total_time\":0.165453169}},\"usage\":{\"queue_time\":0.168121985,\"prompt_tokens\":949,\"prompt_time\":0.078238666,\"completion_tokens\":36,\"completion_time\":0.087214503,\"total_tokens\":985,\"total_time\":0.165453169}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_b409676f3c38fab14dbfcf469c084b61.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_b409676f3c38fab14dbfcf469c084b61.json
deleted file mode 100644
index c7c8119abd..0000000000
--- 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_b409676f3c38fab14dbfcf469c084b61.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-e808edcd-ec44-4ed2-871e-9e18f7d1b165\",\"object\":\"chat.completion.chunk\",\"created\":1758112552,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_64ddb0c78a\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts4zzfsqrfp0fyy163dt9\"}}\n\ndata: {\"id\":\"chatcmpl-e808edcd-ec44-4ed2-871e-9e18f7d1b165\",\"object\":\"chat.completion.chunk\",\"created\":1758112552,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_64ddb0c78a\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"b24egqjg9\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eWhat's up, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-e808edcd-ec44-4ed2-871e-9e18f7d1b165\",\"object\":\"chat.completion.chunk\",\"created\":1758112552,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_64ddb0c78a\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts4zzfsqrfp0fyy163dt9\",\"usage\":{\"queue_time\":0.1979395,\"prompt_tokens\":955,\"prompt_time\":0.07950067,\"completion_tokens\":33,\"completion_time\":0.095139914,\"total_tokens\":988,\"total_time\":0.174640584}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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_8035279de2d825570eb857243ac085d3.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_8035279de2d825570eb857243ac085d3.json
deleted file mode 100644
index 21daa4e556..0000000000
--- 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_8035279de2d825570eb857243ac085d3.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=groq&url=https%3A%2F%2Fapi.groq.com%2Fopenai%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"llama-3.3-70b-versatile\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-ffd7aadf-58ae-4926-9586-02d1979bd5ad\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5bts48meenr0hj6z714yhxx\"}}\n\ndata: {\"id\":\"chatcmpl-ffd7aadf-58ae-4926-9586-02d1979bd5ad\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"he64mpmrs\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eHello, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-ffd7aadf-58ae-4926-9586-02d1979bd5ad\",\"object\":\"chat.completion.chunk\",\"created\":1758112551,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_3f3b593e33\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5bts48meenr0hj6z714yhxx\",\"usage\":{\"queue_time\":0.08358156,\"prompt_tokens\":943,\"prompt_time\":0.076520558,\"completion_tokens\":34,\"completion_time\":0.094223127,\"total_tokens\":977,\"total_time\":0.170743685}}}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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_88fade9a250bf912d8d65f9db17e6de7.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_88fade9a250bf912d8d65f9db17e6de7.json
new file mode 100644
index 0000000000..d2ed7c7142
--- /dev/null
+++ 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_88fade9a250bf912d8d65f9db17e6de7.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "data: {\"id\":\"chatcmpl-c23e1112-59d0-48cf-859e-d6ccdf15253e\",\"object\":\"chat.completion.chunk\",\"created\":1758783441,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null},\"logprobs\":null,\"finish_reason\":null}],\"x_groq\":{\"id\":\"req_01k5ztk2h9fzzvs2pcmwaftr36\"}}\n\ndata: {\"id\":\"chatcmpl-c23e1112-59d0-48cf-859e-d6ccdf15253e\",\"object\":\"chat.completion.chunk\",\"created\":1758783441,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"id\":\"07r9p88c7\",\"type\":\"function\",\"function\":{\"name\":\"applyDocumentOperations\",\"arguments\":\"{\\\"operations\\\":[{\\\"block\\\":\\\"\\\\u003ch1\\\\u003eHello, world!\\\\u003c/h1\\\\u003e\\\",\\\"id\\\":\\\"ref1$\\\",\\\"type\\\":\\\"update\\\"}]}\"},\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-c23e1112-59d0-48cf-859e-d6ccdf15253e\",\"object\":\"chat.completion.chunk\",\"created\":1758783441,\"model\":\"llama-3.3-70b-versatile\",\"system_fingerprint\":\"fp_ede95a097b\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"x_groq\":{\"id\":\"req_01k5ztk2h9fzzvs2pcmwaftr36\",\"usage\":{\"queue_time\":0.143721537,\"prompt_tokens\":937,\"prompt_time\":0.076420397,\"completion_tokens\":33,\"completion_time\":0.08854522,\"total_tokens\":970,\"total_time\":0.164965617}},\"usage\":{\"queue_time\":0.143721537,\"prompt_tokens\":937,\"prompt_time\":0.076420397,\"completion_tokens\":33,\"completion_time\":0.08854522,\"total_tokens\":970,\"total_time\":0.164965617}}\n\ndata: [DONE]\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/clear block formatting_1_4220ed611dd1396b8eaefaef1a93aa3d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/clear block formatting_1_4220ed611dd1396b8eaefaef1a93aa3d.json
deleted file mode 100644
index f9ca1fd98d..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/clear block formatting_1_4220ed611dd1396b8eaefaef1a93aa3d.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Colored text
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Aligned text
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"clear the formatting (colors and alignment)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlpwx2RQ0LVAK1I6w2BRQFtYruln\",\n \"object\": \"chat.completion\",\n \"created\": 1758113168,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_gZIhS8D8Z9JAF2SVhjNWIPqU\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Colored text
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Aligned text
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 584,\n \"completion_tokens\": 47,\n \"total_tokens\": 631,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_5752bbf6a6ab425496886ae0c16fa252.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_5752bbf6a6ab425496886ae0c16fa252.json
deleted file mode 100644
index 9b2ba008b8..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link and change text within mark_1_5752bbf6a6ab425496886ae0c16fa252.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlpAWlte92kIl2f9A9kHnqu8XES3\",\n \"object\": \"chat.completion\",\n \"created\": 1758113120,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_imzrtOZGFz1s9omW7bcoollU\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hi, world! Bold the text. Link.
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 686,\n \"completion_tokens\": 33,\n \"total_tokens\": 719,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_fc4c8d212e083aeb086ecc97f89172cc.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_fc4c8d212e083aeb086ecc97f89172cc.json
deleted file mode 100644
index 9914fcb869..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/drop mark and link_1_fc4c8d212e083aeb086ecc97f89172cc.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlp9sr1rYwNMrP31lNFvsosQ4zn6\",\n \"object\": \"chat.completion\",\n \"created\": 1758113119,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_X0ZESjpEJKJRLw5J8XgcaKGk\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! Bold text. Link.
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 680,\n \"completion_tokens\": 31,\n \"total_tokens\": 711,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_07027383a583a8622324d5fb3c6b47ef.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_07027383a583a8622324d5fb3c6b47ef.json
deleted file mode 100644
index 215be34aa9..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify nested content_1_07027383a583a8622324d5fb3c6b47ef.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlpCeDVJUIa1bDGDght8EBqhtFPC\",\n \"object\": \"chat.completion\",\n \"created\": 1758113122,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_TTpNdDV9nw1q0GUFsWNvoh9l\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"APPLES
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 545,\n \"completion_tokens\": 26,\n \"total_tokens\": 571,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_432effc8a8203853eed4a05822cfb1c0.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_432effc8a8203853eed4a05822cfb1c0.json
deleted file mode 100644
index cf0cb2c1e0..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/modify parent content_1_432effc8a8203853eed4a05822cfb1c0.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlpDiPG7cgNzUsEeviZVJiWfXILR\",\n \"object\": \"chat.completion\",\n \"created\": 1758113123,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_xRcwymC75xVJFeUbIKt5gNwr\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I NEED TO BUY:
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 547,\n \"completion_tokens\": 27,\n \"total_tokens\": 574,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_a5a6fbbb73ac75d5318976205c211175.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_a5a6fbbb73ac75d5318976205c211175.json
deleted file mode 100644
index b68d995d68..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/plain source block, add mention_1_a5a6fbbb73ac75d5318976205c211175.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlp5apxCCSU4sFtS6yQmbfhgB4cS\",\n \"object\": \"chat.completion\",\n \"created\": 1758113115,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_ODa5TdGkQAlxyYMNMeM6coTC\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, @Jane Doe!
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 678,\n \"completion_tokens\": 46,\n \"total_tokens\": 724,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_55ce5796bcf58df91ac364bf5da3c062.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_55ce5796bcf58df91ac364bf5da3c062.json
deleted file mode 100644
index 3c255fc164..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/standard update_1_55ce5796bcf58df91ac364bf5da3c062.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlpsPfSrQUOKpv9mBoFHN2tItfe5\",\n \"object\": \"chat.completion\",\n \"created\": 1758113164,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_949cpRoT42WwPHtFvtX1FvVU\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hallo, Welt!
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 669,\n \"completion_tokens\": 27,\n \"total_tokens\": 696,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_fd35ea1690888e3b9fdd6cd7e3cdf21d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_fd35ea1690888e3b9fdd6cd7e3cdf21d.json
deleted file mode 100644
index d8f064bcd3..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mark_1_fd35ea1690888e3b9fdd6cd7e3cdf21d.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlp064VAVhIK0UMTwVhyGvvXSXsT\",\n \"object\": \"chat.completion\",\n \"created\": 1758113110,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_LQq5m49qgLR665YfthaspG7j\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How are you doing? This text is blue!
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 671,\n \"completion_tokens\": 92,\n \"total_tokens\": 763,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_f08ba8bc1f3562acc7d724c17d5f78c5.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_f08ba8bc1f3562acc7d724c17d5f78c5.json
deleted file mode 100644
index 9f0f02fe52..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, remove mention_1_f08ba8bc1f3562acc7d724c17d5f78c5.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlp1NdCoLR5HgEMRJbyFernIXUKA\",\n \"object\": \"chat.completion\",\n \"created\": 1758113111,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_d7hZ0WdZ8axSKBUEhxfsepVs\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello! How are you doing? This text is blue!
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 687,\n \"completion_tokens\": 75,\n \"total_tokens\": 762,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_90cbcfafa2e6f6897e82793db3d31620.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_90cbcfafa2e6f6897e82793db3d31620.json
deleted file mode 100644
index c28db2a8c1..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, replace content_1_90cbcfafa2e6f6897e82793db3d31620.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGloxZe4V8SlYBvP21NT98YT2PPtR\",\n \"object\": \"chat.completion\",\n \"created\": 1758113107,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_r9lIIgu3ZUqDm65d12hoyaLv\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, updated content
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 677,\n \"completion_tokens\": 27,\n \"total_tokens\": 704,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_1f44d9313ad815027c9c904006e12c1f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_1f44d9313ad815027c9c904006e12c1f.json
deleted file mode 100644
index 756d2d2ab2..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update mention prop_1_1f44d9313ad815027c9c904006e12c1f.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlpvneyvt2nNfiKmKhbNcNYrETJV\",\n \"object\": \"chat.completion\",\n \"created\": 1758113167,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_oytgZ8tpjilbUS53oydQUNNx\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @Jane Doe! How are you doing? This text is blue!
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 669,\n \"completion_tokens\": 97,\n \"total_tokens\": 766,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_412767e25cd81b316089d06262ab5f8f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_412767e25cd81b316089d06262ab5f8f.json
deleted file mode 100644
index 83ec928424..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in source block, update text_1_412767e25cd81b316089d06262ab5f8f.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGm0Rr5P6XVqBQgrHxKBUlndWbXYo\",\n \"object\": \"chat.completion\",\n \"created\": 1758113819,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_47oMXXPcHa4J262YeEJoHFeq\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 678,\n \"completion_tokens\": 98,\n \"total_tokens\": 776,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_357e3e9924f91ecb50a561b8373474f2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_357e3e9924f91ecb50a561b8373474f2.json
deleted file mode 100644
index 710ce9c96d..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (paragraph)_1_357e3e9924f91ecb50a561b8373474f2.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlp4Hm12y4LWW5x0vhf7XgQr9MFa\",\n \"object\": \"chat.completion\",\n \"created\": 1758113114,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_I8LJcWHLwAdkH5ts8H4mrMyr\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 667,\n \"completion_tokens\": 30,\n \"total_tokens\": 697,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_0912f446c3f834669ba44c0666b7ad8a.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_0912f446c3f834669ba44c0666b7ad8a.json
deleted file mode 100644
index d63d0724df..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/styles + ic in target block, add mark (word)_1_0912f446c3f834669ba44c0666b7ad8a.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlp29nRyQEHZGA3WR9NfABKWfllN\",\n \"object\": \"chat.completion\",\n \"created\": 1758113112,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_wsI1NmXq13qLvBAsxszPmpAJ\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 674,\n \"completion_tokens\": 31,\n \"total_tokens\": 705,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_169e840a93c457a3980841bce584f8b4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_169e840a93c457a3980841bce584f8b4.json
deleted file mode 100644
index 90865991ce..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/translate selection_1_169e840a93c457a3980841bce584f8b4.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List 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.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello
\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"Hello, world!
\\\"},{\\\"block\\\":\\\"Hello, @John Doe! How are you doing? This text is blue!
\\\"},{\\\"block\\\":\\\"Hello, world! Bold text. Link.
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlptLXZLEsTWi68AQdGKoO3BzJH9\",\n \"object\": \"chat.completion\",\n \"created\": 1758113165,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_ZpR6nsavPQ6W5cUTsVYD5OJh\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hallo
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 514,\n \"completion_tokens\": 25,\n \"total_tokens\": 539,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_46c8a46a056cc6f89953c4402d583718.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_46c8a46a056cc6f89953c4402d583718.json
deleted file mode 100644
index 9c4761232a..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/turn paragraphs into list_1_46c8a46a056cc6f89953c4402d583718.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List 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.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Bananas
\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"block\\\":\\\"Apples
\\\"},{\\\"block\\\":\\\"Bananas
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlpBBhI3mzUh4z8vXqb1WVldjvqU\",\n \"object\": \"chat.completion\",\n \"created\": 1758113121,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_Ops37rMBRkXFboUPDCyqxeIf\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"- Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"- Bananas
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 434,\n \"completion_tokens\": 55,\n \"total_tokens\": 489,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_3121104fb353eb2bca2395575f057107.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_3121104fb353eb2bca2395575f057107.json
deleted file mode 100644
index 8d0fa754cf..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop and content_1_3121104fb353eb2bca2395575f057107.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlowWqmaxfWdrTIVuBTcRXqK4235\",\n \"object\": \"chat.completion\",\n \"created\": 1758113106,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_ndvyBVPg1bKsLdOjF81G4XRU\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 680,\n \"completion_tokens\": 35,\n \"total_tokens\": 715,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_fe9102e572088ab37c69a84ef83a452c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_fe9102e572088ab37c69a84ef83a452c.json
deleted file mode 100644
index 3c899abafd..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block prop_1_fe9102e572088ab37c69a84ef83a452c.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlouS0HncqihX8gYRpr7G6nfphBB\",\n \"object\": \"chat.completion\",\n \"created\": 1758113104,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_1JzXjttmViSXqo0opDWlbZu0\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 669,\n \"completion_tokens\": 34,\n \"total_tokens\": 703,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_62527380200c30745a8e04e2aa459e3d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_62527380200c30745a8e04e2aa459e3d.json
deleted file mode 100644
index fdce9246c5..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type and content_1_62527380200c30745a8e04e2aa459e3d.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlovYQSBXxrxIbFpVLYLoEShaqJF\",\n \"object\": \"chat.completion\",\n \"created\": 1758113105,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_THaTB7qDviTchtsK9bdjkVqV\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 680,\n \"completion_tokens\": 30,\n \"total_tokens\": 710,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_3236a5c1b691839e51b0cd3787a7947f.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_3236a5c1b691839e51b0cd3787a7947f.json
deleted file mode 100644
index 8a745fe0ba..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (non-streaming)/update block type_1_3236a5c1b691839e51b0cd3787a7947f.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}]}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "{\n \"id\": \"chatcmpl-CGlouLC2ZRPTkKS4CDb1aWBs7gFIt\",\n \"object\": \"chat.completion\",\n \"created\": 1758113104,\n \"model\": \"gpt-4o-2024-08-06\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_xgH45zkO5MJPPu4jHoui7W2V\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"json\",\n \"arguments\": \"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"\n }\n }\n ],\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 669,\n \"completion_tokens\": 28,\n \"total_tokens\": 697,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\": \"default\",\n \"system_fingerprint\": \"fp_cbf1785567\"\n}\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_43253dee16b03b1f16101ced5bddfc93.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_43253dee16b03b1f16101ced5bddfc93.json
deleted file mode 100644
index e677d8ea44..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_43253dee16b03b1f16101ced5bddfc93.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Colored text
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Aligned text
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"clear the formatting (colors and alignment)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_Zz3IN1l5ZvHuVQk3yXE7jDj0\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"T7dWysYKBYumw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CIfVg81j0\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"t8FihHDW0E7EElr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"OTuoizctw0PqLSw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"kUlZVQb3mBHAvJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DK708aGh0pSh4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rDR0astx2Df8hj\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DG1sM7SXoKMZGK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"w6lTeyMvshgbmy\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8gEUMY41ft6krO\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"L4fFI7VW2bBuKO\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"HK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5j\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ck\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Colored\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NztaqClnckJJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Mf8Dx4vGPcB22V\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"r\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Fr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1n4v4HlXSSchQj\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"K3mB6lQs1dzuD7g\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ecYXNLuzRjOmks\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yB6DI2bRDP4hf\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aDN5DzfFqop67i\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"e\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5BTHwCX0qZP7Bv\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"kc\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Tm\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bShw32Uv7mFbOT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"E9Bb68fpeXRGoB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"sEIgK1HMwOPvtZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"eu\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"um\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"QH\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Aligned\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yChYufzGWpa1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"mlC0YqoKeS57NB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"r\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3L\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8Y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"b\"}\n\ndata: {\"id\":\"chatcmpl-CGlqZu7cyIMKC2Y7s4mjqVJVfVjKh\",\"object\":\"chat.completion.chunk\",\"created\":1758113207,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"IHM4AhM\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_92fde43139365369266b63a2b6e2d0b2.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_92fde43139365369266b63a2b6e2d0b2.json
deleted file mode 100644
index f2e0359132..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_92fde43139365369266b63a2b6e2d0b2.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change the last paragraph to 'Hi, world! Bold the text. Link.' without any markup like bold or link\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_FibEp39c2dwlK9lBWHjMdw17\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"K3vjJkyQaNFQz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hct1aWjMs\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"asjcTyMy4DV9hAm\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"IWW2lMisLZL6wtZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lmZLPg5IrgPMyT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"OgcjwYHwAY4BZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0sqGWQrclJrjeT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lrHaw4WQ234l5R\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"WB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"mD\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ns09Sp99DNua0q\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lfYIrTgh2MSN6b\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z7FFe0VQcrIec6\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"y9\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3r\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JG\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hi\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4D0rKtnexNNQ9\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Zd\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0zwwXGXbomS3Sq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" the\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6C26mFzEl2yZTmq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ty1KLoG14soPMX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Dp\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"BaXh4nXw3zMaNT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"RC\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"BE\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"x\"}\n\ndata: {\"id\":\"chatcmpl-CGlqLChf5Y0rhngnc75yFIegmXynG\",\"object\":\"chat.completion.chunk\",\"created\":1758113193,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"eYbWWjF\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_8336a355b6037db27d810a3f3a2fdb9c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_8336a355b6037db27d810a3f3a2fdb9c.json
deleted file mode 100644
index 1b453d0937..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_8336a355b6037db27d810a3f3a2fdb9c.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_Co6wHgEr9Xaf8UQu8OMXeHs0\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"doHRduwyR8h1G\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"eg6dGMMg7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qfzXrf5FHbqMeB3\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UE4YMhcgI75gwdy\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TSD0TsV6gAdmHU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ctp74X73DfkbS\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vd9G5tHdsVvGWF\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"O\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"iND7tqRRtr0uQ4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"cC\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Wo\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xn2Tqa7e5gdXV5\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"sAgomUBAqBa0bJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"S0KMYyrbQ1BES4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4u\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rn\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ndsnCNlOhdy6h\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lC\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"9KvFo2KR6Bma7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ww\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Bold\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"OeYHQZZODm1thx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Wr816bxgxApNuW\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Io\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Link\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"42GNNPSnYRqMgm\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\".\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"AX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"tq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqKVsiL19D4gCBWGD3MhALfNyON\",\"object\":\"chat.completion.chunk\",\"created\":1758113192,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"oOm2aoA\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_0e25723621acc3c5e0fa98bbbc1b8426.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_0e25723621acc3c5e0fa98bbbc1b8426.json
deleted file mode 100644
index 4339b38e30..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify nested content_1_0e25723621acc3c5e0fa98bbbc1b8426.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make apples uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_wJ0Hba3RSejz2uGSi9c8vhE7\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CCQ18Z9uHI89O\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"PAHni5CBt\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gg8v0M4Dm5nmjmF\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"PUElsIGfVoJl8JU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"9ty19RLdRgo5mw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"tAA2RJSGcHMML\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ImtzTAVezBolLQ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"s\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"I4KpV9EhjGBli2\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Aw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ya\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3sK9254ypyUazN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UTps6pjzxjI8v1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xh3uL4ZQZ5QTXd\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5K\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"el\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lk\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"APP\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"LES\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"v\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qo\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"A7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"p\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNeSimzf1sh6ArCT5PnqRs4IcV\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"jR5Sc6d\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_329ea2aac9bc7887fb77b9165483286c.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_329ea2aac9bc7887fb77b9165483286c.json
deleted file mode 100644
index a3b2764132..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/modify parent content_1_329ea2aac9bc7887fb77b9165483286c.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph uppercase\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_aEHHHFgRQIveyPH0BPZc68nA\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zipP0HNuqDJ8k\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"fqvQbegTc\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"B5PI41PRvsaLjJ1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2YCYMbfv7EybSmU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3wqJPa3MQspdVH\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"WH0fdAcrlzK8m\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"veKzS4x3pnspZN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"x\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YDINyWzdCTXqvK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6U\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"smfW93NpZstGZO\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NDAdEaKVGzvtWY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CTBzYfxsJHQG8T\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"cX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"EI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">I\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" NEED\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ChS7YmO1aDcZ4U\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" TO\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" BUY\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XglauzKFhVgh8ld\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"td\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4Z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqNmeCK9Xr87BDgxGrhUTnAb86U\",\"object\":\"chat.completion.chunk\",\"created\":1758113195,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"hhBYNTx\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_fb00f31bc9fd64a65ead6c56df2a6f46.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_fb00f31bc9fd64a65ead6c56df2a6f46.json
deleted file mode 100644
index 7e0c991940..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_fb00f31bc9fd64a65ead6c56df2a6f46.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_wwFTcxLzWQnCoL1QCFGPesPZ\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"f3VwKvaieKZAK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UI8qBj5GA\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TzxP7kk2GkSmHmt\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YxOKHLp8jn9VQ2k\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"G8WAFmPF35ydze\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"mJNDFOlb2cmFk\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lK7zpAJm7SkNm4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5wGWzDf89ILlKF\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"fn\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8MC8V4VGE31vbL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zZn7kD20yXnlog\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JQPiJorZ78lQJY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Tg\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"e09i6JxfHTbII\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dt\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"R\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rXKZsRHvns1R497\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ZPtwlCufftS7yL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jVBHsfABq4mD\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"GgtbMKvKm1X\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zXDYzS8RDoU4cR\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hG1QPmdX1RYpUI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"58wd6hSxhbpo\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DV5mlu19XQtEQ6b\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"D0GLcbolpaqph3\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"EnuF7vqCvspMLX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"49LJs7kjpUNOMX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Tc2qUhQmRG4xg8Z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gcS5Lio65QTYQzK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"n9ssJRnXLQNFEa\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"VG\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zSFCJOQ4SFiO2IE\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"AflwXpbkRps6scZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"q\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"GbORfMBWoGPevgY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"GR\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6l\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"X\"}\n\ndata: {\"id\":\"chatcmpl-CGlqI9lx7eSQvYHlfjMsdyRG6Uxtw\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"GOVM2bc\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_aed8c5658597a148c7fe740ef98aa03d.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_aed8c5658597a148c7fe740ef98aa03d.json
deleted file mode 100644
index fe99dedec6..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/standard update_1_aed8c5658597a148c7fe740ef98aa03d.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate the first paragraph to german\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_P0hIbY9csH634LsFOYdX0i7y\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UNsiwOVDTCcS3\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DHTxeJLe2\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Q8fYrGJssbZqdTs\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"oxey84suk8AGtO2\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LkVjj7TgV3QKhc\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qU5S05qnCnsTg\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"a2m5wc8R1THxWY\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"z\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"RVujQrbE0qCC9V\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4n\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"KR\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"A4FMGWwtRyT7TN\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vGUCQv7ZYYZOxs\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"58F8YYrNNEGXrg\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ze\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YV\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"VR\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"a6othEOgWP0FEq\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"SF\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Welt\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"sJeJxHQccwWETs\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"iB\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8x\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"N\"}\n\ndata: {\"id\":\"chatcmpl-CGlq7zaAVmntCxUpT3iGfYwsauHsm\",\"object\":\"chat.completion.chunk\",\"created\":1758113179,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"pnmOFEZ\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_bd46c569d016618aeacaa2514b6f4906.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_bd46c569d016618aeacaa2514b6f4906.json
deleted file mode 100644
index 0619dc2b71..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_bd46c569d016618aeacaa2514b6f4906.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"remove the bold style from the second block\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_zgIwhvhmFK2ZVEOkyecnWkuG\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hIom2g3hTsuE2\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0uMDliPzF\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XlNRhnblj2ANOAq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3ZzimQRVqpkwU6X\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"v82eLdVrbN8lm9\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UJzRoWW3A8L95\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"A8T3HQqlPi6u66\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"K\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Q064FJd9BQgOKJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qj\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6k2CLWTfcHmm2y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nM94aZZyNlpTDN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"c9xGAQen7XHQiy\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"im\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5q\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bqXKnKTJXH2sg\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0u\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"poI0DUiS28hZZuU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"m7W10BNmLvLgvL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NvDLzGTrZN8D\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3RgxTBdru9x\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Wx91RCtY9Vfry4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"tJUoHq83wJPgqR\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"VNC4ZssroXJB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ExwOhKdSCFlqJm5\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bCz8Xbj9A2tNRv\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"V9bsRIh5lvLaKA\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lvnf8Cov9g3w0v\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"IvJNWoH5WVbgXGz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7TQ0uwpZHSPfujf\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bQJKvTmqRoROaZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8sec2EhlFP1Bknb\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TXhgqHV6IgyBoqQ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"u\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"uJGlgLLeMTjnovS\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ew\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3W\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" How\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1oj6FL78tVGnu7f\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" are\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DSeRo2UhETYNnwA\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"W8zkzb6VodEkhU4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"kJTIQBPvi7T1B\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"U\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XiQLpDU1kqfu2z7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"IIT6wUUuxwmem\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YDHkEsWUXkuSF3\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"color\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"HTTuFaCgYbjfUc\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rgb\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dyluv5wJ0aXr5yL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"(\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"11\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"t\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4c\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"KI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"110\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"SC\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"fP\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"153\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\");\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"d\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ek8EPiEQ5hUtfGw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3kAQnSSPpFlmGd\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XHR601dLRK4NE\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8EiqjoQLv7cGgA\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z8wZZJ9FhWV7i4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"owI5Qe8R4KCS0L6\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Color\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"E0onIef85aeFcr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8QImAuNJwKJ2nvY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dhkvb1lfWPUAxG\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-value\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NcnIdxNwYtwri\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UiSkD513sCtkxY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"EDnfjrVV5VbgbZF\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"R0vbz7d52UUCnM6\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ALbHlHEm3hh8qD\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-edit\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"fWCTNu5RSkEjCr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"able\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"A3GDxMBZtJ1i2LI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hHdJQ81khnSSdN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DpEBShtzw8tEkp\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"This\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ZcLN3y3P5hlvhYa\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ugBOYRoQe9e3vs\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" is\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blue\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4fH4JpaSG4cVZT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zelLIe4SNSAwl12\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8I\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vl\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"M\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXindWUzaVrkWvuS1P74GEWz8i\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"a6kT3fO\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_e25641c56a8cc1fdca49a1d3ff5db2b4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_e25641c56a8cc1fdca49a1d3ff5db2b4.json
deleted file mode 100644
index 89d2aa2a14..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_e25641c56a8cc1fdca49a1d3ff5db2b4.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"change to say 'Hello! How are you doing? This text is blue!' (remove mention but keep bold text)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_gCqwKhdbYSKOEjVtR4phy2sd\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"mGLKmRzCzTNYk\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"9Z1GRCwyx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"L03kRWc3mtd7007\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lgakSWwa4W0DgkY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YO7FBfvyamZBYg\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"stQsgUcnlko4v\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"SnSWgcD1JZbXIz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"h\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"AFsem2Pt3k8VU6\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CC\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"p0\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"f5ez1DQHkhqKaD\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"BNUvA6Ozx5ZvEe\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UTL78Zkv7jtxhr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"k3\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"g4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"PPoh7KHJgFrKK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"w9\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"O\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yEQ4R1Aa6ADFD\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"How\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" are\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"osia6dxo8Yl1Dfd\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pVwDuT6MMsBiVkK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UyBd7lQeDKxJp\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"thgmaDH8NpeHc\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Rl\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"m\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Q1aCSDAwAwB2Ckx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"12I1uaOE0KhWh\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vtPDH6wb1mIUEb\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"color\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"iKVdTjqWquMbVa\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xP\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rgb\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"l4ugremOI5fSO8U\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"(\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7I\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"11\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"I\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"9G\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"j4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"110\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pQ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"RI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"153\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\");\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"c\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"tgR7uATVBiUh7dq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"i8nL8APW3IK41n\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0vyCtyAr4RwK5\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JtL0of0vtgE3J0\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nVN0AFrnsxscmT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5CzPV3rKPooTotN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Color\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lyEA0znKGbGckz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"QA8iDGFwZ3q3yh6\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"n2oCnEVzfmbI1E\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-value\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"t7z5yUbGaBYIW\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"oiHhVQIurUoMpM\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CvcF4IasPbKRVrr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Fue0FckHm3tK8hC\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gZ1QIjmtQqhqye\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-edit\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yvPDDln32HHhER\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"able\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TpSRxk0iRE2wbiJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"iLUEuhyocydhTM\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dOY2mcuAWYlkwo\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"This\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"E7cdIor6vhZ8wG6\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"IVOrjXvXXpJmuT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" is\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blue\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UIcjBzQXbfJHvZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"fQLeo2aC1jaRCfh\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"QF\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jm\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"e\"}\n\ndata: {\"id\":\"chatcmpl-CGlqEGmMpsPpQZNSUsyuHZe4PKP0m\",\"object\":\"chat.completion.chunk\",\"created\":1758113186,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"CrSZ5y3\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_1ba1a4b5441db5f015f9ef75218f87a3.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_1ba1a4b5441db5f015f9ef75218f87a3.json
deleted file mode 100644
index b1d1d9a5f6..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_1ba1a4b5441db5f015f9ef75218f87a3.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the content of the second block to 'Hello, updated content'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_wULMFRSMft8fh56epwdGrqy6\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aoevi0DDtNh16\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"HNGtzJQ9b\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"wirlzLSlEhEYiI4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"etOhhykCigvi8CV\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"F6YDMM5r7mbKni\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6r5gzsWpR23nq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ffe1SUb2PM4GqY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"E\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"eXD6qYJ6W9Czcw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YP\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"KL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XfHnz1TdTNPLyZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7NiVzhanDdLk7Q\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"cTVoV0ccgTGMzs\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aP\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"eX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TTghqw8qGfZSr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XR\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" updated\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"COHUDHJoMyL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" content\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TjfNgGQbklB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hP\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nl\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqCBK5pizYTcfHNQ6C2J7DfrgWo\",\"object\":\"chat.completion.chunk\",\"created\":1758113184,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"dq0tgwP\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_4ae245b2bc01d569f87f98827e4ca6b1.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_4ae245b2bc01d569f87f98827e4ca6b1.json
deleted file mode 100644
index f2ae03e965..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_4ae245b2bc01d569f87f98827e4ca6b1.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"update the mention to Jane Doe\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_X5ydBQ491eTVFvhZEmswKxdC\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"adnzhpKGnZsfx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"IJ8efOzhB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yZaNJkdnUxfLkvO\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pz1hoKOo4MtC5PV\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Wq8TlvceL4xVD8\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"FdrGZxlh8duXJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"d8XyqlMC3Fh9Oz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"S\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1B35RylRbDf9Ya\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1U\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xa\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ELo40sUPkjcio3\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2ZXov1ckExB4KG\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"BIqhmuh7zkjsnI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qA\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Og\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"FKxyaNbvD27ua\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ya\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"e\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ToOtCW8D4JOoxgN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"E3yY6eTOTYvD5j\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"h7wArQroYLHB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"O2HLkxr4x1a\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Bs0rM24sLHH6mY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lDlXlGcJdn6Tyl\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"fQNW29hVC2V1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"f6yl0FusYwPRqTu\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gXtYVoUV4FLikL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"uxHtP3nf8GcKjB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"H2wU5J3pjMDf78\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"N8XUGAa2oYgyF8Z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"shtgf8TgxDzbItj\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"X8LM6NesmKXSrf\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Jane\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aOM8Pq2wpmT7xhv\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nJYL9BVBROejab0\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"M\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qNkgXqc0YzKPxuG\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"kg\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5Y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"h\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"BbX3OWSlYjf1F\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Tq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"How\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" are\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pMue3mUgD3ZsmIz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" you\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"AwteSm500AhRwN7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" doing\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"p1ZbUOhBamqpm\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JJVVtmjEnINHF\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Cw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"X\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"KuocQPEVdCulDw2\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"B6kbrfqrLj3b1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1pVz9B1bRTlR6n\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"color\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"VuC4AjYWh7J2xr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Qc\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rgb\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"KChNCOsK2BY1pqa\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"(\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"un\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"11\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5K\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"QH\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"110\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"m7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4q\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"153\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\");\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"c9J6Hw9PxFNF2EM\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"tcO78Tfzh6isfh\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"yRW76PdAuiwax\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"eq13V0aIOjkulO\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3GzDop8wKmSl4T\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"mDUYmJY8YOc3TEf\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Color\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"esBXDQRcSBEl3J\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"IY5cyVGOjwR9EE7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NGxu7EwiWDE3pA\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-value\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ElxOUGTzPuV2E\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NO9LHhn2W1R2Bb\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NvFMyr8kvBMcJoh\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"cpgKkYSDSo68Ikz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8P6vT7HxKTjlU8\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-edit\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"QOITqd4cX376OE\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"able\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CqsrqldlqkP7iaY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xxxrBpuPTxqcLH\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nVC8f1hHZoErft\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"This\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bnwOKp6I8m8FKsN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hsFkFrGhInIOPu\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" is\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blue\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"IjKKUaiT5AZU1M\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"RSCeIIev6YcpT7f\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"n0\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xf\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"O\"}\n\ndata: {\"id\":\"chatcmpl-CGlqIVSXeECiKgjn8LocRBLRJTBBP\",\"object\":\"chat.completion.chunk\",\"created\":1758113190,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"62eum5p\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_97807fd69b67c1c3e79e678fba3ecfcd.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_97807fd69b67c1c3e79e678fba3ecfcd.json
deleted file mode 100644
index 7e779ea5ba..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_97807fd69b67c1c3e79e678fba3ecfcd.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_tHSCTvtI6Acntrx5tbN10SRh\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"b3iEK3BayquS7\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Q4V191vlz\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"AtDVEkI3NeTE580\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"S47plaf3XcsUp95\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"knpZ3SufiWVMkF\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LCG0BPZ8sEqgM\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vV6mYaeXoZPFfX\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"V\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zxzNV7nNRU7vhX\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NZ\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"I5\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"acLpgECyd9IdNP\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ml5gZuVDteXND7\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bCFJSjmXPARZpy\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qO\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1W\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"IT\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"K5kbxXNRkk2ERT\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0R\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"j\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TiOMzTHNBBSAc37\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"f4GRlE7ZOVOMk0\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-inline\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jI6TvXwq5SwS\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-content\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"WOAjSkst1hl\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1TQUuNMV5gE1KE\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qynnGst91ounGA\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"mention\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"FvaazK5eYG8x\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lHh3QFwfV79RSYw\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"GLpMV8LVV4NqAq\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-user\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Fx6lWVvvw5f65T\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2GDUUvlJS7J2ap\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"e5DFkHoG7B4eOWu\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ta7ph2mgvkEjc0u\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pSUlkrWYwYhdw5\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"@\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"fr\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"John\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"P9HcUpwbMYNMsEt\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Doe\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"P6nPb9MF850I81l\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"T\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"QBVgutc4IJu8FmU\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"PT\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7z\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"I\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7xST9ZyMJa3ZR\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"K7\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Wie\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" geht\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JmYDZtdjBYb9N3\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" es\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" dir\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"82djkDSIGdzapDS\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"?\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hMRMPreVj6zuj\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dV\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"o\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"MdX0Qly5qJ7PDaD\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"VBVl7AN2nYv0y\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CWaAhKJEzZTsv7\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"color\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zoUT7lYgfd48lN\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ly\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" rgb\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aFvGcpAXvGUyu8x\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"(\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"EJ\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"11\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"w\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0D\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"py\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"110\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Qq\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" \"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"kr\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"153\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\");\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"h\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rYdjNX87bF7Eiyb\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"AEzeoAj0KJY3Lt\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"TTGxdVe9fYQPC\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"p3260pvjD6kKya\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"G6ILvnWaZ44PBr\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2tV6qRa0rslWV5f\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Color\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"NBgNzlSXQaxZt9\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LsPPWqRNgMxnRPA\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5jhssj6qeYShUo\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-value\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"i8BKf2ELw8Ybs\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5xuHVNV2eUn4wO\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"blue\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"R3UXByHDknUmpBJ\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2UuXk0iMEp7Udli\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" data\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"BIMUnMrQ1FDulx\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-edit\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CHUup9xEInnRzA\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"able\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ix4OGoSdsuwwRit\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"k69mVqQhBxYFMJ\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XSM1dKtN0BwzAp\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Dieser\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"teOLX7VK4MRSW\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" Text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ImaRFxibtxxB5G\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" ist\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"I7z4NfzEpALyPKJ\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" blau\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5U3DvuA9IkLAzi\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"span\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ghx6wpIqQAnuZV8\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"h1\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"uH\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"C\"}\n\ndata: {\"id\":\"chatcmpl-CGm0K0XKmyO37jHLXJk0mRZrhnI1F\",\"object\":\"chat.completion.chunk\",\"created\":1758113812,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"PU4LkVC\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_d6c7f981af0a2837c6cd85da3d297974.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_d6c7f981af0a2837c6cd85da3d297974.json
deleted file mode 100644
index f3cd8c88cc..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_d6c7f981af0a2837c6cd85da3d297974.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make first paragraph bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_FX8F3vOJJ7SRqLg7SG6YNYi1\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ozZJncvGpl9v1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XeGT5FgMk\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DFJU4opzthTfEBb\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"nTL6e0zOqQTCQfJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0gruX61pkNLbMw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0UPkINs8JR5Gq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"G0y9w6syWVYjPI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"C\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LSSoq4QUbtmlpU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Rv\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"uc\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"XEieEeHq8sn4Yt\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"D9hghq0QfezaFQ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UCSpfKGlQ2lJhn\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3G\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"T4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"h\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ME1tHQfh66xna\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Pr6406zU6hpqs\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xU\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"M8gsCe1EknDFP\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CwkwTktc0fzX0\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8F\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"tb\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"h\"}\n\ndata: {\"id\":\"chatcmpl-CGlqHgId4nTv09ZSmkJ1Sg2qannMo\",\"object\":\"chat.completion.chunk\",\"created\":1758113189,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"mqqVdMa\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_8ead2588e1bc1366b02cfded465fc8d4.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_8ead2588e1bc1366b02cfded465fc8d4.json
deleted file mode 100644
index 21e3ab24d6..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_8ead2588e1bc1366b02cfded465fc8d4.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make 'world!' (in the first block) bold\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_QeMC5cHSdSm6OvZmdO5VEDSe\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8LwZhzmyBweoY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"iKbyLzARq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"COt7cPLyuXUXvhl\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"y9JEUYvrzovgvzf\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"tXWiTJ99Fsurwx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7JWREvSLDE2QJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"oPBdfCj7t1hlcM\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"A\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"60ni2PMFBZoNFF\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gk\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dBfEYrHDdWJMxT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Q9ecv6Jy6f3Kjj\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"fW8lQCuxxioeIs\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"q2\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2C\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"T6qJSuiwBv8QT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" <\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"w\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"80yp6gWstnNMM\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"50\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rI66E8NyZMemIb\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"strong\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hlTcWpHn2SEiI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zM\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"f\"}\n\ndata: {\"id\":\"chatcmpl-CGlqFMo3OYel0m3CCt2i33XviEmak\",\"object\":\"chat.completion.chunk\",\"created\":1758113187,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"ZdQ7W57\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_c2c3a06cd8eb6901e2007575eca77530.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_c2c3a06cd8eb6901e2007575eca77530.json
deleted file mode 100644
index c4943d3066..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/translate selection_1_c2c3a06cd8eb6901e2007575eca77530.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List 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.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello
\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"Hello, world!
\\\"},{\\\"block\\\":\\\"Hello, @John Doe! How are you doing? This text is blue!
\\\"},{\\\"block\\\":\\\"Hello, world! Bold text. Link.
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"translate to German\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_I8X3XyHeACbbWFHMVPo5NKbd\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"OcUJOnd2eMMFg\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aBt6O6bTd\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7h88vOmi0ck1gwn\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6BH078OAiiGYuNB\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ao0mHEdBgn8bEV\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"EpLKMRfpIhpuj\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"kNTbY8yAv8kUFw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"RWoAJ9Kq1Q9wZY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"71\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"y1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0YnLKvzQH515iz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1dC5RVYbHNKkel\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vjKCUVUNhRbukK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6e\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"md\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"RK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hallo\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qerEYvTmmKa6Hu\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"l\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4o\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5A\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Q\"}\n\ndata: {\"id\":\"chatcmpl-CGlqWiKKSG1CVefTDXwAEiyNBhadM\",\"object\":\"chat.completion.chunk\",\"created\":1758113204,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"mkOPEf3\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8ae508a1ba8354be0703f5bc89561691.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8ae508a1ba8354be0703f5bc89561691.json
deleted file mode 100644
index c8e5ea7084..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_8ae508a1ba8354be0703f5bc89561691.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids. \\n List 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.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Bananas
\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:\"},{\"role\":\"system\",\"content\":\"[{\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"block\\\":\\\"Apples
\\\"},{\\\"block\\\":\\\"Bananas
\\\"}]\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"turn into list (update existing blocks)\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_NkGQuqJJTAZzmEou4hSP8XNC\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"uSNQssiN8nV2c\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"a1KEwOqhr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qqjo7tzkWDqKxsK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"sa71VO0RcP1NRIX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"t5BkKzWBzYR9ik\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"iGLQjkZcwx2rM\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"MlpLaSNlnD3CLX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"F\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8m7UCZAdxeo4dX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"2\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Xr\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"AMYIh5OkBovIkh\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"MrvLGGoiNrxdaD\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"HUh6MUTEJ7jqIy\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Hc\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"C\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"qu\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Ap\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"r\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ples\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JYF7IhzoKqODMd8\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"N\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"K\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"},{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"9BSv8P7pbhNEVd\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YEBjrxFXAp0EuuR\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1rqncc0whb8Osz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"FnbmBqltF0IFx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"P0LQyJysZrv1dO\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"OPK1VYhWGTr8Cz\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"3\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Mi\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0a\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2NUnQcsFW0hO7E\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pDOQr09zWoFP9Q\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"iqKA0rONNHOyS7\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Fd\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"0\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"><\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"N\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"R\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"E1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Ban\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"anas\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"oGEVNGMbaiUMRfu\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"k\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"li\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"x\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ul\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"V\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Cy\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2\"}\n\ndata: {\"id\":\"chatcmpl-CGlqM94BCWDju1JoLa9OoBnIkDsb8\",\"object\":\"chat.completion.chunk\",\"created\":1758113194,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"RVyOHdF\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_e0330a1df29640d9ff657ad9037bc203.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_e0330a1df29640d9ff657ad9037bc203.json
deleted file mode 100644
index f7aca20f1e..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_e0330a1df29640d9ff657ad9037bc203.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_1fEyQxasv2c9DWQHitDL7VTP\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UDaSt0CDMPd0n\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"E9dQT39Cu\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ZcUtz5siylQBgui\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YSUk2W61M5OPneu\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"S5eLRnAyHjiFIv\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Sb0Ve0UvycC5p\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"uGrNSbmOWpztzI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"n\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Tob3xJQ11GdLtp\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ic\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"HE\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lk4h6wRZxI8Sti\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"QBHZDbuemPfhlZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zFNOZWuIcwpwPY\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"4B\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UM\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pyF6OpsfvKIpK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6vs4XmjhDsYliP\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"7uUCIdsMIdeGh2t\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-align\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"hm9wdVXHH96Lf\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"MJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" right\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"pvm15WaU33Oq3\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\";\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"vQZ30QZjLQb6rq\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"What's\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"eDijIHKhNOu1A\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" up\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"wA\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aBtxNSxZoEKNx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Fy\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ef\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Y\"}\n\ndata: {\"id\":\"chatcmpl-CGlqBoguileCObWCpQQXz2Ytsisuk\",\"object\":\"chat.completion.chunk\",\"created\":1758113183,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"2ikqZct\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_673b8e9ca4d59db999abd61ed34ec305.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_673b8e9ca4d59db999abd61ed34ec305.json
deleted file mode 100644
index 32cf576420..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block prop_1_673b8e9ca4d59db999abd61ed34ec305.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph right aligned\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_9IS4X2ILIuA0OexNjzpCkqrq\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"H7Bg5i0iuFAsC\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"v4J6bzBmx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LSe2xYehbUoVnQJ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"wOOk31PNbzo0mZT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Z3cJhq0P2xMJF8\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lucEi5NjBJRMN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"rxuHnnLoformOh\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"X\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"cUiCEaOrTbvQPk\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"OS\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"jD\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"5tUcHJN7nErO4R\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"stniZm1RqjojGN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"aFzcBHwO0iHHpa\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"6u\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"cZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" style\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gP0VSeXQJeLOn\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"=\\\\\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"CkvI7tOP2f0uab\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"text\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"bKKIqa55KAIAOAc\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"-align\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3pDW9Xj0ww7ap\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\":\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"zK\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" right\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Wh4yIBEV9zn80\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\";\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"25\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\\\\\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"lInYNNt60eaq1T\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"dZ4zWKyIdRJr9H\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"m4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"91iHGL7SlDRsp\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"p\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"87\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DG\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"O\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAK4a13SnIAl6En6uhYD53X7oL\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"LKvmIJ3\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_605daff442fc8684c6d126269f2aba3b.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_605daff442fc8684c6d126269f2aba3b.json
deleted file mode 100644
index f7346c416d..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type and content_1_605daff442fc8684c6d126269f2aba3b.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_se5rp5yejE8clnmlOYLxu5ZJ\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Gl7rQX84zf9gt\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8UnjCIheL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"847uO6Yr6YqFLrZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"njQ22KYiSEYbBEy\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"l1K46z0lOL1nNx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Vxu8svaSCcw1r\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LBzrb7lLgAsjNN\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"S\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"DWeFqGnO3755PR\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"2P\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"p6\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Q347ifn9nBvoBi\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Jgc9iBMeNYCrUO\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"9QI1T8d4CuEFzi\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"UX\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Op\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"p4\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"What's\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"e7SeT9AcSDQ1W\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" up\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"3v\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"F9c4KbGlyZL9z\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"HZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"xx\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"YT\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"a\"}\n\ndata: {\"id\":\"chatcmpl-CGlqAtOoVyLVHdaa0BoiHUteG30Xq\",\"object\":\"chat.completion.chunk\",\"created\":1758113182,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"10AbOYh\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_78e5c1f637c725aef379fd2b7f7551bf.json b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_78e5c1f637c725aef379fd2b7f7551bf.json
deleted file mode 100644
index bf14bfba37..0000000000
--- a/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.chat/gpt-4o-2024-08-06 (streaming)/update block type_1_78e5c1f637c725aef379fd2b7f7551bf.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "request": {
- "method": "POST",
- "url": "https://localhost:3000/ai?provider=openai&url=https%3A%2F%2Fapi.openai.com%2Fv1%2Fchat%2Fcompletions",
- "body": "{\"model\":\"gpt-4o-2024-08-06\",\"temperature\":0,\"messages\":[{\"role\":\"system\",\"content\":\"You're manipulating a text document using HTML blocks. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a code block to specify the language.\\n This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"system\",\"content\":\"The user asks you to do the following:\"},{\"role\":\"user\",\"content\":\"make the first paragraph a heading\"}],\"tool_choice\":{\"type\":\"function\",\"function\":{\"name\":\"json\"}},\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"json\",\"description\":\"Respond with a JSON object.\",\"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\"]}}}],\"stream\":true}",
- "headers": [],
- "cookies": []
- },
- "response": {
- "status": 200,
- "statusText": "",
- "body": "data: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"index\":0,\"id\":\"call_fldYHlxOFXI0Yk2jVisADgU8\",\"type\":\"function\",\"function\":{\"name\":\"json\",\"arguments\":\"\"}}],\"refusal\":null},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"a4UPP97xrxcYk\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"operations\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"T6t6D1sbZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":[\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"PAoE6w60bAXV6GV\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"type\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"EaNnwm19vNkHMd9\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"JSHT4x4kTeRxXS\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"update\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"eBE6STPQDGRYy\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"00MTxxsAPuL965\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"id\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"s\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"gWBCLg1Syj1zal\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"ref\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"ks\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"$\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Bt\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\",\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"N8ZEWCWWWG9R27\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"block\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"8bqMDTNJEuDGVV\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\":\\\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"w1N4DrB3rOFJBt\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"<\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"9m\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Gp\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"EZ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">Hello\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Ks1fgxRYPUnD3\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\",\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"BL\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\" world\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"MHTdxZLr8qwpQ\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"!\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"h\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"Hw\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"1\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"G1\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\">\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"LI\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"]}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"obfuscation\":\"i\"}\n\ndata: {\"id\":\"chatcmpl-CGlqXJwoT2939yFhGhiOi3XtkAICw\",\"object\":\"chat.completion.chunk\",\"created\":1758113205,\"model\":\"gpt-4o-2024-08-06\",\"service_tier\":\"default\",\"system_fingerprint\":\"fp_cbf1785567\",\"choices\":[{\"index\":0,\"delta\":{},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"obfuscation\":\"NQyI45O\"}\n\ndata: [DONE]\n\n",
- "headers": []
- }
-}
\ No newline at end of file
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 + generateObject)/clear block formatting_1_67c4abf409c5217946a8fd26353f3d5c.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 + generateObject)/clear block formatting_1_67c4abf409c5217946a8fd26353f3d5c.json
new file mode 100644
index 0000000000..8fbb0df2ab
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/clear block formatting_1_67c4abf409c5217946a8fd26353f3d5c.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Colored text
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Aligned text
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"clear the formatting (colors and alignment)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7a512188193ae5596374382237e067710100aafc9ab\",\"object\":\"response\",\"created_at\":1758783397,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7a512188193ae5596374382237e067710100aafc9ab\",\"object\":\"response\",\"created_at\":1758783397,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"6i1M6yN7vBfkDY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"q5H0Oz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"d5Ljk7zXZE7ZN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"SBQGjcQoEaOByY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"HtJY3PREWEqs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hqdJNSeLJOPAR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"CDayC8kcYm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"VxqhkmdwRiRjh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"yTB3a081bUn9IG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ztqcmmv5ahyBg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"poYnZfINzZAiR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"gfpIJ2Tp1onhNga\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"GIyCBanLVEPowYC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"0Gzl4tddDO2St\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"sZQjzE34J2F\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"dJpgAagjRYKE0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"jVinnhWuLjMniZK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"h72YEEzAJ0SetTW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"QMDUZiSErZpX7pW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"Colored\",\"logprobs\":[],\"obfuscation\":\"6GEOZxOPR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"T27S1mJZXMX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"db7u15RA8x115l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"wqjH7m0AR3fp8FZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\">\\\"\",\"logprobs\":[],\"obfuscation\":\"LMoNQm27HYsmfu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"gmk4UHl0rX3o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"QoAGQ3FpZpmG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"2qwOKdUNWsKOy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"UL4TZPCw2p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"SY9EzuDO0Gel5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"pDjowpvG40YyNe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"x82Xe0rf6G8ML\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"sJAeeIyj1y2Ks\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"tLkpl6UlRXXkhVB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"pZTMVtYRypymPcm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"XXDMIt2FEWr0A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"Kc4mYTz95cH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"5tE9P5PYKtfpv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"1h3FlzzgH4r3eoy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"WAvXTEnifWodpx6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"8JNynTYOTdWw4iU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"Aligned\",\"logprobs\":[],\"obfuscation\":\"IiuU3Ay0C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"SCFpvNOFn9G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"lREOFkiFEpm1A1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"I7wFT30zTFUrA49\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"DJoLQg0EoQqfEWC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"ctbQqB92pQbmjg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"3e8yBsv5VbW7ta\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":51,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Colored text
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Aligned text
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":52,\"item_id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Colored text
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Aligned text
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":53,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Colored text
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Aligned text
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":54,\"response\":{\"id\":\"resp_68d4e7a512188193ae5596374382237e067710100aafc9ab\",\"object\":\"response\",\"created_at\":1758783397,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7a5960081938efebdd7e137a0fd067710100aafc9ab\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Colored text
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Aligned text
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":639,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":48,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":687},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/drop mark and link and change text within mark_1_4d1645603f58ac95cefa5802e9d0b576.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 + generateObject)/drop mark and link and change text within mark_1_4d1645603f58ac95cefa5802e9d0b576.json
new file mode 100644
index 0000000000..1906c78660
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link and change text within mark_1_4d1645603f58ac95cefa5802e9d0b576.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e79f306c8190a18fe5e9bcd9b189028f62c28db4caa3\",\"object\":\"response\",\"created_at\":1758783391,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e79f306c8190a18fe5e9bcd9b189028f62c28db4caa3\",\"object\":\"response\",\"created_at\":1758783391,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"kqfshPneAwKvKX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"8sfKvx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"tooImfHKEOHWe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"T7ZAhb32nL9hj1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"DF9vvfI5e7kx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ughf7CwqROxsA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"pYS1iTVZOl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"i8Lf3ucxBYphM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"eDLk5XoSaioOOs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"YhTRXAGUdKhvy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Nc3XVXJ602K5R\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"01PFTs1PZyk7him\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"rm5UHNXTAKL58T4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"jqIJtekFldk2o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"eJU2CUCdbrs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"J2iplNO4hlDQK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"py6a04fyL7eoHYK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"4wFg8Op0MvlvnXA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"PCBw3yFlXpvqhBv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hi\",\"logprobs\":[],\"obfuscation\":\"hiA9xYgs6KzilM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"0crCko3q0KgMZ7U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"ppnfB2J9Hv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"MV8DC5rwtD6RPlF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"QqPFTeKw6Tl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\" the\",\"logprobs\":[],\"obfuscation\":\"9eNcneQYPZVp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"sNqtx4mJPgk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"YO5KJ8XwufgSeJ6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"BW4oFOT0EeN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"M6r2c85YsgQkO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"2p8Y803f0ruyO3H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"RH4sHWD3Ik0vCOY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"vfIIRX3Pzqlu1W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"KyAMxBlIQuZml6\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hi, world! Bold the text. Link.
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hi, world! Bold the text. Link.
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hi, world! Bold the text. Link.
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68d4e79f306c8190a18fe5e9bcd9b189028f62c28db4caa3\",\"object\":\"response\",\"created_at\":1758783391,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7a02c348190bf3e06c00ea81538028f62c28db4caa3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hi, world! Bold the text. Link.
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":741,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":775},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/drop mark and link_1_8235f32b241ce454e355284db306f2b5.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 + generateObject)/drop mark and link_1_8235f32b241ce454e355284db306f2b5.json
new file mode 100644
index 0000000000..c88aaca20e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/drop mark and link_1_8235f32b241ce454e355284db306f2b5.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the formatting (turn into plain text without styles or urls) from the last paragraph\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e79de8c4819589e751a60e41e7ee06f565dce5007b02\",\"object\":\"response\",\"created_at\":1758783389,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e79de8c4819589e751a60e41e7ee06f565dce5007b02\",\"object\":\"response\",\"created_at\":1758783389,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"R7o1iU4YOEHnPP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"g5fcYw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"FGjPGrQUclSGq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tOnTgNNEYU1Q7Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"tBVdmWXE8gcJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Gysi9mbFBcuwP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"PcDxTqZnWl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"UzToza8409Lmc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"mQ9GDghDru2n73\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"0dbs9emDWjsad\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ujMiRKY2ksrrP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"bL7blvnuZSWSsS6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"2xeXs8ex09PWU8p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"rJU5YM4WVeRWn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"icnCVSd8bkA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"TeoMKkPbNocRX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"MKgceoRprmy2gnn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"ql6yzfdoIE7qj46\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"juI3yozAUx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"zHCNhAyQiqWn8vj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"dUPVVovryX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"JklPFb4FuNBhGKN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\" Bold\",\"logprobs\":[],\"obfuscation\":\"WtYvcahs9RF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"lZioBbRBErs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"x89bCez0r51Qesr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\" Link\",\"logprobs\":[],\"obfuscation\":\"rJTRrFupFai\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[],\"obfuscation\":\"hGVaN3lRGwLXL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"HJ7r8PoPOsvceta\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"m8vmeI0jsDcPPN8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"acJiE9DVkqOv1b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"N0zkvFL4jTvvGc\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! Bold text. Link.
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! Bold text. Link.
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! Bold text. Link.
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d4e79de8c4819589e751a60e41e7ee06f565dce5007b02\",\"object\":\"response\",\"created_at\":1758783389,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e79e656c8195a9d198fb5805f6d806f565dce5007b02\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! Bold text. Link.
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":735,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":767},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/modify nested content_1_1e7e3f801e8b2fcad2e947f25b842d59.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 + generateObject)/modify nested content_1_1e7e3f801e8b2fcad2e947f25b842d59.json
new file mode 100644
index 0000000000..7910e55411
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify nested content_1_1e7e3f801e8b2fcad2e947f25b842d59.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7a258188190a5e6491e31d393f20a2d113da3850dcf\",\"object\":\"response\",\"created_at\":1758783394,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7a258188190a5e6491e31d393f20a2d113da3850dcf\",\"object\":\"response\",\"created_at\":1758783394,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"IkNZ5C3D1pL1m8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"c9WHsU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"abgAw0VhKFZW3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"CQMnlMdzwnUSbl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"Xvu7dCRNx1Op\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"YgHUzbeP4ArbL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"GQ1mzRiU26\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Bkh5i7CJk1tFc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"8wAwc34W1gJqCJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"kFk1n38o7wulv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"cofeERc2K0Rfc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"tmuM1xs03qMJRgn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"mdiOndfEtHiNYBQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"7XPJnh10Xg8BS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"5l1pDy1gLUD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ZkaAxHMzCtifD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"6KDYAGJ3r5c18pD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"D170vThK17FqEDU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"Ei9UhFkUhzQyp5N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"APP\",\"logprobs\":[],\"obfuscation\":\"eiW14kOCAJ9Bt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"LES\",\"logprobs\":[],\"obfuscation\":\"Cb1OdO2nwV3fw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"qfFRbtmSyBEbQt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"MvQUHV0cyjJZL5Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"MP6fflBX64sG6AK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"oRy8H8itOZ1IvD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"bqMKeou6HSc7Gm\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"APPLES
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"APPLES
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"APPLES
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_68d4e7a258188190a5e6491e31d393f20a2d113da3850dcf\",\"object\":\"response\",\"created_at\":1758783394,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7a2e96c8190abcb8a0fb3dbd78f0a2d113da3850dcf\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"APPLES
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":600,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":627},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/modify parent content_1_06951fbd3511111eb460efd853b4c6ee.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 + generateObject)/modify parent content_1_06951fbd3511111eb460efd853b4c6ee.json
new file mode 100644
index 0000000000..2845771a80
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/modify parent content_1_06951fbd3511111eb460efd853b4c6ee.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7a38b2881939a261c45d0fd6a000194aad94a81b6db\",\"object\":\"response\",\"created_at\":1758783395,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7a38b2881939a261c45d0fd6a000194aad94a81b6db\",\"object\":\"response\",\"created_at\":1758783395,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"3rRpyqFIfrgIuE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"D2jw0X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"9kf5U8kTmZHUj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tnTxqK2wbOENTB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"HQDQkmZk46db\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"gpznIXnCPk2TT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"RHYjLjmsWx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"RkX6jwZkL5nvl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"eDuJs4ENWU7fCw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"c2fIyOrRIC797\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"mlYKK3J1DS9xg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"uTeDRcRiSAjf9sP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"VwrMsfp6mrhaf7g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"hgQvm6q88uIxj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"prfcryHZU0D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"eVEpDyoyiDnkp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"CvoIGATdYKSfwov\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"Joc0hyyqeTm5NJq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\">I\",\"logprobs\":[],\"obfuscation\":\"0jKkbIIJQMt5Cw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\" NEED\",\"logprobs\":[],\"obfuscation\":\"CtOMtXIKTea\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\" TO\",\"logprobs\":[],\"obfuscation\":\"3w9KA6MxYt1kl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\" BUY\",\"logprobs\":[],\"obfuscation\":\"Inz6Ywkqcg3y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"IyJkKUQAMUw78\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"LmWgrmmvBoVfJr9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"24qxPRv8ioazIGg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"84zCqYcwANpZ2q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"2aCP0lIgCc4m5C\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I NEED TO BUY:
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I NEED TO BUY:
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I NEED TO BUY:
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68d4e7a38b2881939a261c45d0fd6a000194aad94a81b6db\",\"object\":\"response\",\"created_at\":1758783395,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7a4314c8193b0e2b07ea000bb5e0194aad94a81b6db\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I NEED TO BUY:
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":602,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":630},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/plain source block, add mention_1_d27b598add3108097cd76a3113395221.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 + generateObject)/plain source block, add mention_1_d27b598add3108097cd76a3113395221.json
new file mode 100644
index 0000000000..f2938a0208
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/plain source block, add mention_1_d27b598add3108097cd76a3113395221.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Change the first paragraph to Hello, Jane Doe! (use a mention)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7f299b48194b802cabd073bb5d30bda2949cf37fb47\",\"object\":\"response\",\"created_at\":1758783474,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7f299b48194b802cabd073bb5d30bda2949cf37fb47\",\"object\":\"response\",\"created_at\":1758783474,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"AKc8tJeQgCWqFa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"1ggHWt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"UirbbE4ZZFQMW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"CL4ZdhMUBM7WBL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"OGPQVBNGqnhY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"soRGVqkKwIhhG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"L2H1oyu3kK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"cX3rWb1lDYgCt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"tsQc2c0Cyd39Uz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Di5dBSjeOfSGw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"f3J5ps6s3LQ2n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"3bqJR45iBo3nH6i\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"RcedSU8WpMyZnKW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"wuLRDwr9foU7d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"kaSA0zu9SiP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EFe5OZFmuJkEa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"QTknRs7wHJ8BQ5d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"b2mCpgXhIX3bEyU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"9KAIqu8ywe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"KCdbn7jrG2DpUPl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"GbixbKi6ye82d2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"Qmwxy5joE2sm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"ddNWjAEiA96\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"LkkXiPVDf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"4tLGxz0Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"wNl0NXfOm27\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"OZ5oI9eI9VYTq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"jgsMSulnY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"ZQBmemRqLNaod5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"pWRChliFKzO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"rwEKTx8MZ2T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"a78Pk2FuLydxz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"HtHYw5dqASaX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"TESaEj4E7LiJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"n5v8IHQAmQ09m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"UxUO7xRDhYtlkJf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"dog2fErNWKVW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"c1noB5fPNSG0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"1lYnMDMLYLgI2Z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"oocVTucAY8RV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"DRcoU6m61YWpv3b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"U7BNBdQb2JUcV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"9FUA33oZoY9pku0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"A3NabEROJk5jXLZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"9fz2mrzuwgOFmE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"eCRhKbqO3QtKhM\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":50,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, @Jane Doe!
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":51,\"item_id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, @Jane Doe!
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":52,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, @Jane Doe!
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":53,\"response\":{\"id\":\"resp_68d4e7f299b48194b802cabd073bb5d30bda2949cf37fb47\",\"object\":\"response\",\"created_at\":1758783474,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7f324888194b8aaf59e6b0ce2cf0bda2949cf37fb47\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, @Jane Doe!
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":733,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":47,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":780},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/standard update_1_3e742ef6a27c2a70d6a34483f81b80cd.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 + generateObject)/standard update_1_3e742ef6a27c2a70d6a34483f81b80cd.json
new file mode 100644
index 0000000000..ae6eedeb05
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/standard update_1_3e742ef6a27c2a70d6a34483f81b80cd.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate the first paragraph to german\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7d4636c8197920edb9230a4b7d80e855c1b04c85ee3\",\"object\":\"response\",\"created_at\":1758783444,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7d4636c8197920edb9230a4b7d80e855c1b04c85ee3\",\"object\":\"response\",\"created_at\":1758783444,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"iruhrNhxrz65wS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"AIKQRW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"kjczoGVH7GHkV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"BZ7SDwHJ7Bfd7l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"mmTcq9SUySek\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"qeWINvAl1kzU5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"9ZncFWxnrx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"fdorwYhWIZAQn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"d31RTkW5EkxsQS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"3CEeMhleYlWV2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"sw0F5MCuaKTU8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"EChk9G2SPmxSmyR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"UF0bsgzYbi5wUDF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"zULuQFaaCFuUS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"9PtoeEASQh7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"gixSNk82YTSMN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"QUl8rngQ9icKCqE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"eacCMw1k4Krrg74\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"FmWBBIkeMsfVvnQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"Kr0NF0tRiYo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"3LFhwfta2t8jCWo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\" Welt\",\"logprobs\":[],\"obfuscation\":\"46A4fuEUxxr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"L9OXgNRdx9JkW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"WQPvGs46xuJltqq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"0HVGNkkPWvoMSaD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"1UhXtCdNzuaXhp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"B4CEnW9EiKuT3M\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hallo, Welt!
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hallo, Welt!
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hallo, Welt!
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68d4e7d4636c8197920edb9230a4b7d80e855c1b04c85ee3\",\"object\":\"response\",\"created_at\":1758783444,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7d4c42481979075f4f3825099040e855c1b04c85ee3\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hallo, Welt!
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":752},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/styles + ic in source block, remove mark_1_3157ee5ddce8f578c94b14a1d8ee0694.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 + generateObject)/styles + ic in source block, remove mark_1_3157ee5ddce8f578c94b14a1d8ee0694.json
new file mode 100644
index 0000000000..92e67d5512
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mark_1_3157ee5ddce8f578c94b14a1d8ee0694.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"remove the bold style from the second block\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7dd842881908103395cf486dd6c03be3243e18c1574\",\"object\":\"response\",\"created_at\":1758783453,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7dd842881908103395cf486dd6c03be3243e18c1574\",\"object\":\"response\",\"created_at\":1758783453,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tfVBTiQJMSTIoE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"9HLscM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"f2AGOLzPFHqrG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Zm6ZMYGh7QO3UF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"scAm6XEGoPAY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"5wgcv5m9zlEGF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"5NqvkCMAGr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"G8kU9TQ7hihjZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"kLBm2BpkDaJX58\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"eRAxCXKVXFLzb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"bQPDWnLBcrojj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"Mui2la76YlU3r7p\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"rqJcXY87J8BInt6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"85TBEEWuV0EVZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"FRFjWzT5WhJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"8mSz2yeZ0J6fF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"OzHfPgzUz85A7PB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"l3hMCOBsIIEeACf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"VtIeQvcrHc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"2XVAs4oQfjITJPn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"ABGYXtQABksvko\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"KREFIdFcaztd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"upt3AhKSKu7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"zl2tG0Cu2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"aTvDGwRf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"wovV1GVOh66\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"56kS9ZU4zli3u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"iAwSsa2jh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"eH7lmQdyKfHWI3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"4TE1XyA2FSZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"177DxVw6Dbh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"rIZY5hQOXVbCC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"U2nTMh5ZqP36\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"sFV1Q0VDG69b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"UxVUWGGXxkkl6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"VtLXdHTtCvBvjGl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"zicW1YwmP8eZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"DZ6Ek4FXkn9H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"P9IWbFg1jqKRFR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"iMlMY9ryYIt3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"xQvKPRWCzkxfpZs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"6ntR0DCXtJeX60I\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" How\",\"logprobs\":[],\"obfuscation\":\"C2SUzko8q77g\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"zNeHWFnyLuOK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"BM5kY9JhiMRy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"1LWpxqoZWg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"YHt93rz0hjx0fTZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"nGZ5rITjfi9RrL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"GzwWAuwp8wNa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"9dgmnpOUBt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"OqmxuuhOJpMPU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"o417aLskty0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"GxSv2kpTt4NHsnG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"cMuDNgRzLFkl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"SLtxzVPEZ1QesQP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"40NFzoxKuj4cBY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"rfl03T512yKZnCD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"BBl9ksIdA5X6HP7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"bICBProIsXJLS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"ivpqzcn6qXwca2M\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"pTvv0eXnDNhdBzN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"cvWQJkeHe4G74\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"5PyYU6cnPrIgIm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"d9mcRokoIGkoyJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"ztLBlvnjJWQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"zDpGJyBKcK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"FBQiNiwaOSI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"G3YqGC8Brt2HW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"1jqsspjkJzki\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"Ku5TAa5vxOD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"hJA70hLY6oHXlN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"LL1Alpe6DaV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"ailtlhRaFX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"QDkHaVE8AFkYa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"BOEQZlxMKFp8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"fpGGrpqcoykknl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"X4ezlkbBgkW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"XMGgX8DHSZv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"IENuDaB0a7wm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"sXpomARks3HYm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"S0j5Nea1Ahxm9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"DVpXSsAXBcTL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"0K3EdVBWd74\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"MA8gxDn9y61L9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"hcb1s2pv6Im\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"qUoNANsMPUC8D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"7Banp5Q20Vnz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"TSpLuIt0V2ikq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"3hEAZ6AbUNxnFSs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"LPHiMNuawXbhIoO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"EBubykbmbaTi7N\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"siaPhqGmFWa2oG\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":96,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How are you doing? This text is blue!
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":97,\"item_id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How are you doing? This text is blue!
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":98,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How are you doing? This text is blue!
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":99,\"response\":{\"id\":\"resp_68d4e7dd842881908103395cf486dd6c03be3243e18c1574\",\"object\":\"response\",\"created_at\":1758783453,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7df49f881908a898cedf8fa22e403be3243e18c1574\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How are you doing? This text is blue!
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":726,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":93,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":819},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/styles + ic in source block, remove mention_1_53046bb3c98a3ecc79d2ccc9f9ee1f88.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 + generateObject)/styles + ic in source block, remove mention_1_53046bb3c98a3ecc79d2ccc9f9ee1f88.json
new file mode 100644
index 0000000000..c00fa83198
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, remove mention_1_53046bb3c98a3ecc79d2ccc9f9ee1f88.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7e06dd48194a1996b4b88fee9d90fa7087de470933b\",\"object\":\"response\",\"created_at\":1758783457,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7e06dd48194a1996b4b88fee9d90fa7087de470933b\",\"object\":\"response\",\"created_at\":1758783457,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"4bRtdVnGJugQ0d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"wEWDbk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"Zxfo3ZwdRYFIR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"P0IleLvt9ILRJl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"vkigZqp3JsnL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"v2OuYIFLkv4AI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"j2Zmnp4C3n\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"DM0bXfgViubyJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"4c78io3PhGRGhQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"DOxcl9YzXWArv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"yWdEz5e35WKqh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"wlyrfYKCtIAOlsc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"Y0bDoRwyWIoQeq8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"UKykBfOUaeTfN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"MmVsBTtErdw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"egsMeUUDJfvbh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"stvuGtCVNxelHcZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"SgsgVkhqUN1YzQO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"mUrorZb9hc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"ak2Dobfa5uliN7e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"KFAZBKuKUE3Bbe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"PHKo6Cc3iD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"2mdXHkg8qla6XHb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"WdQJHTFkMrQlS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"yhJ9w45DGzGV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"gg7SQXBBfieR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"UiR2QRlprN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"7hISf3hZPdTI7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"DYoVvFhyxN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"efzqC9W2KvuGwBL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"tGU9NZhpw7SQVU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"v70Dkc2tbcsw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"6s2FoV5kdD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"cHJ5UcUYoWTDQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"3zQjcUyBtOL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"Hus6XoI3N0vGNan\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"xcBQndUrhKxr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"q3hEmmj9QWIi5rw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"69dPjh8N4BKeLB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"HxOSHihjDDXVRXL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"SpsGrZw4p9i2966\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"77ElQkqf7ls1y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"spoJATutAKsp4Dn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"6swglIioVqXgQSS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"Dc9T0zBrFcGiG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"NCQh1jbQ0lgVQN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"KzXjTWHEDiGlDM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"2QvxdpkLGcL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"OizswLsabK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"aXooKEHGf7G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"4NzZtznqZqsc0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"rKnZNqHJ1mUy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"gTh46NgZ0gu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"ZCh5Xx644gGEW7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"DlhCv6GhD4T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"i3s0ueUMpa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"TdGv3PJy6h6i7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"XHiTOaiooDnC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"OBAXV37rYubGRE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"ooCDau23vQM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"sdz3jVXtaDd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"KNh3cWr9sKJp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"ULdvWmh3s7rpB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"uodLwehbUnF7d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"Rl4gGOwlf9uE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"QxqptfaRNJx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"Bl5fnRF4kEDSL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"DvAzXimVrIP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"1Jtdtk2e5mBIL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"HJd9iVf3NBgM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"HrYW32pzl4hct\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"ZUYTKUBIriHVFy1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"KSzYq4mP23D5UcU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"ULfHEa2PTDi6Rm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"RBkfRMEqXx75jC\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":79,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello! How are you doing? This text is blue!
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":80,\"item_id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello! How are you doing? This text is blue!
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":81,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello! How are you doing? This text is blue!
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":82,\"response\":{\"id\":\"resp_68d4e7e06dd48194a1996b4b88fee9d90fa7087de470933b\",\"object\":\"response\",\"created_at\":1758783457,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7e2db7081949c8d04bfdf8402770fa7087de470933b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello! How are you doing? This text is blue!
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":742,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":76,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":818},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/styles + ic in source block, replace content_1_d2aedab8bc5dae6b29a5dd2da56165d7.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 + generateObject)/styles + ic in source block, replace content_1_d2aedab8bc5dae6b29a5dd2da56165d7.json
new file mode 100644
index 0000000000..82239fa96e
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, replace content_1_d2aedab8bc5dae6b29a5dd2da56165d7.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the content of the second block to 'Hello, updated content'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7dbe9808190822c64ee05b4e2ac0dbf61d96679cfa6\",\"object\":\"response\",\"created_at\":1758783451,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7dbe9808190822c64ee05b4e2ac0dbf61d96679cfa6\",\"object\":\"response\",\"created_at\":1758783451,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"NqxPsUz499eP4j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"M9oEaK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"7i28eiYahnnYz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"hiD8mHKnxAPwhe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"QlPQREHJ17Ln\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"xfNjqRw7oEzNV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"IJfTWUeFvz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"qelset0JkGsFa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"U8USgSiNIMoodO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"koQC4lc3nFsS4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"B9QHmas79Iisz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"ssQZCAgup4GB5Du\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"5Gy5Iqwxtl3VIlK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"nJwEzXRJGP3qr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"C0Ajj1aBq3d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ow5hSnRfvpy6A\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"OK2ZQ9ok3nakxVG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"NvGFhP6mslsu5PM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"zJfzKbL8Wo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"iQsgOtAR129iE4l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\" updated\",\"logprobs\":[],\"obfuscation\":\"eUaWyWbL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\" content\",\"logprobs\":[],\"obfuscation\":\"4xfx2a2U\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"8ALekgFy1ad2uy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"UjiXoPLe225L84P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"lh4HMIwHIb33cPK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"bVHPNrSQYpmEWf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"H4BuMMP9NouOcN\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, updated content
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, updated content
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":33,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, updated content
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":34,\"response\":{\"id\":\"resp_68d4e7dbe9808190822c64ee05b4e2ac0dbf61d96679cfa6\",\"object\":\"response\",\"created_at\":1758783451,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7dc63f88190b6d4464d19296e990dbf61d96679cfa6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, updated content
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":732,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":760},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/styles + ic in source block, update mention prop_1_fddbbf8781b8c27f9e51a3f0183f370c.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 + generateObject)/styles + ic in source block, update mention prop_1_fddbbf8781b8c27f9e51a3f0183f370c.json
new file mode 100644
index 0000000000..46440d1e7a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update mention prop_1_fddbbf8781b8c27f9e51a3f0183f370c.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"update the mention to Jane Doe\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e799b1a08195bbd897d6e03c338201f8fa991c916030\",\"object\":\"response\",\"created_at\":1758783385,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e799b1a08195bbd897d6e03c338201f8fa991c916030\",\"object\":\"response\",\"created_at\":1758783385,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"sIHoqlj54kItK0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"sFCAuH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"0FdJDMD0XBAIK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"lvRM4twXVMiNkf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"k3dnQTQKRFlD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"BCJDpobrjmILY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"8J92KP0HpD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"5YxLIWbUqcez3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"ygGTXeVrHlSsP1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OoTBxZiGfaAIV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"O5jrlxVPcsn3u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"pOSScSe5cT4CWsS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"mYsCPokzQSgMpRq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"0B7MkuTa3yJpN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"A1cuqGcZnJB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"25o4GqheyQbtM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"SWgpngeKHmBHLmX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"uhYCsOUq9nc7vI7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"xtPUgZHScM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"QZLbRiv8Gi5qlSZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"qjq2hFs2ETmzmu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"0BkVuUs6DJGZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"VzXN8JK1jEC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"1RK8SmYDp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"A5huDItH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"cb0DBm2QRIV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"eGyw3MpeHVS4x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"qnE6bK5Th\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"NwNXNAkc6Zejot\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"C1QCFydoPhj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"SWIboB71St7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"kL9MVfQOvoG2D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"gqUpkMuRpXcA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"tAGmoJ8mJ8yW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"BVo5Es5IGQX1t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"2Z9Z8hkbxU8ChAf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"Jane\",\"logprobs\":[],\"obfuscation\":\"oZayNH2Jv30H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"h75I154UKZuZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"aoHYIof0RG5wSr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"1lth32O4zNJ5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"XrPFLhmnDnPhCJ9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"V0FsJVbJeaCDuj8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"eiyUh6aeGpOmK5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"cLtLSTL2kI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"UWqQlZ7Vo3zP38D\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"How\",\"logprobs\":[],\"obfuscation\":\"r1YwztEPLgCMZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" are\",\"logprobs\":[],\"obfuscation\":\"N7zAx4Jz4eUk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" you\",\"logprobs\":[],\"obfuscation\":\"h4gPIU3ZRcKe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" doing\",\"logprobs\":[],\"obfuscation\":\"v43CjNxHK5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"3QUqSfENp9wjD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"nvTHdy684a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"3ygvEKzAQpzLx5L\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"3MCShYvlGG13FT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"c0bgwNRHc1hb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"8rVXXPvSjq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"1mYgZTdMXjEFr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"1BU0NvR9znY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"25RZsOf8hGFvXv1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"G4puyRwXhwYb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"oTCSefzA16C9GyK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"ucAfevQ7un3skv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"m7blZm4d9e9S5JG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"4Rf6F1vO1ji0Nae\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"haIBi8Hehq1WH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"43l4bUbCKNHyAzA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"1oKiFdLDtmvuk00\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"2is88hki7X8UI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"h9DVbthtSNq6GY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"1ynCe0ILf22oNK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"55DUzZLrWIT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"XgWZRdYWQn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"EVHWg1nOMUB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"tNGWfoCfLZBVn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"kjZx58wIc4tA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"qAipG8EZkmw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"9arFZQ9ekoQOVp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"N7PT8Iwou7f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"WvDksvtMDA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"tcvszmQMQkFM2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"dBBbbZNzHuq9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"eVfdQ4qXbYCBkW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"oFSwSDTKZOe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"Gck3bUJBUFm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"wz9cr1dKCeLK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"UGzwjGwFap9GP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"e7o7aFaOUjdyo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"This\",\"logprobs\":[],\"obfuscation\":\"uiQDBDS2g1rR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" text\",\"logprobs\":[],\"obfuscation\":\"zRdIGbf4IBQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[],\"obfuscation\":\"2rmzkI1MAgARP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\" blue\",\"logprobs\":[],\"obfuscation\":\"dfcDFKfk8QK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"5G14QH7lJEyQo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"r2OPiRgHSt8Y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":96,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"aS8tEKmmikGJr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":97,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"X4wq7c60xxcdWYp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":98,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"Tuqr7URkNdYu2rh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":99,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"XJFRL8naii5rQm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":100,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"3A547Kdl2I2Etc\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":101,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @Jane Doe! How are you doing? This text is blue!
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":102,\"item_id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @Jane Doe! How are you doing? This text is blue!
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":103,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @Jane Doe! How are you doing? This text is blue!
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":104,\"response\":{\"id\":\"resp_68d4e799b1a08195bbd897d6e03c338201f8fa991c916030\",\"object\":\"response\",\"created_at\":1758783385,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e79a737081959d2fe6da19fd08ff01f8fa991c916030\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @Jane Doe! How are you doing? This text is blue!
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":98,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":822},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/styles + ic in source block, update text_1_350896c5ea1c2ae3930e8300d37eb670.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 + generateObject)/styles + ic in source block, update text_1_350896c5ea1c2ae3930e8300d37eb670.json
new file mode 100644
index 0000000000..6277ccd988
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in source block, update text_1_350896c5ea1c2ae3930e8300d37eb670.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"translate second block including the greeting to German (use dir instead of Ihnen)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7f0d1c0819082f51fd9a90ef0cc0ea62c79409e08b9\",\"object\":\"response\",\"created_at\":1758783472,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7f0d1c0819082f51fd9a90ef0cc0ea62c79409e08b9\",\"object\":\"response\",\"created_at\":1758783472,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ixkZfqqdCWFKf7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"9WZvqD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"R4WGb0qlhhg9o\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"lScu2AJ7HwdAau\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"RfAGDDDrSek0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Jx8VzI8adIWN4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"D1VZIZ9cxI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"aYmCcwiuSv7qw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"mCYTgJtIeQICbA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"oYmNjDQCuICXa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"iwiDmauAQo5aw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"47aT5SnEiKQWdxV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"DQgPj8gaf76LNs2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"xMF7GMrIvqFrw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"Yk68wsF2Q4J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"jMKxCGERK5H6e\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"8NM6aHG7wGnk4Ja\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"VeTtDhql1BJEwiS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"yACzSTvoX3nJ2xh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"rzNYN9o1Ams\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"4b8Xdsr3ybmGpKv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"N6l9Bo9pL5azyi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"TUpJ5w8Q8BrK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"bxxzYJfrvdp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"-inline\",\"logprobs\":[],\"obfuscation\":\"JXwos5gFS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"-content\",\"logprobs\":[],\"obfuscation\":\"s6RPsI4w\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"ArJvA8qs7Jf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"X0Ffa2j9ZsE93\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"mention\",\"logprobs\":[],\"obfuscation\":\"RumkKrEHn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"HJIwtYtS7Ae6Et\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"be4o5rxGr4X\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"-user\",\"logprobs\":[],\"obfuscation\":\"5QCDBrfswGm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"gxUASruzoyzF8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"3zO2iimLQMrG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"qhHpUckZT1cg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"2lSmIWpqfhUYq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"@\",\"logprobs\":[],\"obfuscation\":\"sj2moLXXa8WYKXS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"John\",\"logprobs\":[],\"obfuscation\":\"mf9aSHSmtMXG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" Doe\",\"logprobs\":[],\"obfuscation\":\"JezOir5PuBo2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"BsvY8PG49uGLE7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"3l8uSes4M5Ct\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"kRbRL6pwJt0FnEz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"R38nWhBTqZGNVxY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"LTdCmfMA1OTWxk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"VwtcF1p8OV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"E5sFXPhPX7R2OAs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"Wie\",\"logprobs\":[],\"obfuscation\":\"nRFeWBgPDpq3q\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" geht\",\"logprobs\":[],\"obfuscation\":\"Jt0DSBpGlhL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" es\",\"logprobs\":[],\"obfuscation\":\"SYErdhRNntKDW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" dir\",\"logprobs\":[],\"obfuscation\":\"XzRO4hoD3yd7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"?\",\"logprobs\":[],\"obfuscation\":\"QIuzD581NSw9E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"23JAsjIg2S\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"Hs6wM0xyNrTJh0c\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"zFFLUvtrX2z3lx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"3H694tshazlK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":59,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"25j3dV7mMV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":60,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"CwOBQVFGRhGFr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":61,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"color\",\"logprobs\":[],\"obfuscation\":\"UiAdOyhZMdW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":62,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"KhNPFgIxuE76de1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":63,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" rgb\",\"logprobs\":[],\"obfuscation\":\"3DP15MQedUrP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":64,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"(\",\"logprobs\":[],\"obfuscation\":\"TcIA34HCuZTfudL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":65,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"11\",\"logprobs\":[],\"obfuscation\":\"dlcXsyXMMb19O8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":66,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"dmh12xMKRQd6hNC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":67,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"DWbW2hBcCj4C4v6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":68,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"110\",\"logprobs\":[],\"obfuscation\":\"Bc57OdqTKmLra\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":69,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"57qVsHLnBYKtgRv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":70,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" \",\"logprobs\":[],\"obfuscation\":\"KntpxV8oSectUoE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":71,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"153\",\"logprobs\":[],\"obfuscation\":\"yzr0VLMcq42eA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":72,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\");\",\"logprobs\":[],\"obfuscation\":\"lEGovmvRGz0B3P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":73,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"Di7FKJapWmc3fK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":74,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"X77IaOPFRe7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":75,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"-style\",\"logprobs\":[],\"obfuscation\":\"RQSydYztNs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":76,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"-type\",\"logprobs\":[],\"obfuscation\":\"8Fx1suKmyEw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":77,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"2CqzFJjsxIGSs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":78,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"kxjneEUFHv4T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":79,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"Color\",\"logprobs\":[],\"obfuscation\":\"8PFzJHkLYOy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":80,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"RjVg9TwlelTVIi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":81,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"klBopdWrsD1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":82,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"-value\",\"logprobs\":[],\"obfuscation\":\"ntYrF5xJ8z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":83,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"VAmOp2CCoEHH3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":84,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"blue\",\"logprobs\":[],\"obfuscation\":\"fzH80n0IIko2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":85,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"D3FbwrQwrUIUo0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":86,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" data\",\"logprobs\":[],\"obfuscation\":\"XE1LrZvGfEh\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":87,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"-edit\",\"logprobs\":[],\"obfuscation\":\"1dSV4YqEqus\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":88,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"able\",\"logprobs\":[],\"obfuscation\":\"S80TcGETVuGn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":89,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"78SO9UEQObvNA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":90,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"qnHIEMHCS4Bp4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":91,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"Dieser\",\"logprobs\":[],\"obfuscation\":\"f7cZ9hLN2Z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":92,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" Text\",\"logprobs\":[],\"obfuscation\":\"MUAbojeG6Yv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":93,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" ist\",\"logprobs\":[],\"obfuscation\":\"F704tD6ijKmY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":94,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\" blau\",\"logprobs\":[],\"obfuscation\":\"d28gqzpFfZy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":95,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"vllHQhkpvSuZG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":96,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"span\",\"logprobs\":[],\"obfuscation\":\"0z7397nHnNd4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":97,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"0SY4p1AsAEECI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":98,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"5W8jsDGh3PqXz1x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":99,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"1Og89RU7xtL0P85\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":100,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"Vt473ezaYkDPCv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":101,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"FaHl4KrTtiAemD\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":102,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":103,\"item_id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":104,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":105,\"response\":{\"id\":\"resp_68d4e7f0d1c0819082f51fd9a90ef0cc0ea62c79409e08b9\",\"object\":\"response\",\"created_at\":1758783472,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7f17af88190b6a07ddeada9c0e50ea62c79409e08b9\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":733,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":99,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":832},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/styles + ic in target block, add mark (paragraph)_1_da57da0afcca08a77da5df430ef1db17.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 + generateObject)/styles + ic in target block, add mark (paragraph)_1_da57da0afcca08a77da5df430ef1db17.json
new file mode 100644
index 0000000000..8422543569
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (paragraph)_1_da57da0afcca08a77da5df430ef1db17.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make first paragraph bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7e52110819384f69299e73f9bfd0dac84cf906003b0\",\"object\":\"response\",\"created_at\":1758783461,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7e52110819384f69299e73f9bfd0dac84cf906003b0\",\"object\":\"response\",\"created_at\":1758783461,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"P0u1nI8qIJyrUv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"JF4IPr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"jK2KxqpjJvRYq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"vbS8S6HmY2tgHl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"M1Pta75DotGM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"SCHwsLPXGVNrH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"XxUSzWiyAT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"f4u1Q5umY6GRF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"7cQnk28MNmMMcZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"sZeOtnu3hffcO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"FDIrTxpTXAF2f\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"9X9Jzcal4qKTllv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"zZjeBwQcCsCrQvo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"NKvezm2zkNe01\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"Xqeewfnx7mw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"c5W2FrmXspraG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"WCcC9FrzfVBXaN1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"GFEyPpzG50lRGwa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"ceAcTBZpT8GcsL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"lZIpycxjLd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"qaDrDcbB7d\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"QdGveVaFppwBv97\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"JzXJr11cEx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"WFLs1yNrucOVq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"WjvrCvn4Jm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"Zlrrp7KTmXoEq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"hS2S3jUHeN8u0Kw\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"YMEOng25cfL49T0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"6mhKZJylAyOvAm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"7NadnKoR7QlcTB\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68d4e7e52110819384f69299e73f9bfd0dac84cf906003b0\",\"object\":\"response\",\"created_at\":1758783461,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7e5ab8c819385f0758358335c910dac84cf906003b0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":722,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":753},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/styles + ic in target block, add mark (word)_1_717f43f6e3302767b191ed31d11b1dd6.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 + generateObject)/styles + ic in target block, add mark (word)_1_717f43f6e3302767b191ed31d11b1dd6.json
new file mode 100644
index 0000000000..6138853ffc
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/styles + ic in target block, add mark (word)_1_717f43f6e3302767b191ed31d11b1dd6.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make 'world!' (in the first block) bold\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7e407508193be4374c9d4da6c40049d6ff208ec87eb\",\"object\":\"response\",\"created_at\":1758783460,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7e407508193be4374c9d4da6c40049d6ff208ec87eb\",\"object\":\"response\",\"created_at\":1758783460,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"tFRth1I68LV0g9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"y3yoKe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"BkVypbIw1aIsQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"Gt3t4D0Bankndb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"w7LUUSok5QP1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"UwCLtfuzSUIiu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"Lu6Fa4ekR4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"B6Hlhs6trh5c3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"K4T9SqldFTdjYu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"xAu3bs8oALo6k\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"bSo9D7mCPylVJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"ZXCG0PNGAv2PVAb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ws874lBmcXyFoMU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"rwZ7PvZg5ym0j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"NySQlxHJjkZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"EIDLxHaBASzho\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"LHPU8SiVVYGMUym\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"K45h2iXpHvhBOtY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"zo1MOrpFdu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"MdyPlbQ0DtLpC4T\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\" <\",\"logprobs\":[],\"obfuscation\":\"WJW2ej98piywgr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"yrl9jMQtcc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"ZwXR9cP9XWo5Iz4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"world\",\"logprobs\":[],\"obfuscation\":\"LG0JvPAM2e8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"f9GOsuYzzqz0l\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"strong\",\"logprobs\":[],\"obfuscation\":\"f052XwJleW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"XSQdt56LodQQl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"4Nsq4bydIRSZeoK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"ho73HwEb7RjV3pe\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"gK9BYks14AfeD6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"u9hUHm8LF3kEmz\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d4e7e407508193be4374c9d4da6c40049d6ff208ec87eb\",\"object\":\"response\",\"created_at\":1758783460,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7e46bfc81939650430a38b1facd049d6ff208ec87eb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":729,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":761},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/translate selection_1_0e4c67cc4858f5dfe2f2004e598cdfbd.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 + generateObject)/translate selection_1_0e4c67cc4858f5dfe2f2004e598cdfbd.json
new file mode 100644
index 0000000000..6a78e2c6be
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_0e4c67cc4858f5dfe2f2004e598cdfbd.json
@@ -0,0 +1,15 @@
+{
+ "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 selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List 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.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello
\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"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\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7d5a58881908ffecad73ae2de660adfec9a450c2fd9\",\"object\":\"response\",\"created_at\":1758783445,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7d5a58881908ffecad73ae2de660adfec9a450c2fd9\",\"object\":\"response\",\"created_at\":1758783445,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"YQlgPLKPwEcNZR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"AIo1SK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"poxYVhSE4u21x\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"39IAGBq47Ehdx5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"jGQ8R5FtxTws\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OCSqY7Vqt37u0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"5eCXDodtAR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"h8fI58ufOv578\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"Z5jbRR8sW0UnJc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"U2i3O1PXa14UI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"kFFe8IeeHQVsg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"j407RS2WPNiJVvi\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"ixasDBVNN3Od45W\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"eDVCqyAkX9okx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"bqy9Qcsj4RW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"RxhANCiu10bny\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"6TbpMqoEKT7HrP7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"xKX7yBzPixKIhxA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"dXtHjBRoH8bEjk8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hallo\",\"logprobs\":[],\"obfuscation\":\"Ev77FklXZRP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"81cFNXGL61enkd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"Z2RLSzwLvGveqUO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"AKUN4ORNgPowdN2\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"OB2vYqSzS1YBbP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"bh6RKeB8yFSeMr\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hallo
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hallo
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hallo
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d4e7d5a58881908ffecad73ae2de660adfec9a450c2fd9\",\"object\":\"response\",\"created_at\":1758783445,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7d67f308190bf4404661ad7c7960adfec9a450c2fd9\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hallo
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":554,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":580},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/turn paragraphs into list_1_03c3d437686de6faba00429649340a81.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 + generateObject)/turn paragraphs into list_1_03c3d437686de6faba00429649340a81.json
new file mode 100644
index 0000000000..f350cd2ce0
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/turn paragraphs into list_1_03c3d437686de6faba00429649340a81.json
@@ -0,0 +1,15 @@
+{
+ "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 selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List 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.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Bananas
\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"block\\\":\\\"Apples
\\\"},{\\\"block\\\":\\\"Bananas
\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7a11fc881939b555b40d51714e6001649794958a829\",\"object\":\"response\",\"created_at\":1758783393,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7a11fc881939b555b40d51714e6001649794958a829\",\"object\":\"response\",\"created_at\":1758783393,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"FCBTfWUBZnew02\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"hXnLgG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"jaU0MBoHMuosV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"NksEgH7FiWeblU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"CZt7QAvXwOcV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"YEq6gzWLqs6ci\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"AhK0rDGizY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Gk28OP2LAqXpy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"aeVhvKzldOsFP9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ZEsxXdKrNkiPF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"Wz3xgshRbxAza\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"2\",\"logprobs\":[],\"obfuscation\":\"5EvAiYo256pKSmn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"aogm6pNDk3kRAyD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"VP5f1YYoWbApF\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"yvC8k1govAN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"tLCvdOtx4rElk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"zF9owP7ZfRyEox6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"LCw3RfmLMZm01z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"T0YaKDkGKUUUrQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"XJuOgIdwTukblg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"TYzQ9RQRlN1rDsJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ap\",\"logprobs\":[],\"obfuscation\":\"ETASS0Ih1whBgM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"ples\",\"logprobs\":[],\"obfuscation\":\"DZ00dxr08bD3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"2cDUxreFiR0Jcp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"5Xv8ObugC2Dwwk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"J241yY7WbnBtl\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"bM4jgxqZ3OG9bo\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\">\\\"\",\"logprobs\":[],\"obfuscation\":\"iA3yXGIqo8o9li\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"},{\\\"\",\"logprobs\":[],\"obfuscation\":\"uD0nRufHKxWS\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"16sgcBvEtXYk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"MCSsKrQjjBSiW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"b6mQ9Oq4MJ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"n4X0e39S6Nflt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"oVQLPvcxQFR82z\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"ip8NgiUqgBpz6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"TjlBsSTiBqsIv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"3\",\"logprobs\":[],\"obfuscation\":\"DUK5BXIGMG1aX7O\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":41,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"6pPy9g3x5dNfs1u\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":42,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"GuFMeVb3HEbct\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":43,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"NrIx8BK3lJs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":44,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"1OUD6G0cHWbbY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":45,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"AdkIWSYI54gz1ow\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":46,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"T36nmfSSGjQm0t\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":47,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"><\",\"logprobs\":[],\"obfuscation\":\"Js4DLNDBicFPMb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":48,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"0ShacPmn08v0W5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":49,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"SgeDir863N7g1K0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":50,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"Ban\",\"logprobs\":[],\"obfuscation\":\"j23Qc90F7BEqm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":51,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"anas\",\"logprobs\":[],\"obfuscation\":\"5p503FHR7kGW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":52,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\",\"logprobs\":[],\"obfuscation\":\"RstCWFpVvdk4ZB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":53,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"li\",\"logprobs\":[],\"obfuscation\":\"2VFDf1ESJBP0Az\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":54,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"fY8rhae8dTemj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":55,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"ul\",\"logprobs\":[],\"obfuscation\":\"AzlSLPRvJJoKbV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":56,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"j1ACoqHV4qreAc0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":57,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"qPd2KNE4chyxOf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":58,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"JGMHYAxhsqNMwK\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":59,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"- Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"- Bananas
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":60,\"item_id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"- Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"- Bananas
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":61,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"- Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"- Bananas
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":62,\"response\":{\"id\":\"resp_68d4e7a11fc881939b555b40d51714e6001649794958a829\",\"object\":\"response\",\"created_at\":1758783393,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7a1a0c48193b58e9eb4ec85f705001649794958a829\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"- Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"- Bananas
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":474,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":530},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/update block prop and content_1_dd58f52c343818059aa71a9676a172d2.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 + generateObject)/update block prop and content_1_dd58f52c343818059aa71a9676a172d2.json
new file mode 100644
index 0000000000..5ec2e85fc8
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop and content_1_dd58f52c343818059aa71a9676a172d2.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph right aligned and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7da6d9481958fd70d3fd7553658017f6d461e01eb0b\",\"object\":\"response\",\"created_at\":1758783450,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7da6d9481958fd70d3fd7553658017f6d461e01eb0b\",\"object\":\"response\",\"created_at\":1758783450,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"O72kbULtdzs9OU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"Sgkgyn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"0Bxjqzo2Blp9m\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"ET0CfDpVsTTpc6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"04itR1deuzLp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"fspcR4kopVFhs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"QKk1BAtSJ0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"JfK6ejBEhMoG7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"cGu146fQmbhxcL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"LHTtE4qJRqePb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"pTEblhR5G01UW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"9A1t4o7mDnAVEHD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"S6FYAJd8hxva9uG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"G7gjGgkwQn6Qy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"LohBLSbwb3P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"Vdp06nIhgmSD3\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"VEY0cPMfyr9She1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"EjZflitkAW5tSPd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"c0e7jEix9G\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"rOzFeL5qmaBJO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"wtc5kDI2ZPF8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"-align\",\"logprobs\":[],\"obfuscation\":\"J8DEA31mGG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"7QFzV3kAVgxsa4r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\" right\",\"logprobs\":[],\"obfuscation\":\"XiWxxYatcn\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\";\",\"logprobs\":[],\"obfuscation\":\"aCzbIMeRqR7JYkO\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"LkGeuQ9hn7Xyr\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"What's\",\"logprobs\":[],\"obfuscation\":\"MVMDO034Ud\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\" up\",\"logprobs\":[],\"obfuscation\":\"SRvvP0gpLcnkL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"SH6rFAbEU4xBolt\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"7ooQZDUSuR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"CiIryUMchEOP1\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"g2mTsFhiUXlg52y\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"Gbhh4i91DUyqKNf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"I69XPtfRfuFRXv\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"tuIPpXuZC3g6Wn\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":40,\"item_id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":41,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":42,\"response\":{\"id\":\"resp_68d4e7da6d9481958fd70d3fd7553658017f6d461e01eb0b\",\"object\":\"response\",\"created_at\":1758783450,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7db1dd0819588d783aaa1784060017f6d461e01eb0b\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":735,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":36,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":771},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/update block prop_1_a4f7c3617705406313b619c566afef36.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 + generateObject)/update block prop_1_a4f7c3617705406313b619c566afef36.json
new file mode 100644
index 0000000000..c8c01f7bf0
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block prop_1_a4f7c3617705406313b619c566afef36.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph right aligned\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7d7ed688197903bc1cb148646e60c09bf3925c646c0\",\"object\":\"response\",\"created_at\":1758783448,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7d7ed688197903bc1cb148646e60c09bf3925c646c0\",\"object\":\"response\",\"created_at\":1758783448,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"dA8Ge2064GIE7P\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"02sMAR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"PX8g0IUa5fDza\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"C7bKytEl2G09sf\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"oYFTu4IF6M6b\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"tIK96rXcVV4TT\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"QaAKjhSGAW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"eFQCNcbkb8ts0\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"HIW3Yp7dspJCvg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"yX7xSmFS3vuOC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"ivLfuT4awhepq\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"3wVhrIXMRSZtk9H\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"N9p95CP5roqOaRN\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"4WwfBOMPDWyoA\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"PXXAVWWYV3J\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"OhtxZM4dsKdFB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"GqUCY3zGwMF9QUy\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"ck7apSTkTqCX1yu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\" style\",\"logprobs\":[],\"obfuscation\":\"whRlV2HoId\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"=\\\\\\\"\",\"logprobs\":[],\"obfuscation\":\"l6yjK6QtArPrB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"text\",\"logprobs\":[],\"obfuscation\":\"acayF5ZELPFz\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"-align\",\"logprobs\":[],\"obfuscation\":\"BgtQIbxQlE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\":\",\"logprobs\":[],\"obfuscation\":\"5aRLZX2q9EMmqMu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\" right\",\"logprobs\":[],\"obfuscation\":\"TbqRUJNtaB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\";\",\"logprobs\":[],\"obfuscation\":\"B3qojaHJdsFBuic\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\\\\\">\",\"logprobs\":[],\"obfuscation\":\"yzIxBpnJdpIyp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"Hello\",\"logprobs\":[],\"obfuscation\":\"5hlwSCnoczP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"u4jONrCrMvH3JTs\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"3OzQIxRSeV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"sQtvQdKhlxwwI\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"p\",\"logprobs\":[],\"obfuscation\":\"JzJIKVKkvwi5o9C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"fSr7qXtu3wM3C7h\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":36,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"ct7eAvNme8ETLK\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":37,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"DxxXjlzl7ZUYeX\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":38,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":39,\"item_id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":40,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":41,\"response\":{\"id\":\"resp_68d4e7d7ed688197903bc1cb148646e60c09bf3925c646c0\",\"object\":\"response\",\"created_at\":1758783448,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7d85a088197b32cbd23aa5cb50e0c09bf3925c646c0\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":35,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":759},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/update block type and content_1_9b630368d36a8a4420b20bd1e82e455d.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 + generateObject)/update block type and content_1_9b630368d36a8a4420b20bd1e82e455d.json
new file mode 100644
index 0000000000..f5315a9b75
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type and content_1_9b630368d36a8a4420b20bd1e82e455d.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading and update the content to 'What's up, world!'\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7d94cd88193994024827f80e0e30193d8dfaaaa64eb\",\"object\":\"response\",\"created_at\":1758783449,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7d94cd88193994024827f80e0e30193d8dfaaaa64eb\",\"object\":\"response\",\"created_at\":1758783449,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"JaPHwKWdZiLGsB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"7qtQyp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"no9WCoWRQSMCB\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"LRGDJyc4BHba1r\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"Mwp7JiwUkI0j\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"YdNygHqJPHoIG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"IdWjLAIaGH\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Pm7CjjsBgCMsD\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"xdW7t3lgXe4uVp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"PxX5aeYaKtnlc\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"JXrKpzZEPL08E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"RuxiCI0Y9mEyeDX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"hxytsvmCpPesKet\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"3ceC3oo22XeYY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"bxSISuobjZP\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"hXHMxyB056Ddu\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"T27vXbQC6fLKKDx\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"HBzjfbvPvDDRGsL\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"Rxgzr74zqGonAlM\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"WNahizdnmjLb7rj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"What's\",\"logprobs\":[],\"obfuscation\":\"Z6lvdcEHFp\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\" up\",\"logprobs\":[],\"obfuscation\":\"FlBZxXygErVxd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"5xQyTYx94GLFeiV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"QBJyuKzhkU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"S6IvXkcqPbC2a\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"yr9BfIfTMD9iHmY\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"QUVSwrWlsScC04E\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"8UDfGgGChiMQ6I5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"7g64n49vrKkChU\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"ej2w1lU1hqsLkl\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":37,\"response\":{\"id\":\"resp_68d4e7d94cd88193994024827f80e0e30193d8dfaaaa64eb\",\"object\":\"response\",\"created_at\":1758783449,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e7d9b0f8819391e38546040fb3820193d8dfaaaa64eb\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":735,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":766},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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 + generateObject)/update block type_1_5da70d5932f66c0ba6f5b15bbb05f68e.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 + generateObject)/update block type_1_5da70d5932f66c0ba6f5b15bbb05f68e.json
new file mode 100644
index 0000000000..574c51e753
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/update block type_1_5da70d5932f66c0ba6f5b15bbb05f68e.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph a heading\"}]}],\"text\":{\"format\":{\"type\":\"json_schema\",\"strict\":false,\"name\":\"response\",\"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\"]}}},\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e815a4b48195a51d7f2b7f49bf6c030f7edaa340d14a\",\"object\":\"response\",\"created_at\":1758783509,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e815a4b48195a51d7f2b7f49bf6c030f7edaa340d14a\",\"object\":\"response\",\"created_at\":1758783509,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"VmDGwf4HSuzVva\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"operations\",\"logprobs\":[],\"obfuscation\":\"y8FRvC\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":[\",\"logprobs\":[],\"obfuscation\":\"3ogNdk6X3KbO8\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"{\\\"\",\"logprobs\":[],\"obfuscation\":\"gKeGPcPUQ87XK6\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"type\",\"logprobs\":[],\"obfuscation\":\"zu7sf1lV84ZV\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":9,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"WvL9F8VV5pvgZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":10,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"update\",\"logprobs\":[],\"obfuscation\":\"n9diDqxIBg\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":11,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"y3cPQoEBomlNj\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":12,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"id\",\"logprobs\":[],\"obfuscation\":\"IqgKVO9QXxXZLQ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":13,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"97skeqZP6wquR\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":14,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"ref\",\"logprobs\":[],\"obfuscation\":\"YEY5Bsh8r4HE5\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":15,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"vGq1xxkra6MWSQa\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":16,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"$\",\"logprobs\":[],\"obfuscation\":\"RZQOlpXmQGojNI4\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":17,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\",\\\"\",\"logprobs\":[],\"obfuscation\":\"Q5Wm4GT5hshun\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":18,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"block\",\"logprobs\":[],\"obfuscation\":\"H4C1xoLA3nk\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":19,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\":\\\"\",\"logprobs\":[],\"obfuscation\":\"mEaJZJNbTNgDZ\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":20,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"<\",\"logprobs\":[],\"obfuscation\":\"NG1IQE3GGseOJUE\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":21,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"vcBhGdvI2LG4pX7\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":22,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"ulJcH3ESu3docNG\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":23,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\">Hello\",\"logprobs\":[],\"obfuscation\":\"nHbeoSJwrb\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":24,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\",\",\"logprobs\":[],\"obfuscation\":\"UJssklW2U77FX2v\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":25,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\" world\",\"logprobs\":[],\"obfuscation\":\"rwSgLSYpYd\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":26,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"!\",\"logprobs\":[],\"obfuscation\":\"xv2ku5DaeT8yW\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":27,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"h\",\"logprobs\":[],\"obfuscation\":\"ETkeGIbeEQVhhI9\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":28,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"1\",\"logprobs\":[],\"obfuscation\":\"CD3XXoCwFYMmftm\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":29,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\">\",\"logprobs\":[],\"obfuscation\":\"W2yJSwhq6FRwxRX\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"\\\"}\",\"logprobs\":[],\"obfuscation\":\"cjKvqvAJXKfx3C\"}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"delta\":\"]}\",\"logprobs\":[],\"obfuscation\":\"WIBLGx16kMRuO5\"}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":32,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":33,\"item_id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"}],\"role\":\"assistant\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68d4e815a4b48195a51d7f2b7f49bf6c030f7edaa340d14a\",\"object\":\"response\",\"created_at\":1758783509,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"msg_68d4e81613148195bfc8c32f917d82d2030f7edaa340d14a\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"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\"]},\"strict\":false},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":724,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":29,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":753},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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)/clear block formatting_1_ec9d93709e473574521d55108aa27f8f.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)/clear block formatting_1_ec9d93709e473574521d55108aa27f8f.json
new file mode 100644
index 0000000000..7bd27b670a
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/clear block formatting_1_ec9d93709e473574521d55108aa27f8f.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Colored text
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Aligned text
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"clear the formatting (colors and alignment)\"}]}],\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7c97e508194915bb3eff6990b9b079ee81e68f75c1e\",\"object\":\"response\",\"created_at\":1758783433,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7c97e508194915bb3eff6990b9b079ee81e68f75c1e\",\"object\":\"response\",\"created_at\":1758783433,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_7uYUcjheTbm5Mzc14xd3ToSY\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"DOYXNazHwvpzVN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"FVSfJh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"RR2TLrdsHZbx4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"QbMl7G3yy61F20\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"Lz0Qj8TwrXDl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"MsU9bMNGzUMMT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"HY1omQstWa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"1fB8t9J5hfOW4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"TIagU2czrszEP4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"WXZmpbnLF63bi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"mqDYtk2JVAgrU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"OtopZzIZRas3fBY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"WCzEICgMmxEF0o7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"WbNP4nob2zIYG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"7qUEG3aBKzh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"z9ETyashbS0sz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"lU596hUHW3aWsyV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"bqvngTE7NYRBIsV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"sBMHSpplCOKnvRY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"Colored\",\"obfuscation\":\"e6p8d3d25\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"D515wasGoFB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"ARACVmnRgWC1Iz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"p5QyyHgAphg4FwA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\">\\\"\",\"obfuscation\":\"Tabz8rgYyjUu3K\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"},{\\\"\",\"obfuscation\":\"3iT2XbB9HjCv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"P7iGsRuin2tL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"nD1rgvZMjs2oa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"DaQLON8POm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"0vjdtTVK3JFu7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"wQIOaC4iyHt1oJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"I0jXNE6sGV2nn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"M65D2vENSHwnS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"7lfaW0xyABg9qxc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"xebQ5BPSezDzhUr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"rzBpoETrXRKj5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"zV4GjilHb4M\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"10gaxcsPqRJNS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"i10TOmXPL7hRMGf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"XcGio6W1G8Huk7a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"F1Ylrwl6cyhO95o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"Aligned\",\"obfuscation\":\"pbMyqrVlT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"qJqn3NQ4ZdG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"3dImYgBvjpKykk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"tzOciqh4Fc9vbfb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"OEbTTCx7tHt7JUy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"26M1Sb0kMwzxz7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"Fe1niifp4GJQU8\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":50,\"item_id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Colored text
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Aligned text
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":51,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Colored text
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Aligned text
\\\"}]}\",\"call_id\":\"call_7uYUcjheTbm5Mzc14xd3ToSY\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":52,\"response\":{\"id\":\"resp_68d4e7c97e508194915bb3eff6990b9b079ee81e68f75c1e\",\"object\":\"response\",\"created_at\":1758783433,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7ca0a14819489bdd6dae452bf5d079ee81e68f75c1e\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Colored text
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Aligned text
\\\"}]}\",\"call_id\":\"call_7uYUcjheTbm5Mzc14xd3ToSY\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":576,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":48,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":624},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_6b7b58db82605ee0f2fe5146738274dd.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_6b7b58db82605ee0f2fe5146738274dd.json
new file mode 100644
index 0000000000..8779859b4b
--- /dev/null
+++ 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_6b7b58db82605ee0f2fe5146738274dd.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7c416e081959e065d60afcdf69f0192aa29218205d7\",\"object\":\"response\",\"created_at\":1758783428,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7c416e081959e065d60afcdf69f0192aa29218205d7\",\"object\":\"response\",\"created_at\":1758783428,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_IhgKnZvAjlwVeWSLnl4heN5H\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"fQSLaVKeEqffQS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"RhYsKt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"fuy2BDKcNpAnF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"DhpNVmAqoMon8I\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"3ONC5naGbuAI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"NtelIhyiBKlSu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"aUnxISkBV7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"635ao6ZcS9tMJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"xSbdkpBbMowI3H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"ANZ14XufPD2Ch\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"O3vjBrju82HXd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"3\",\"obfuscation\":\"P2RqBa8mbboo0NX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"UxuxtTD7peZvDmp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Dd6HVf2bn5ges\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"3N34eMnNC2T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"1LYWrWvWlarq2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"T0vXsgdghlBwYTv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"BbELTbhK4vAfOyp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"WMyMEZKgiw4Zt8H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"Hi\",\"obfuscation\":\"GgC9UzSc7nbS5D\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"Wm2TZHDf8dUEAlv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"9luylSK8uo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"pRiIphKZUBtvXdr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\" Bold\",\"obfuscation\":\"olDN9XStYA5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\" the\",\"obfuscation\":\"s2BjYF30YnDC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"yzy1t1mh1qt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"jv09MrYnNFuafKN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\" Link\",\"obfuscation\":\"PGDXn3B4ceR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"pU2k7RnXq2ZZT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"RdGC6VTTfuzjdOl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"f8inSi8BTk4RCda\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"Nv6r1iLRbevXrN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"ONpadcgC1RVPd7\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hi, world! Bold the text. Link.
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hi, world! Bold the text. Link.
\\\"}]}\",\"call_id\":\"call_IhgKnZvAjlwVeWSLnl4heN5H\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d4e7c416e081959e065d60afcdf69f0192aa29218205d7\",\"object\":\"response\",\"created_at\":1758783428,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7c4b22881958d65144506382a0b0192aa29218205d7\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hi, world! Bold the text. Link.
\\\"}]}\",\"call_id\":\"call_IhgKnZvAjlwVeWSLnl4heN5H\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":678,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":712},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_4fa98468d00af0302fb35faba6aa2823.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_4fa98468d00af0302fb35faba6aa2823.json
new file mode 100644
index 0000000000..1736e61ce2
--- /dev/null
+++ 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_4fa98468d00af0302fb35faba6aa2823.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7c209788190b1c468619a2ba8b40b82d96a38c09de8\",\"object\":\"response\",\"created_at\":1758783426,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7c209788190b1c468619a2ba8b40b82d96a38c09de8\",\"object\":\"response\",\"created_at\":1758783426,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_zCzplkezxhGPMXxnJ8jy9ar4\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"wjYM8DNZ8SVOiS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"8pqizI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"6jt2AG6ssByiH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"koxSep2ucHZQ02\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"UgNbPPAzaXx5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"m8hkREmELvQDU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"pJAOmIM0cm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"2Y0gAlqGIr715\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"2wMWoYqHTCsue7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"7S5EGLC9T2Msi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"iT9XbhVl7EJsw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"3\",\"obfuscation\":\"EhvzoumZwu9O2GL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"AR6oKKi7lG7XuwX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"S8ItXIa9cZ0h7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"8n2L59MxHXx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"hDSqtEMm5LGGi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"m3NrnFKgEPUvpWs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"KKar4dpc4Ya9Mni\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"ARoLTIMjDZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"t3xE45gTyJCjgUn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"6fMpgCMaKj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"HHGO1rGonKb23aJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\" Bold\",\"obfuscation\":\"rmR5gQiN9wT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"VtjphqJ5HtG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"vXUFdBiuMgu55uf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\" Link\",\"obfuscation\":\"XMTVgQogqFu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\".\",\"obfuscation\":\"R7nO2H12Woggi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"hFPyyXKEaQBnAZl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"3gAhf8KyNJDGLBD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"bQjBKaKDxU1DPM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"iNaFMRfsG3vfOW\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! Bold text. Link.
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":35,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! Bold text. Link.
\\\"}]}\",\"call_id\":\"call_zCzplkezxhGPMXxnJ8jy9ar4\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":36,\"response\":{\"id\":\"resp_68d4e7c209788190b1c468619a2ba8b40b82d96a38c09de8\",\"object\":\"response\",\"created_at\":1758783426,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7c371b8819080aa156eb943c2540b82d96a38c09de8\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Hello, world! Bold text. Link.
\\\"}]}\",\"call_id\":\"call_zCzplkezxhGPMXxnJ8jy9ar4\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":672,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":704},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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)/modify nested content_1_e761f6071dd9550f02555f17668007d5.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)/modify nested content_1_e761f6071dd9550f02555f17668007d5.json
new file mode 100644
index 0000000000..894e0e6687
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify nested content_1_e761f6071dd9550f02555f17668007d5.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make apples uppercase\"}]}],\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7c6faec8194afb8e84a52706f6809453c9aa044804a\",\"object\":\"response\",\"created_at\":1758783431,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7c6faec8194afb8e84a52706f6809453c9aa044804a\",\"object\":\"response\",\"created_at\":1758783431,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_Yo8W1F9UTV4pBEAjkN6dVaN4\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"LzpT60ChydIkJm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"gSQmdP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"hikgGFA6Lcanb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"hIzEnhkvmYJwaH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"2bTQODMebGQy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"VSyDI51Jkuouh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"mF6PdY6mK2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"9hv3DdNUJjEdY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"6O5hkyZeynhs80\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"weVAF5D4marXd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"Deo5v1q4lClck\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"JmLjZwEu0XWAgz6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"fpZ2BL6RprOobkN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"UT2a9UYKIk2qL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"ciV9RW04g6C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"eD2eUMAs3h4dC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"nVftop0ZHI2yFxK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"1nCtR0GpLLpBZTT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"jfXJElfTNLgMexs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"APP\",\"obfuscation\":\"YTjXytjVxfD5E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"LES\",\"obfuscation\":\"D7z8pX74VeApQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"QsjOW1PBwluc9F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"veoQ8rYcQUSx7n3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"omz6nj6B1g77Hnn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"pS1IZTCgMHC3BD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"Xv9sYmBRDDkNSJ\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"APPLES
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":30,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"APPLES
\\\"}]}\",\"call_id\":\"call_Yo8W1F9UTV4pBEAjkN6dVaN4\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":31,\"response\":{\"id\":\"resp_68d4e7c6faec8194afb8e84a52706f6809453c9aa044804a\",\"object\":\"response\",\"created_at\":1758783431,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7c7896881948a656edae7e1b15209453c9aa044804a\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"APPLES
\\\"}]}\",\"call_id\":\"call_Yo8W1F9UTV4pBEAjkN6dVaN4\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":537,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":27,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":564},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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)/modify parent content_1_57bc2951494344f4cd0062fefce14e5f.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)/modify parent content_1_57bc2951494344f4cd0062fefce14e5f.json
new file mode 100644
index 0000000000..b9961a59e7
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/modify parent content_1_57bc2951494344f4cd0062fefce14e5f.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"cursor\\\":true},{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"}]\"},{\"role\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"make the first paragraph uppercase\"}]}],\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7c85de48197a314d6f4e02d1a31003fbc2ce4859621\",\"object\":\"response\",\"created_at\":1758783432,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7c85de48197a314d6f4e02d1a31003fbc2ce4859621\",\"object\":\"response\",\"created_at\":1758783432,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_2AD1IkbV4zg93r9k4mOSEMOB\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"BV8G0CKI9FnpY8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"CE4rm1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"yI1EUxenxYJks\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"752oXa3mxe9YIZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"qjYqNfQxazRz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"zr0tWLLKNAJj8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"LoAW6PjiRO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"O20cRWW4jePXz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"Vzk79WbbGLK0Ij\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"hiQcEiWAhH0MK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"7ZKM5qGb3QsbQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"6ioc5HJt9ABzXy7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"LqveK4x4gSjXQO9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"7EnlAVUNZ6wIy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"EHvwtpjAzCp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"c3kWcnsvZk2AH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"hQwIEW6muQtEJSz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"ESgltTrdB4JaRjR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\">I\",\"obfuscation\":\"6KHmoVVaP3urru\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\" NEED\",\"obfuscation\":\"SPbZVTJry5u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\" TO\",\"obfuscation\":\"AXwOQ5TENLuIw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\" BUY\",\"obfuscation\":\"6m1f8tPPwkF3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"ju0PqyN2UebTO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"PbSaEafcJIGiQGl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"ijnM3vnoK0wNyWd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"nN6fp0CqMn8In2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"LXlSxvoasj8D2P\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I NEED TO BUY:
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I NEED TO BUY:
\\\"}]}\",\"call_id\":\"call_2AD1IkbV4zg93r9k4mOSEMOB\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d4e7c85de48197a314d6f4e02d1a31003fbc2ce4859621\",\"object\":\"response\",\"created_at\":1758783432,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7c8e2d48197a90b912f29809c22003fbc2ce4859621\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"I NEED TO BUY:
\\\"}]}\",\"call_id\":\"call_2AD1IkbV4zg93r9k4mOSEMOB\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":539,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":567},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_88263a5a62758f9c809abbab15d1c4c7.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_88263a5a62758f9c809abbab15d1c4c7.json
new file mode 100644
index 0000000000..846fa19198
--- /dev/null
+++ 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_88263a5a62758f9c809abbab15d1c4c7.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7c04c5c819680d658e91411061d0c034431db0f47e4\",\"object\":\"response\",\"created_at\":1758783424,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7c04c5c819680d658e91411061d0c034431db0f47e4\",\"object\":\"response\",\"created_at\":1758783424,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_qPN1zoeuhw9ZcTWtMsxkfPlm\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"n0uKm761ELuwAu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"Nb3Cmn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"TfqyHLL5nmcux\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"IF3nJHQe3F0Ngw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"y510XEVW0KlU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"LlR0PGGEtZ2iq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"NHfrj9mUkj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"WZgMdgjAKHK9u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"ZHlbCsDFLO80jn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"yY1fbVFVpaxR5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"QK8WYIPleZhtW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"zAkR3buewZPBPIY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"aCkXlvbrtphv9jP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"9SSzsjVCVr0cd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"E6pPjAOV1ij\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"XnUcuke4RhEKW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"YCm5cQo9mpAyEsL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"es3rb4Z5dBpm2hk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"J3WsViohRm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"sy4BWX9UQygJWRC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"uga6WoPtFDLhR6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"emyVot4CZfcD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"HPAhRMM7agc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"HgHHD6TuB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"CoVsOmnS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"RI0nVgFvgwm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"SL8FOqtiamGIr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"6fJd88VMT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"UZOJXqSh3skAKA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"oXMawxDAUdw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"C4tOQ4y2vwq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"znalHhWpu35k5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"gyRAiHOmi2ps\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"m4PxrQ0ytN0s\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"1IjQtM4medADJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"3sV4FeSfsqEZC8r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"mVyY8y1ulldT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"bxrCOgqxvmxi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"wRFYXfQYmZjp7Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"YyiUMg2eGnMP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"flYZ7DQGveh9xUH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"P2a8iJ6pSo1kp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"i48MwN78GqJliOM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"KrpICgg4WPExQ7W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"rowbCNBx74C3gz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"suPo7Ndj70bAFA\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":49,\"item_id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, @Jane Doe!
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":50,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, @Jane Doe!
\\\"}]}\",\"call_id\":\"call_qPN1zoeuhw9ZcTWtMsxkfPlm\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":51,\"response\":{\"id\":\"resp_68d4e7c04c5c819680d658e91411061d0c034431db0f47e4\",\"object\":\"response\",\"created_at\":1758783424,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7c0c64c81968efd832ee8c1b0790c034431db0f47e4\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, @Jane Doe!
\\\"}]}\",\"call_id\":\"call_qPN1zoeuhw9ZcTWtMsxkfPlm\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":670,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":47,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":717},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_a68854dc4dee1520292cf8b8816d3bf1.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_a68854dc4dee1520292cf8b8816d3bf1.json
new file mode 100644
index 0000000000..1e12a16314
--- /dev/null
+++ 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_a68854dc4dee1520292cf8b8816d3bf1.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7b354c881979ef8ba1427829913045290fddb9c0443\",\"object\":\"response\",\"created_at\":1758783411,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7b354c881979ef8ba1427829913045290fddb9c0443\",\"object\":\"response\",\"created_at\":1758783411,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_wRLPVRNMYhaMq4eZreukSoe0\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"iEkemn1316OPGu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"P4ZQ6n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"VHJNZYtgLdmbu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"87yefTLR0fdw91\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"nSyuKPsn6hpV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"I77AdV05NijRu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"dSWTOWFOoP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"mIQhiX001ajTc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"XOzkTNeUrhsRzi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"PdwbFmTGV4z47\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"h5qI0qCpcqaPH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"zprLFlUrmgranBl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"rXwA8OaD831IMFo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"VoEUEbuD8L3yC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"WgDyb14RIsq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"D0PE5RXY5Ncm5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"2GoRVYwgB6bgZjc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"ZhNWr11ucaUSHih\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"QKvaUZ4cJzoN14J\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"iHicBCshSyy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"Ck0WhUbFvBsxuDl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\" Welt\",\"obfuscation\":\"crdbrhQnckO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"c54AItgi1LsHe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"f3bb0i7su1onUSz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"oBXbM3SsGR2vbRH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"4ARd2aVZjXahXB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"4fk2EFvjmtestl\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hallo, Welt!
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hallo, Welt!
\\\"}]}\",\"call_id\":\"call_wRLPVRNMYhaMq4eZreukSoe0\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d4e7b354c881979ef8ba1427829913045290fddb9c0443\",\"object\":\"response\",\"created_at\":1758783411,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7b3ea188197b8617275fa2e4d87045290fddb9c0443\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hallo, Welt!
\\\"}]}\",\"call_id\":\"call_wRLPVRNMYhaMq4eZreukSoe0\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":661,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":689},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_44bcd73901e9f2eef1a454db1dd3a05d.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_44bcd73901e9f2eef1a454db1dd3a05d.json
new file mode 100644
index 0000000000..962c9f22a3
--- /dev/null
+++ 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_44bcd73901e9f2eef1a454db1dd3a05d.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7bb11ec8197a6901dfcfc41013107331ba6cbe1f886\",\"object\":\"response\",\"created_at\":1758783419,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7bb11ec8197a6901dfcfc41013107331ba6cbe1f886\",\"object\":\"response\",\"created_at\":1758783419,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_mYohfXrIeAqjilUmF2pp5Llr\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"5pisvt0VwF0mvr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"7uJZF0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"AqxEWFHqdtf6a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"10IalYfxQadqEF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"J1xUtbzxc7QE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"EGCIBcgE2jk8D\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"4nVyDtb3LL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"1JqY0gK8G0SK6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"Y7dlV76LOzTVWR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"SQuBlE00fEBH5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"fhhV9hcTJmGmC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"S1SRNFXABb8N8v3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"g5gGqcoFPBu6M5D\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Dyrbr9eYedwdr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"56vBrPMQ2yN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"ySbxQYRVxwVUw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"aKLuwQWiPDFdX1G\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"JAVx487aqGyy66B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"kzZRMz1h1L\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"IiVHHNmpF69ZnaN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"aBoLs7X8O43ua1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"igCCqi317Zdj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"HnikedEJhm8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"whNP7H6c3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"DcgfrqeO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"MTruE5UbPQe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"L45K4Xdq8fJsx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"m1Up5L8pp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"h64O4UypkC0yJ5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"jb7F1IeirEU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"7qs2uSgMNuH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"sZq77doFEWoE9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"jz7hf7WfCV7n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"TPWlJn0actS9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"QEkwk3CRKzBIr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"NN26CPyzcqea3Pl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"9MPNyU8KTv6W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"HZKcMk1qj7fF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"fLkylWU76IpY7Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"Vcg8qhdaYYRT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"Ez0evKk3CJ9AwMb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"03WcKJLuXUQersJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" How\",\"obfuscation\":\"3UMfCmBBLcZ8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"2EG3bPvr2tbM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"BZ25WfGLHcvB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" doing\",\"obfuscation\":\"aF4FTnlMWO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"PD0SZJ1ymLi3lp2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"3UX9GLjVGFYUF5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"ybXD1Dkw2gyD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"yK0axdx2YO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"aFfzEe9M25aJZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"1c7L7OBmIKb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"q3TQGQAdG8Gae9W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"EjdRq07bdv1O\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"PUgPlUCGcbJhmO7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"EzN541gaq3n10u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"lTqmJG1HrN6aVjH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"4YtqmlxESSVimkf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"Rc4mEtEXjcYDU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"5MtzPBjBeXPTwrz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"9OH2psi9ceX9sO2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"CRCR3EtwgzJEK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"1aC58vX9dC2pNW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"jMpvlJ1Yxx7FWW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"oZR969F6v8X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"URgqgkge3s\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"UefdaXH2oTi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"imZkbzOC7hi9h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"UpLBBX0hILwL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"n7aBX7I8YMd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"QtvjwRlVmD7d4o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"Qhj4FopXiZh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"8kNFx3roNo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"sWnsKtbK9147m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"1wBzW1EBauJz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"IQM7Tr3IzYEY9r\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"83k4u4SJXWd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"Zfetv7JJjir\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"Xe1GI4V0RoPM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"idfhMV4x1lgrL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"Ze1XVr1pvhluZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"This\",\"obfuscation\":\"eetdNgHQ7qQ3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"ZzjTXtIAulR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" is\",\"obfuscation\":\"26DSfoOBrmMwo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\" blue\",\"obfuscation\":\"rAMmrFLLA8s\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"NSpu9tcVAFYuG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":89,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"nfqZq51AOMBq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":90,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"dDneuSztaujOK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":91,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"BCxTdipv2jLieIN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":92,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"bXAms6GInakBuK6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"ZKhmE9qaD4GQJN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":94,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"s2aOHjevmEaRs6\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":95,\"item_id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How are you doing? This text is blue!
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":96,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How are you doing? This text is blue!
\\\"}]}\",\"call_id\":\"call_mYohfXrIeAqjilUmF2pp5Llr\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":97,\"response\":{\"id\":\"resp_68d4e7bb11ec8197a6901dfcfc41013107331ba6cbe1f886\",\"object\":\"response\",\"created_at\":1758783419,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7bb7bd481979aeec2fc5cc203e707331ba6cbe1f886\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @John Doe! How are you doing? This text is blue!
\\\"}]}\",\"call_id\":\"call_mYohfXrIeAqjilUmF2pp5Llr\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":663,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":93,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":756},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_89aa084ced0d3526355fa9ec0a7a0f38.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_89aa084ced0d3526355fa9ec0a7a0f38.json
new file mode 100644
index 0000000000..c0dbb1fb30
--- /dev/null
+++ 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_89aa084ced0d3526355fa9ec0a7a0f38.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7bc70088193b0c7b94085ac96ac038b51f9cc5aa4c2\",\"object\":\"response\",\"created_at\":1758783420,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7bc70088193b0c7b94085ac96ac038b51f9cc5aa4c2\",\"object\":\"response\",\"created_at\":1758783420,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_UjIZ7oJt4qu2StEaIfFMmtEa\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"T8Ftwdvjx8vSDx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"8O6PFr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"23AoyOE00IIl9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"r5VWrVWXexy79v\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"jLBYn9g4pvMh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"tFiGh6ZGLKddo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"FRRVEvptPO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"FDencZqXQzguz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"ZX14hVjvcyAeBG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"dZ1f0fIAbUxGM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"iSw6R9fTOV1C2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"yrEC4As9esZQqbN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"LdI4oXXII4c18Ol\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"hr1hqsrVGeqyq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"Z4KpWwnFAcE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"WaC2qTaXezBdp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"mKSvw4bwnp5go0e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"4Rbs3aRvL6yQ16y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"TezRkphpQc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"dfcEfSULXtrXb48\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"rPlc5j4YS4Semz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"N5A6qIzRcm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"Tos14cDXNrkYbSZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"How\",\"obfuscation\":\"TKlKfCr9qGwx8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"tDpzZOWPHBwO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"B0oZHHbm61Uq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" doing\",\"obfuscation\":\"cu1LQoKMF2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"O58Jo0QctA18m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"UJaq4BvNfM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"cZ0vpjuzz3JsmDQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"mPEdtRsiGOyr1H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"2USYOOWuxgNF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"IxclJ2cbbT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"LWzRRBezPGaGv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"dUNLOsLJT2O\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"uEfQznk328HBj7x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"KJb9uawGKwkM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"a9Bl0IeQ0cG6bhu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"ESDgWJZnNkDlHU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"4Y33UL0nlSdWSb4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"S16FXFMNRbPzPOj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"N0BmT6kaW4glz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"jHElqFVpLYP9f1c\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"KhvNV7zBDe1peFc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"KPKIkelSZ2GnR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"miwveyMwb51ocP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"dTuauCpvC1sJKs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"C1rn9gxup9t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"RT1KH01SlX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"E4duOpOvm7x\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"GLz7qwUSpcUH5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"rPjyoUtYDcU2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"vpFdyaTHktb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"YV5XKsfV0p1f8e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"kWln6rYlxcP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"GC9BpW9swK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"sIXrvZDf9rv1C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"U2aDf5pAFz8p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"rNOQmiCftZmgI7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"HOkJijIQPoy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"w8pQ2WQVr1o\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"OVsYfLT5aOLz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"6Ggjc3KitiDjQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"pY2dgEQt8RDM5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"This\",\"obfuscation\":\"zP6TTYWJEEZE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"lzoRPh80BbO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" is\",\"obfuscation\":\"Mvvp9ldBv0l8F\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\" blue\",\"obfuscation\":\"cHrOPwtgVkN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"POp80d9HSbARR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"9IRnsIEuGZfz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"8djznA2f03wxg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"Ev4u864nLECAJ8c\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"qC7r9XPKwmChQrO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"yW2RmyheyHHTtp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"Srkq7h6BcVeydZ\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":78,\"item_id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello! How are you doing? This text is blue!
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":79,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello! How are you doing? This text is blue!
\\\"}]}\",\"call_id\":\"call_UjIZ7oJt4qu2StEaIfFMmtEa\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":80,\"response\":{\"id\":\"resp_68d4e7bc70088193b0c7b94085ac96ac038b51f9cc5aa4c2\",\"object\":\"response\",\"created_at\":1758783420,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7bcf7ec8193bbf88c092b38ad5a038b51f9cc5aa4c2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello! How are you doing? This text is blue!
\\\"}]}\",\"call_id\":\"call_UjIZ7oJt4qu2StEaIfFMmtEa\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":679,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":76,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":755},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_3f251996dcb01d2a4adcb6b548554cc5.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_3f251996dcb01d2a4adcb6b548554cc5.json
new file mode 100644
index 0000000000..70bfdae1e6
--- /dev/null
+++ 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_3f251996dcb01d2a4adcb6b548554cc5.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7b8fff881959c42ad6fd9dbd4d10fee4c92d68a8f6f\",\"object\":\"response\",\"created_at\":1758783417,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7b8fff881959c42ad6fd9dbd4d10fee4c92d68a8f6f\",\"object\":\"response\",\"created_at\":1758783417,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_GJHZ2DCV6RG5SGzFsywmTXJU\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"CoyWwHR3CHzJSS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"5jkEb5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"RVPgYiHkLXK5u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"YzjmSQ0Aj2rwmq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"eGX2dUHpFh38\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"eiTd7gHGohA0X\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"Id6FPzJsQ1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"SQ3Dudh8rLWP1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"wkIWpEuLCYHlkB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"vkjWDQ45qToGH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"xv5C3UVE2WWW2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"heX2bmabDSx4LZ6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"4y1IpoxIVdsgltz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"TPuehBf0fbhUI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"ovHHEVNtO9A\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"PiTXENmZZiB5C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"BMtHU71Ky0csRDO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"19PGjuJa9OjXWr5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"SDVHKxq3gM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"Fqwp9Jicpjhkuoj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\" updated\",\"obfuscation\":\"RPYvVb7d\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\" content\",\"obfuscation\":\"Aug02wjf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"PsUuTL52efxEdi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"tF3J0aMVZrb2Mle\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"hnxyEpeUIIDBKwA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"96IahztYHh8APp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"1aDXc45khIymO1\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, updated content
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":31,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, updated content
\\\"}]}\",\"call_id\":\"call_GJHZ2DCV6RG5SGzFsywmTXJU\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":32,\"response\":{\"id\":\"resp_68d4e7b8fff881959c42ad6fd9dbd4d10fee4c92d68a8f6f\",\"object\":\"response\",\"created_at\":1758783417,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7b9928c8195ab2c14cb80ff87710fee4c92d68a8f6f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, updated content
\\\"}]}\",\"call_id\":\"call_GJHZ2DCV6RG5SGzFsywmTXJU\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":669,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":28,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":697},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_61b231ae85994a3eec1c2eaabb2b3e80.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_61b231ae85994a3eec1c2eaabb2b3e80.json
new file mode 100644
index 0000000000..a92155538f
--- /dev/null
+++ 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_61b231ae85994a3eec1c2eaabb2b3e80.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e83e47a08195aa2fbfda4fc5578d0655ac0046c8a932\",\"object\":\"response\",\"created_at\":1758783550,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e83e47a08195aa2fbfda4fc5578d0655ac0046c8a932\",\"object\":\"response\",\"created_at\":1758783550,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_Ia8IXwQMf67xXDIxagidOrBA\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"PR3XlJC7wAHeNp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"R9Qw7p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"ptspQidYksMUT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"vHSY1AUsK6cPE0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"phWx6UEwN0Ig\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"pMw8nZBlZIsHx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"ha6mPSjdwe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"gnyAVdgmsBlK4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"kZPryB3faN7oqk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"BHAxzqivUAXNA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"w7Z9NnZnZQ32J\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"9EHfkhBnyo1zbHt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"G86hmqxGBT68eSJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"dkwhtW5VXhBHu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"4UosUIljkOh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"BVa7kasWnHoZY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"V1ui14QnPGS9cuU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"SiWgHAnggZupPAD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"RF9ZYdCxfc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"9j0Fx5t7WpcsrQa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"n2VFUmSmuHg8O4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"hbwcqduC79Hn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"R7FCI5I6fAq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"IBOkByuW5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"I6TIMIKD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"G9SABNoDz9T\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"tCOBSBZqoOJYm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"0AeGyZSLp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"CftdoDkwd5Nelr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"9vUTXFangga\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"FpK96TLR5KO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"Urt5LnThKfQet\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"1i6hkn0S1klL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"5IjBGxJUFBzu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"v4OPFyqQ5t01j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"wjTKJwu9ArDUY1k\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"Jane\",\"obfuscation\":\"EKLwPvzmuP5p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"QCFRxQPG0Xv5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"cpFjx3FAKcmY1p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"FAVSp5on56AK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"qrxOVPtWQ0HvrfF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"wkFe4XmTHlP7RDM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"hVfLH1g4Wsz3OG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"bKVTskeMs4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"esYtO44fb67vFPf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"How\",\"obfuscation\":\"OoKLuMOzrXQIA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" are\",\"obfuscation\":\"cPmBpYbVTCNS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" you\",\"obfuscation\":\"pq2DEnnboTaQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" doing\",\"obfuscation\":\"bhuuk1bEok\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"TOfJQwUF8cbKa\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"5BudAw6Cxx\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"6tNqNuMb1cSw9vj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"DM2t77LjAAJHeM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"4TivKBPQf7bs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"uQXwD8nKAu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"Csidq6BxrebI3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"iXrYXR2k7hj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"NJ4uTeE0EJmRv1W\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"maMm0weCyFa0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"6AqRr0qKJJgejtn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"vsrDX7mPl5SdOX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"ABdGlbc5YF7uU2E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"8BK4Z73zyKSokAL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"TEgxuVSpZ1RYL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"k5CIZzFgZDOrlS3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"fb78IfHUA1CSBTX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"jEDwUcn3MYRTf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"KxwycamsSMQNGg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"uTU5w3Tz0uljAf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"ZPHoC0g3XQP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"udelzac5pd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"r6rkTh79T1Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"zD2Zss4HtX2uN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"XiOXTEFuCV5h\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"G4p4b85Dtga\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"TbWkBVULPhoYFH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"Hsl95UfuX7K\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"SAybd5PpBL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"ekMpXKHY6ZQn7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"cpnWyd7bwDws\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"dmz0K504K3Z7NE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"l5z0cnF5qVW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"zhtme8DvI0y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"Jx81jgr6Bs2n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"By7MKaO47jKru\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"fGoQp6RBZ3990\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":89,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"This\",\"obfuscation\":\"TmhQi2xqdWlC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":90,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" text\",\"obfuscation\":\"x02QJlNxmY3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":91,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" is\",\"obfuscation\":\"7XxN9J5x0BYT5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":92,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\" blue\",\"obfuscation\":\"VTob0tal9PA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"Be0W0QkJewbIG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":94,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"mwfVty9TDqEJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":95,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"HLxPcS0btp9FT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":96,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"KpK9wgNMTFQgaWj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":97,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"EPAM3rqQd2kqEYT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":98,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"MweRigrxmzTMud\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":99,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"ljsoeTaXxefetk\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":100,\"item_id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @Jane Doe! How are you doing? This text is blue!
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":101,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @Jane Doe! How are you doing? This text is blue!
\\\"}]}\",\"call_id\":\"call_Ia8IXwQMf67xXDIxagidOrBA\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":102,\"response\":{\"id\":\"resp_68d4e83e47a08195aa2fbfda4fc5578d0655ac0046c8a932\",\"object\":\"response\",\"created_at\":1758783550,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e83ed42881958a3aa39f857852680655ac0046c8a932\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello, @Jane Doe! How are you doing? This text is blue!
\\\"}]}\",\"call_id\":\"call_Ia8IXwQMf67xXDIxagidOrBA\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":661,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":98,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":759},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_3fd6871badc2f924056864cd76a571c0.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_3fd6871badc2f924056864cd76a571c0.json
new file mode 100644
index 0000000000..e7b89bf8e7
--- /dev/null
+++ 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_3fd6871badc2f924056864cd76a571c0.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e83c404c8194bd7ae10fe03e5556006f1d77e4f4c849\",\"object\":\"response\",\"created_at\":1758783548,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e83c404c8194bd7ae10fe03e5556006f1d77e4f4c849\",\"object\":\"response\",\"created_at\":1758783548,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_J041R2dZtCEyUbg9B7ER63RC\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"NYcjouII9jiAIz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"GLJVaA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"6PQemgI0CmALf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"j68TyRgDNScn6w\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"osKfGHREwFvF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"k3Pn2Hbj60Q8t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"JvyTqsthxz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"4cOzTQcWEmURT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"jtaA47rLp9owo6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"XSeLQgfYb0fkh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"0nb6W1KE3AHtQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"sWD05ZCEAqzHeB0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"1UlWip5hK3MjcVI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"2LGsJRBQIiSJw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"X3McAaePoXl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"hVoULkXRu3TJz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"Qa2bMKkHtmpHelW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"qf1k530Y8FLn5fK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"oJCbXif3WySFWSp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"HUanVRXeL7q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"czhirbRZrxT9hDf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"s4rXaRk18Fwgej\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"oAUhqNVsLuwC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"YQZJjambFZR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"-inline\",\"obfuscation\":\"Izfap7ndU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"-content\",\"obfuscation\":\"kc6cNL7v\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"G4Cn7uSqhhM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"6RPXQvxf5F3zi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"mention\",\"obfuscation\":\"9El0Wxrxm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"z03CoZT34wLwyw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"lgeE5CrLsOg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"-user\",\"obfuscation\":\"QXs4Si3PoB9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"XNM7xYxiRR9n9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"hadC6TjtSDhf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"fRn9tvDc1lOv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"AsucGV5NNlry6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"@\",\"obfuscation\":\"Y0O5IX1JDCFMtnG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"John\",\"obfuscation\":\"hYnXuNf9MKDM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" Doe\",\"obfuscation\":\"HweEOrCtRZNP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"kQSlrrvStU4VQc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"tExO2oE2Z1Hu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"DSMIxzaNqaWP9dl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"CSoV3B1D3xsqLKZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"kAE3vxGguf8Xy1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"5QHGJX6H7g\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"sfi7SSnpkQhcfEd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"Wie\",\"obfuscation\":\"3Yzbo08m3j0w0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" geht\",\"obfuscation\":\"WjUUPF1NNC5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" es\",\"obfuscation\":\"3rmRKgutZ2D63\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" dir\",\"obfuscation\":\"qEURWeWjZRM1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"?\",\"obfuscation\":\"HDdUqaQPvfeFV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"oHvOpC1yBd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"zqivT7wx42IEyaF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"9MSLvH7ms4PpBf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"aeQMFost10tO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":58,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"HTrHRQjkVf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":59,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"kHqrPrfJrGUhQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":60,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"color\",\"obfuscation\":\"5dk5CvhrlrF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":61,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"avWE11spvUfJX7C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":62,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" rgb\",\"obfuscation\":\"SGteH1wAKw9C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":63,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"(\",\"obfuscation\":\"GZh3uNCNivE0cOB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":64,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"11\",\"obfuscation\":\"yw29IIBTMPL6m0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":65,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"iORZCAfzU8s1iqs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":66,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"Yk7cIIfqyci4BWZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":67,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"110\",\"obfuscation\":\"Hos3RlK1siDji\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":68,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"JjWzEjKmHKxZCFE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":69,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" \",\"obfuscation\":\"OH4av7gdmhM9DA3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":70,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"153\",\"obfuscation\":\"A0Z0wV9A0qCrp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":71,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\");\",\"obfuscation\":\"CfBaOGVP2NTYUO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":72,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"CA83rPjj87CWRJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":73,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"sM2hnlpFIPk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":74,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"-style\",\"obfuscation\":\"Xw0y9PrsB2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":75,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"-type\",\"obfuscation\":\"zooorpN1k7d\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":76,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"V7IW79Rr6v8oh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":77,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"qAAHoDldtHqI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":78,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"Color\",\"obfuscation\":\"E4B12HG7Wcb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":79,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"TULBh4WmUKYUnS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":80,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"Z1Kr6F5Cowh\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":81,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"-value\",\"obfuscation\":\"fNA2wNA2f3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":82,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"KpEs4opMCot0H\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":83,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"blue\",\"obfuscation\":\"w9vRkdt8gEtt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":84,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\\\\\"\",\"obfuscation\":\"U3zqXfl9BQ2d8m\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":85,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" data\",\"obfuscation\":\"fox7huxRspi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":86,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"-edit\",\"obfuscation\":\"MfmNGb4cIX1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":87,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"able\",\"obfuscation\":\"NilwfBZTFojJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":88,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"40JDmzDlw03TD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":89,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"6yKHnFhd2tPLD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":90,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"Dieser\",\"obfuscation\":\"VnrFWD892f\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":91,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" Text\",\"obfuscation\":\"ugx5OK1j4zw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":92,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" ist\",\"obfuscation\":\"l0jkK558lOtG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":93,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\" blau\",\"obfuscation\":\"cp1aFslh6xr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":94,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"fgyUBTqB2lDsX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":95,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"span\",\"obfuscation\":\"mqiNgJFJoshP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":96,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"R6TGRWPBOpJxr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":97,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"NJ3lTvOvgrortL2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":98,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"u5QcB1eoVM3Y42e\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":99,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"0Ar1GqsQgiEo7Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":100,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"H4o1H3PXhBV7I5\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":101,\"item_id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":102,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!
\\\"}]}\",\"call_id\":\"call_J041R2dZtCEyUbg9B7ER63RC\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":103,\"response\":{\"id\":\"resp_68d4e83c404c8194bd7ae10fe03e5556006f1d77e4f4c849\",\"object\":\"response\",\"created_at\":1758783548,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e83cc12c8194b3f254e06c98ae28006f1d77e4f4c849\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hallo, @John Doe! Wie geht es dir? Dieser Text ist blau!
\\\"}]}\",\"call_id\":\"call_J041R2dZtCEyUbg9B7ER63RC\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":670,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":99,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":769},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_728e83ee8b26541816af7dcf417e127b.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_728e83ee8b26541816af7dcf417e127b.json
new file mode 100644
index 0000000000..a4821b3ec9
--- /dev/null
+++ 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_728e83ee8b26541816af7dcf417e127b.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7bf28f88190a83a70a62fafa2f8023dde18f892187f\",\"object\":\"response\",\"created_at\":1758783423,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7bf28f88190a83a70a62fafa2f8023dde18f892187f\",\"object\":\"response\",\"created_at\":1758783423,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_EfZduslXIZF30VfKMO24C5vb\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"seO7gIzUM4Hidk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"659X9Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"fUJbS3Hdvm2KJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"RXDzyyFuAm3tOG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"6TqoHGMFssMH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"vy5c1U2fpTEoy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"eDqljw3aGO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"3HqiVRBSmh4tR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"1UK4LyUbnNVdIm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"7n9jHuLkHXo2g\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"xVAJM9zPRevCj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"veNA1rj1Q5zcdJ7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"ssjQn0C8h0KY70Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"OcFMi0w5dz2iR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"vd1GhdFN2zb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"gx3IPzvyyF2Ru\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"WkxyfjQgbhzgOQy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"R850pmWdDDYHgtf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"jb3US2ZNwZNdr2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"LMGQE0ECm9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"5wDakNLM5B\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"wD7kaTDmhSHpOnV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"AoR5eorisk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"K0Sv7D70iPohV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"DVKqt5aDLY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"RNNFaQvOgVPgs\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"22YYSgBYpKgZd82\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"8KrV7uk2g94Gcf0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"qARWn4JrIGzQAU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"Q7YRGaZKUIp9Ad\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\",\"call_id\":\"call_EfZduslXIZF30VfKMO24C5vb\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68d4e7bf28f88190a83a70a62fafa2f8023dde18f892187f\",\"object\":\"response\",\"created_at\":1758783423,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7bfbbc0819083f6d364b3c73dbf023dde18f892187f\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\",\"call_id\":\"call_EfZduslXIZF30VfKMO24C5vb\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":659,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":690},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_abd0a85b8c45cfa0b4449a382dc81602.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_abd0a85b8c45cfa0b4449a382dc81602.json
new file mode 100644
index 0000000000..e1644e322a
--- /dev/null
+++ 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_abd0a85b8c45cfa0b4449a382dc81602.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7be14408196a5d9b8555484c0ef0971b4db82314497\",\"object\":\"response\",\"created_at\":1758783422,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7be14408196a5d9b8555484c0ef0971b4db82314497\",\"object\":\"response\",\"created_at\":1758783422,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_ouCh8TBr1jcadjsDcW2Twmr8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"XZuL4JRo6S5uqV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"d2XHzi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"cO6vgCrs7qhsU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"2SNLsNnIPaA2nY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"XrJfBQGtwlFZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"DX50X3bCPgJJL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"498yCem4RR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"IQXvIcPttnx39\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"FQBqh5gF7cRdwI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"QYogOTMlsI2kb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"YB90eZq7EkdGr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"ghndjKd70lgeFPZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"hH6D67gisvWLoSK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"8UrLhtI6FnYdO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"uFCXEZmZjIM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"LPWpyOZuopHa9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"LsQQFzo9cjFmEIf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"2ONzVB9kLiUqhYn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"2C0LSbgqYY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"Riv5gtn5u84B5Tm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\" <\",\"obfuscation\":\"WEstWhqDd35hqC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"vMWPzoblZr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"diw61BJrIiYBfR0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"world\",\"obfuscation\":\"TbayLV2dtuZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"GICa2Zh3WVMsm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"strong\",\"obfuscation\":\"3m8nF1Oi4R\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"8d0O3k9IS0XA8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"oFxWzfZT15eyI4s\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"94EKr9SWJYcg0ge\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"DZU5M08NH274qc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"GEl1cgvxBgQatR\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":35,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\",\"call_id\":\"call_ouCh8TBr1jcadjsDcW2Twmr8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":36,\"response\":{\"id\":\"resp_68d4e7be14408196a5d9b8555484c0ef0971b4db82314497\",\"object\":\"response\",\"created_at\":1758783422,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7be8e80819697365148a36961890971b4db82314497\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\",\"call_id\":\"call_ouCh8TBr1jcadjsDcW2Twmr8\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":666,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":32,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":698},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_c0b30a449a94314760b815a202ee6f64.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_c0b30a449a94314760b815a202ee6f64.json
new file mode 100644
index 0000000000..b07faa9a41
--- /dev/null
+++ 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_c0b30a449a94314760b815a202ee6f64.json
@@ -0,0 +1,15 @@
+{
+ "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 selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List 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.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hello
\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e83988cc81909aae42b9bfff2eed01dae7c77b380e4e\",\"object\":\"response\",\"created_at\":1758783545,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e83988cc81909aae42b9bfff2eed01dae7c77b380e4e\",\"object\":\"response\",\"created_at\":1758783545,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_ixv81kTNttOUWMEzAmZpvdVS\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"DfewBwrf7SUUky\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"RttDts\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"zqMHxOan4J4Ge\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"z64NpcqAV6UkAe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"0YKj0cwoUjFe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"5Ju3EdOagA6ZA\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"21Ezc1DSsZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"Qjlbkag1Fmg55\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"4igSlRefk9NBOE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"eMev6ehjLGwQ3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"Woky0QS7JYtFV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"yXgifm8nbnsDCwm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"cS0PDYpvOKAxI06\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"l7r7Zmmp45gzV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"t94pkNt5wq9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"VKoN4kC090qY1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"TE39Xt9yFke1nYo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"v6yLOksGuweQUKy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"jZblIffPbwyzSCL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"Hallo\",\"obfuscation\":\"UIMQH9Pjqce\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"dSeOZgtjhNOB0n\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"pUbmp3NEPzOVlX2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"I0Ht1p6M3VknMww\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"ftPfKn5cyloejG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"t8t1OWjCytXzyp\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":28,\"item_id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hallo
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":29,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hallo
\\\"}]}\",\"call_id\":\"call_ixv81kTNttOUWMEzAmZpvdVS\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":30,\"response\":{\"id\":\"resp_68d4e83988cc81909aae42b9bfff2eed01dae7c77b380e4e\",\"object\":\"response\",\"created_at\":1758783545,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e83a0d5481908ef9ab6b89a33e8c01dae7c77b380e4e\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Hallo
\\\"}]}\",\"call_id\":\"call_ixv81kTNttOUWMEzAmZpvdVS\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":491,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":26,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":517},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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)/turn paragraphs into list_1_cfbaa99fe0298f4754b6bdd81c0a9601.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)/turn paragraphs into list_1_cfbaa99fe0298f4754b6bdd81c0a9601.json
new file mode 100644
index 0000000000..282b857cb7
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/turn paragraphs into list_1_cfbaa99fe0298f4754b6bdd81c0a9601.json
@@ -0,0 +1,15 @@
+{
+ "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 selected part of a text document using HTML blocks. \\n Make sure to follow the json schema provided and always include the trailing $ in ids.\\n List 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.\\n This is the selection as an array of html blocks:\"},{\"role\":\"system\",\"content\":\"[{\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"Apples
\\\"},{\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"Bananas
\\\"}]\"},{\"role\":\"system\",\"content\":\"This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:[{\\\"block\\\":\\\"I need to buy:
\\\"},{\\\"block\\\":\\\"Apples
\\\"},{\\\"block\\\":\\\"Bananas
\\\"}]\"},{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"turn into list (update existing blocks)\"}]}],\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7c5a1a48195b1512156a1c0e65e063ec43d5c6ae6d6\",\"object\":\"response\",\"created_at\":1758783429,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7c5a1a48195b1512156a1c0e65e063ec43d5c6ae6d6\",\"object\":\"response\",\"created_at\":1758783429,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_fN7kesYspPXzZW2PzNpGQuF8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"M54aUz6AniEQnm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"PwwkhL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"IhG6y6pUacocE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"a1awzwqpOkRE7Y\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"GyAKvKXyACTz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"GeEluQsYisBhe\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"riKariqMxN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"dDb2JNtTDtvQ6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"ToMLlr0yQ1aOWv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"HA0x1wOEHaiFd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"DkAeEPXpNP2mr\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"2\",\"obfuscation\":\"MUKzmLcpSRTMTEM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"hkuowDbtAHjB66a\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"wP1fVxxgpWjGz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"a6VYNrDD3jt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"TZoFwWgIgcuOG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"zG2bvRIIPufN6ZL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"hwZxJzu3ZKzpFC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"kdgBLAuVokSK7Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"bvLjYsuulSCclp\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"4GlM0naa2to9Tsw\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"Ap\",\"obfuscation\":\"hADASku508uJfN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"ples\",\"obfuscation\":\"b5smjHlImiMy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"M44th1N3DiQYf8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"aW3elOIAEGMyzS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"8YJL7u0WFOq6j\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"rZFnZarOilaTx9\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\">\\\"\",\"obfuscation\":\"K479BPs645prPj\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"},{\\\"\",\"obfuscation\":\"ELrd8kZT5NF8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"aBEy7yy94khd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"tm4D2egTz9Oho\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"cVQoPY4u0N\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"kqd6Y3RYqJtIC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"GCP6c8QxS54HsJ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"JNev9l3usvFQf\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":38,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"zNnbLRxMqa7gg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":39,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"3\",\"obfuscation\":\"qo6zaeyNVZto7hQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":40,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"W4VhIhkZuxYkSRD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":41,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"KQ5tmq6zaFsXc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":42,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"sNJxyUrkFVP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":43,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"T5zEVNY2FA353\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":44,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"8SjF1vYRCFBD8vN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":45,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"ioclVRVrtHS6mU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":46,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"><\",\"obfuscation\":\"LBBxQXubG8VFkC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":47,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"z87iFoacx0dzp8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":48,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"5lYKHeT4PaWRYYy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":49,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"Ban\",\"obfuscation\":\"L0loh1FjinHGi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":50,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"anas\",\"obfuscation\":\"MO27lTGnqmHd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":51,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\",\"obfuscation\":\"DC6aVDhRtcGATi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":52,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"li\",\"obfuscation\":\"rtkviRSmAPJLmB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":53,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"To9bI5Juyqc79\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":54,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"ul\",\"obfuscation\":\"sKUsCs8uXv8dOu\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":55,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"EAc964BO3JgPtLR\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":56,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"55xBC3rVIABrdq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":57,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"BtGSrfnD8AdGcL\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":58,\"item_id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"- Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"- Bananas
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":59,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"- Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"- Bananas
\\\"}]}\",\"call_id\":\"call_fN7kesYspPXzZW2PzNpGQuF8\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":60,\"response\":{\"id\":\"resp_68d4e7c5a1a48195b1512156a1c0e65e063ec43d5c6ae6d6\",\"object\":\"response\",\"created_at\":1758783429,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7c626d48195be15ff5d4643b216063ec43d5c6ae6d6\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref2$\\\",\\\"block\\\":\\\"- Apples
\\\"},{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref3$\\\",\\\"block\\\":\\\"- Bananas
\\\"}]}\",\"call_id\":\"call_fN7kesYspPXzZW2PzNpGQuF8\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":411,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":56,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":467},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_a560a1761f87da8f3bdb7b42357ba4ec.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_a560a1761f87da8f3bdb7b42357ba4ec.json
new file mode 100644
index 0000000000..50db40897d
--- /dev/null
+++ 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_a560a1761f87da8f3bdb7b42357ba4ec.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7b7c73c819588fd4ae6dfcd52f40f9c63618c205ddb\",\"object\":\"response\",\"created_at\":1758783415,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7b7c73c819588fd4ae6dfcd52f40f9c63618c205ddb\",\"object\":\"response\",\"created_at\":1758783415,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_PaQl4Twi9e3hyLSTSFss3DPi\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"RN5vuDxOjrrljC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"4WU8ra\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"0WBj0lRkUpi2D\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"RO8O5gEkpVTdvI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"IgUgXeMwtxPI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"LM2Nz3e0JPI0O\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"hHARf7sR8E\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"g9d6DvQP6NVRI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"12nvpHHESg1Ahd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"7USNRssANDsGl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"Myqrx01WjS5d5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"3gOv1NNIhcwzjcI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"pKp8QgeBgcqGsi5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"M9BXcCRbbhu4M\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"ExDNzvqjNoQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"ejHrBWIUmlFhb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"Kge8lYsjysiQrFB\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"f5MCDv8rA3UQyX5\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"74rLyRuBWI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"J8MWM4WSyv23u\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"yqKsKzXK2FnH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"-align\",\"obfuscation\":\"LsFNJDTRkP\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\":\",\"obfuscation\":\"cVwqXo24JWoOHnz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\" right\",\"obfuscation\":\"C55MP7VCds\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\";\",\"obfuscation\":\"9YDhBOD35QZc9dq\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"Voiexa65u8fTk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"What's\",\"obfuscation\":\"rFAz2j4kjI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\" up\",\"obfuscation\":\"C6WrKUJZVvdGU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"UHkYV6VaOHdnDoS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"Zca2eJwOM1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"Q7jSBgYgYArw8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"Qra0wH54DoYJPn4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"5rs7wp9ZLWv5rRN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"2PnlFlSSIkaCmX\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":37,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"bDKacg5HJCgKl1\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":38,\"item_id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":39,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\\\"}]}\",\"call_id\":\"call_PaQl4Twi9e3hyLSTSFss3DPi\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":40,\"response\":{\"id\":\"resp_68d4e7b7c73c819588fd4ae6dfcd52f40f9c63618c205ddb\",\"object\":\"response\",\"created_at\":1758783415,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7b850ac81959b21063e7beba8ec0f9c63618c205ddb\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\\\"}]}\",\"call_id\":\"call_PaQl4Twi9e3hyLSTSFss3DPi\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":672,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":36,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":708},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_d959d9e97f6cf99760b26b7d17c11244.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_d959d9e97f6cf99760b26b7d17c11244.json
new file mode 100644
index 0000000000..5c95bd03be
--- /dev/null
+++ 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_d959d9e97f6cf99760b26b7d17c11244.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7b55a608196a3df9486e1df043d050680dac27be4a2\",\"object\":\"response\",\"created_at\":1758783413,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7b55a608196a3df9486e1df043d050680dac27be4a2\",\"object\":\"response\",\"created_at\":1758783413,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_iKRfSmf4FmQxLFA2XKgbZker\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"zpu4Q5d1JKlBbF\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"kq08Z7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"ESfiso7v9BTn7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"j8wsiTeQXJydZK\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"EcQMk5iN4pX0\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"6xH8rV36PTNlM\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"RjteRUL1Wn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"TWb78oSxABMUD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"KXjrnkya523WjO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"jflf9r74FfuP4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"tDbdYPMdy8bDH\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"SnjqDnqg1naMNpE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"K5JApbPvEYcpooc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"ap5pf4cTI7yHy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"D2MK198njbd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"EA5Qd280Je1CC\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"KkdTIpuIMwquG9t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"iYBSX3IdoEdiSQS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\" style\",\"obfuscation\":\"Uhj6HLoL3M\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"=\\\\\\\"\",\"obfuscation\":\"4Z4FN6RvVzmJm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"text\",\"obfuscation\":\"TsadHxp5pbDV\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"-align\",\"obfuscation\":\"W4NqDZAjJ6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\":right\",\"obfuscation\":\"30MhqKAcp4\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\";\",\"obfuscation\":\"oaP3wiDQgihq2U1\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"\\\\\\\">\",\"obfuscation\":\"9qJXuyK70IWsb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"Hello\",\"obfuscation\":\"j3ZfM10D8cz\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"XgCKj52TQHAAc2p\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"wyVNsAIk3Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"IEXMc9IWNHUZy\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"p\",\"obfuscation\":\"PCQzyXeqYUoEHoo\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"JB0oHNpbwZbiWL2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"jxnS3oMJVkpfaN\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":35,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"bMS4xa7uikU8NU\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":36,\"item_id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\",\"call_id\":\"call_iKRfSmf4FmQxLFA2XKgbZker\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"resp_68d4e7b55a608196a3df9486e1df043d050680dac27be4a2\",\"object\":\"response\",\"created_at\":1758783413,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7b5f4ac81968323d1d3734992ce050680dac27be4a2\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\",\"call_id\":\"call_iKRfSmf4FmQxLFA2XKgbZker\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":661,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":34,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":695},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_649d6a7338cc6b674c4b4c38184c1037.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_649d6a7338cc6b674c4b4c38184c1037.json
new file mode 100644
index 0000000000..22974b65c7
--- /dev/null
+++ 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_649d6a7338cc6b674c4b4c38184c1037.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e7b69b7081958bf610df186ae9100ba9bac8c2b70ed0\",\"object\":\"response\",\"created_at\":1758783414,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e7b69b7081958bf610df186ae9100ba9bac8c2b70ed0\",\"object\":\"response\",\"created_at\":1758783414,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_ly1MCexQajVdMVCiKsblZnlW\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"9V6oLRi2GHZafd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"qqBOXD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"8ZBESW9TVIbsd\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"LFCNjvMOTzCo71\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"F2fz5Lp7KaVG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"xQSl7m0Vowlzb\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"AOyi2y1Y3Q\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"xY2BAPSf2McxE\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"qlPzuzAXODEH2Z\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"Xh1sfG9mPc4sk\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"tt35ENDso5zKi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"lt8YPz0Tk0evYUU\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"pxafmfNPsY9csai\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"QQqEB8lQKo83t\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"ZtbK17P1zz6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"4xhohonYrtkWD\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"OE6ZyocPGUL8uP3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"8AtoPo1mY4EAsG8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"9NLqUtrgC7iCBHi\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"R5BQ9Tev3stfOMI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"What's\",\"obfuscation\":\"1OlLmByPO2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\" up\",\"obfuscation\":\"YKzpsLGU8KY8C\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"gg5HObchZYxfsBS\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"sMrgbel1Un\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"yekRmzSHFmeL2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"l91427KhbHfpVLl\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"byAIvaEzfpimliY\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"P87AngxKxdaDOkW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":31,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"SVrV6bPxpSoOyW\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":32,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"XDML6E9t7eLTe2\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":33,\"item_id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":34,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\\\"}]}\",\"call_id\":\"call_ly1MCexQajVdMVCiKsblZnlW\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":35,\"response\":{\"id\":\"resp_68d4e7b69b7081958bf610df186ae9100ba9bac8c2b70ed0\",\"object\":\"response\",\"created_at\":1758783414,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e7b71d648195912653accc6c27810ba9bac8c2b70ed0\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"What's up, world!
\\\"}]}\",\"call_id\":\"call_ly1MCexQajVdMVCiKsblZnlW\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":672,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":31,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":703},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
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_9cbb96117eed2b41fee6c0802fe00bb2.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_9cbb96117eed2b41fee6c0802fe00bb2.json
new file mode 100644
index 0000000000..aa40986e1e
--- /dev/null
+++ 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_9cbb96117eed2b41fee6c0802fe00bb2.json
@@ -0,0 +1,15 @@
+{
+ "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. \\n Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $). \\n List 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.\\n For code blocks, you can use the `data-language` attribute on a block (wrapped with ) to specify the language.\\n This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):\"},{\"role\":\"system\",\"content\":\"[{\\\"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\":\"system\",\"content\":\"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), \\n then you need `referenceId` to point to the block before the cursor with position `after` (or block below and `before`).\\n \\n Prefer updating existing blocks over removing and adding (but this also depends on the user's question).\"},{\"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\"]},\"strict\":false}],\"tool_choice\":\"required\",\"stream\":true}",
+ "headers": [],
+ "cookies": []
+ },
+ "response": {
+ "status": 200,
+ "statusText": "",
+ "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"resp_68d4e83ae20c81968e8637ac7f75d67f049c8eca8d1a3122\",\"object\":\"response\",\"created_at\":1758783546,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"resp_68d4e83ae20c81968e8637ac7f75d67f049c8eca8d1a3122\",\"object\":\"response\",\"created_at\":1758783546,\"status\":\"in_progress\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"type\":\"function_call\",\"status\":\"in_progress\",\"arguments\":\"\",\"call_id\":\"call_k3GPX4EWoAP9qLOqkRYuefqS\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"kn2NWv1ciLlzQv\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"operations\",\"obfuscation\":\"kHt3u7\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"\\\":[\",\"obfuscation\":\"m3ycoalLL6bcG\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"{\\\"\",\"obfuscation\":\"6ZRuYZciSD0A13\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"type\",\"obfuscation\":\"tB45w1SBIqTZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"i5y53TsXp5KGm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"update\",\"obfuscation\":\"HLJsdnlWLg\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"JMFj8fJDtz2Bc\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"id\",\"obfuscation\":\"Dg2Oj99EPR62cL\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":12,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"msRJwOOF7sDgm\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"ref\",\"obfuscation\":\"ixgN1rkqnTPy3\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":14,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"99qVvIj92lugzV6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":15,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"$\",\"obfuscation\":\"byU3atRGPDUeLga\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":16,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"\\\",\\\"\",\"obfuscation\":\"6vGwxYaz3AgFt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":17,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"block\",\"obfuscation\":\"folySlFbUVt\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":18,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"\\\":\\\"\",\"obfuscation\":\"nytaYBgebUtSn\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":19,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"<\",\"obfuscation\":\"OquUmfPF5RrgCXI\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":20,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"HfpSGcGU0ztBLD8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":21,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"5nNuU1w8xJGF3iO\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":22,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\">Hello\",\"obfuscation\":\"8cAzPDPPB8\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":23,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\",\",\"obfuscation\":\"a3rq0JKVCmNXxww\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":24,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\" world\",\"obfuscation\":\"QK37mu7WcT\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":25,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"!\",\"obfuscation\":\"4yYvKld8Hzap2\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":26,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"h\",\"obfuscation\":\"WdisRIW6O4hS3XZ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":27,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"1\",\"obfuscation\":\"bv1rsdMQguShkCQ\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":28,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\">\",\"obfuscation\":\"YTsFzqStvParv9l\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":29,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"\\\"}\",\"obfuscation\":\"4kJ6HEkkNxRSN6\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":30,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"delta\":\"]}\",\"obfuscation\":\"5A9ZxW0DjSRtJs\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":31,\"item_id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"output_index\":0,\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":32,\"output_index\":0,\"item\":{\"id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\",\"call_id\":\"call_k3GPX4EWoAP9qLOqkRYuefqS\",\"name\":\"applyDocumentOperations\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":33,\"response\":{\"id\":\"resp_68d4e83ae20c81968e8637ac7f75d67f049c8eca8d1a3122\",\"object\":\"response\",\"created_at\":1758783546,\"status\":\"completed\",\"background\":false,\"error\":null,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":null,\"max_tool_calls\":null,\"model\":\"gpt-4o-2024-08-06\",\"output\":[{\"id\":\"fc_68d4e83b57b48196b30f481d10d5bc41049c8eca8d1a3122\",\"type\":\"function_call\",\"status\":\"completed\",\"arguments\":\"{\\\"operations\\\":[{\\\"type\\\":\\\"update\\\",\\\"id\\\":\\\"ref1$\\\",\\\"block\\\":\\\"Hello, world!
\\\"}]}\",\"call_id\":\"call_k3GPX4EWoAP9qLOqkRYuefqS\",\"name\":\"applyDocumentOperations\"}],\"parallel_tool_calls\":true,\"previous_response_id\":null,\"prompt_cache_key\":null,\"reasoning\":{\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":1.0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"required\",\"tools\":[{\"type\":\"function\",\"description\":null,\"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\"]},\"strict\":false}],\"top_logprobs\":0,\"top_p\":1.0,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":661,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":29,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":690},\"user\":null,\"metadata\":{}}}\n\n",
+ "headers": []
+ }
+}
\ No newline at end of file
diff --git a/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts b/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts
index 7fe83e758f..3dea46b2a6 100644
--- a/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts
+++ b/packages/xl-ai/src/api/formats/html-blocks/defaultHTMLPromptBuilder.ts
@@ -1,183 +1,200 @@
-import { CoreMessage } from "ai";
-import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js";
+import { UIMessage } from "ai";
import type { PromptBuilder } from "../PromptBuilder.js";
-import {
- getDataForPromptNoSelection,
- getDataForPromptWithSelection,
-} from "./htmlPromptData.js";
+import { HTMLPromptData } from "./htmlPromptData.js";
-function promptManipulateSelectionHTMLBlocks(opts: {
- userPrompt: string;
- htmlSelectedBlocks: {
- id: string;
- block: string;
- }[];
- htmlDocument: {
- block: string;
- }[];
- isEmptyDocument: boolean;
-}): Array {
- return [
+function promptManipulateSelectionHTMLBlocks(
+ messages: UIMessage[],
+ opts: Exclude,
+): void {
+ if (messages.length > 0) {
+ messages.push(
+ {
+ role: "assistant",
+ id: "document-state-" + messages.length,
+ parts: [
+ {
+ 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: JSON.stringify(opts.htmlSelectedBlocks),
+ },
+ {
+ type: "text",
+ text: "This is the latest state of the document (INCLUDING the selected text), find the selected text in there to understand the context:",
+ },
+ {
+ type: "text",
+ text: JSON.stringify(opts.htmlDocument),
+ },
+ ],
+ },
+ {
+ role: "user",
+ id: "user-prompt-" + messages.length,
+ parts: [
+ {
+ type: "text",
+ text: "The user asks you to do the following:",
+ },
+ {
+ type: "text",
+ text: opts.userPrompt,
+ },
+ ],
+ },
+ );
+ }
+
+ messages.push(
{
role: "system",
- content: `You're manipulating a selected part of a text document using HTML blocks.
- Make sure to follow the json schema provided and always include the trailing $ in ids.
+ id: "document-state-intro",
+ parts: [
+ {
+ type: "text",
+ text: `You're manipulating a selected part of a text document using HTML blocks.
+ Make sure to follow the json schema provided and always include the trailing $ in ids.
List 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.
This is the selection as an array of html blocks:`,
+ },
+ ],
},
{
role: "system",
- content: JSON.stringify(opts.htmlSelectedBlocks),
- },
- {
- role: "system",
- content:
- "This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:",
- },
- {
- role: "system",
- content: JSON.stringify(opts.htmlDocument),
+ id: "document-state-selection",
+ parts: [
+ {
+ type: "text",
+ text: JSON.stringify(opts.htmlSelectedBlocks),
+ },
+ ],
},
{
role: "system",
- content: "The user asks you to do the following:",
+ id: "document-state-context",
+ parts: [
+ {
+ type: "text",
+ text: "This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:",
+ },
+ {
+ type: "text",
+ text: JSON.stringify(opts.htmlDocument),
+ },
+ ],
},
{
role: "user",
- content: opts.userPrompt,
+ id: "user-prompt",
+ parts: [
+ {
+ type: "text",
+ text: opts.userPrompt,
+ },
+ ],
},
- ];
+ );
}
-function promptManipulateDocumentUseHTMLBlocks(opts: {
- userPrompt: string;
- htmlBlocks: Array<
- | {
- id: string;
- block: string;
- }
- | {
- cursor: true;
- }
- >;
- isEmptyDocument: boolean;
-}): Array {
- return [
+function promptManipulateDocumentUseHTMLBlocks(
+ messages: UIMessage[],
+ opts: Exclude,
+): void {
+ if (messages.length > 0) {
+ messages.push(
+ {
+ role: "assistant",
+ id: "document-state-" + messages.length,
+ parts: [
+ {
+ type: "text",
+ text: `This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document):`,
+ },
+ {
+ type: "text",
+ text: JSON.stringify(opts.htmlBlocks),
+ },
+ ],
+ },
+ {
+ role: "user",
+ id: "user-prompt-" + messages.length,
+ parts: [
+ {
+ type: "text",
+ text: opts.userPrompt,
+ },
+ ],
+ },
+ );
+ return;
+ }
+ messages.push(
{
role: "system",
- content: `You're manipulating a text document using HTML blocks.
+ id: "document-state-intro",
+ parts: [
+ {
+ type: "text",
+ text: `You're manipulating a text document using HTML blocks.
Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $).
List 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.
- For code blocks, you can use the \`data-language\` attribute on a code block to specify the language.
- This is the document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):`,
+ For code blocks, you can use the \`data-language\` attribute on a block (wrapped with ) to specify the language.
+ This is the initial document as an array of html blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):`,
+ },
+ ],
},
{
role: "system",
- content: JSON.stringify(opts.htmlBlocks),
+ id: "document-state-data",
+ parts: [
+ {
+ type: "text",
+ text: JSON.stringify(opts.htmlBlocks),
+ },
+ ],
},
{
role: "system",
- content:
- `First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.
+ id: "extended-instructions",
+ parts: [
+ {
+ type: "text",
+ text:
+ `First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.
EXAMPLE: if user says "below" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor.
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\`).
` +
- (opts.isEmptyDocument
- ? `Because the document is empty, first update the empty block before adding new blocks.`
- : "Prefer updating existing blocks over removing and adding (but this also depends on the user's question)."),
- },
- {
- role: "system",
- content: "The user asks you to do the following:",
+ (opts.isEmptyDocument
+ ? `Because the document is empty, first update the empty block before adding new blocks.`
+ : "Prefer updating existing blocks over removing and adding (but this also depends on the user's question)."),
+ },
+ ],
},
{
role: "user",
- content: opts.userPrompt,
- },
- ];
-}
-
-export const defaultHTMLPromptBuilder: PromptBuilder = async (editor, opts) => {
- const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0;
-
- if (opts.selectedBlocks) {
- const data = await getDataForPromptWithSelection(editor, {
- selectedBlocks: opts.selectedBlocks,
- });
-
- if (opts.previousMessages) {
- return [
- ...opts.previousMessages,
- {
- role: "system",
- content: `After processing the previous response, this is the updated selection.
- Ignore previous documents, you MUST issue operations against this latest version of the document:`,
- },
- {
- role: "system",
- content: JSON.stringify(data.htmlSelectedBlocks),
- },
- {
- role: "system",
- content: "This is the updated entire document:",
- },
- {
- role: "system",
- content: JSON.stringify(data.htmlDocument),
- },
+ id: "user-prompt",
+ parts: [
{
- role: "system",
- content: `You SHOULD use "update" operations to update blocks you added / edited previously
- (unless the user explicitly asks you otherwise to add or delete other blocks).
-
- The user now asks you to do the following:`,
+ type: "text",
+ text: opts.userPrompt,
},
- {
- role: "user",
- content: opts.userPrompt,
- },
- ];
- }
+ ],
+ },
+ );
+}
- return promptManipulateSelectionHTMLBlocks({
- ...data,
- userPrompt: opts.userPrompt,
- isEmptyDocument,
- });
+export const defaultHTMLPromptBuilder: PromptBuilder = async (
+ messages,
+ inputData,
+) => {
+ if (inputData.selection) {
+ promptManipulateSelectionHTMLBlocks(messages, inputData);
} else {
- const data = await getDataForPromptNoSelection(editor, opts);
- if (opts.previousMessages) {
- return [
- ...opts.previousMessages,
- {
- role: "system",
- content: `After processing the previous response, this is the updated document.
- Ignore previous documents, you MUST issue operations against this latest version of the document:`,
- },
- {
- role: "system",
- content: JSON.stringify(data.htmlBlocks),
- },
- {
- role: "system",
- content: `You SHOULD use "update" operations to update blocks you added / edited previously
- (unless the user explicitly asks you otherwise to add or delete other blocks).
-
- The user now asks you to do the following:`,
- },
- {
- role: "user",
- content: opts.userPrompt,
- },
- ];
- }
-
- return promptManipulateDocumentUseHTMLBlocks({
- ...data,
- userPrompt: opts.userPrompt,
- isEmptyDocument,
- });
+ promptManipulateDocumentUseHTMLBlocks(messages, inputData);
}
};
diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts
index 20e7914c69..e7c5a214f4 100644
--- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts
+++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.ts
@@ -2,9 +2,12 @@ import { getCurrentTest } from "@vitest/runner";
import { getSortedEntries, snapshot, toHashString } from "msw-snapshot";
import { setupServer } from "msw/node";
import path from "path";
-import { afterAll, afterEach, beforeAll, describe } from "vitest";
+import { afterAll, afterEach, beforeAll, describe, it } from "vitest";
import { testAIModels } from "../../../testUtil/testAIModels.js";
-import { doLLMRequest } from "../../LLMRequest.js";
+
+import { BlockNoteEditor } from "@blocknote/core";
+import { StreamToolExecutor } from "../../../streamTool/StreamToolExecutor.js";
+import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js";
import { generateSharedTestCases } from "../tests/sharedTestCases.js";
import { htmlBlockLLMFormat } from "./htmlBlocks.js";
@@ -81,19 +84,25 @@ describe("Models", () => {
{
model: testAIModels.openai,
stream: true,
+ generateObject: true,
},
{
model: testAIModels.openai,
- stream: false,
- },
- {
- model: testAIModels.groq,
stream: true,
},
+ // {
+ // model: testAIModels.openai,
+ // stream: false,
+ // },
+ // TODO: https://github.com/vercel/ai/issues/8533
{
model: testAIModels.groq,
- stream: false,
+ stream: true,
},
+ // {
+ // model: testAIModels.groq,
+ // stream: false,
+ // },
// anthropic streaming needs further investigation for some test cases
// {
// model: testAIModels.anthropic,
@@ -101,7 +110,7 @@ describe("Models", () => {
// },
{
model: testAIModels.anthropic,
- stream: false,
+ stream: true,
},
// currently doesn't support streaming
// https://github.com/vercel/ai/issues/5350
@@ -118,18 +127,64 @@ describe("Models", () => {
for (const params of testMatrix) {
describe(`${params.model.provider}/${params.model.modelId} (${
- params.stream ? "streaming" : "non-streaming"
+ (params.stream ? "streaming" : "non-streaming") +
+ (params.generateObject ? " + generateObject" : "")
})`, () => {
- generateSharedTestCases((editor, options) =>
- doLLMRequest(editor, {
- ...options,
- dataFormat: htmlBlockLLMFormat,
+ generateSharedTestCases({
+ streamToolsProvider: htmlBlockLLMFormat.getStreamToolsProvider({
+ withDelays: false,
+ }),
+ transport: new ClientSideTransport({
model: params.model,
- maxRetries: 0,
stream: params.stream,
- withDelays: false,
+ objectGeneration: params.generateObject,
+ _additionalOptions: {
+ maxRetries: 0,
+ },
}),
- );
+ });
});
}
});
+
+describe("streamToolsProvider", () => {
+ it("should return the correct stream tools", () => {
+ // test skipped, this is only to validate type inference
+ return;
+
+ // eslint-disable-next-line no-unreachable
+ const editor = BlockNoteEditor.create();
+ const streamTools = htmlBlockLLMFormat
+ .getStreamToolsProvider({
+ defaultStreamTools: {
+ add: true,
+ },
+ })
+ .getStreamTools(editor, true);
+
+ const executor = new StreamToolExecutor(streamTools);
+
+ executor.executeOne({
+ type: "add",
+ blocks: ["test
"],
+ referenceId: "1",
+ position: "after",
+ });
+
+ executor.executeOne({
+ // @ts-expect-error
+ type: "update",
+ blocks: ["test
"],
+ referenceId: "1",
+ position: "after",
+ });
+
+ executor.executeOne({
+ type: "add",
+ // @ts-expect-error
+ blocks: [{ type: "paragraph", content: "test" }],
+ referenceId: "1",
+ position: "after",
+ });
+ });
+});
diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts
index e819271f58..1f0be5f984 100644
--- a/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts
+++ b/packages/xl-ai/src/api/formats/html-blocks/htmlBlocks.ts
@@ -1,36 +1,53 @@
import { BlockNoteEditor } from "@blocknote/core";
import { StreamTool } from "../../../streamTool/streamTool.js";
+import {
+ StreamToolsConfig,
+ StreamToolsProvider,
+ StreamToolsResult,
+} from "../index.js";
import { defaultHTMLPromptBuilder } from "./defaultHTMLPromptBuilder.js";
import {
+ defaultHTMLPromptInputDataBuilder,
getDataForPromptNoSelection,
getDataForPromptWithSelection,
} from "./htmlPromptData.js";
import { tools } from "./tools/index.js";
-function getStreamTools(
+function getStreamTools<
+ T extends StreamToolsConfig = { add: true; update: true; delete: true },
+>(
editor: BlockNoteEditor,
withDelays: boolean,
- defaultStreamTools?: {
- /** Enable the add tool (default: true) */
- add?: boolean;
- /** Enable the update tool (default: true) */
- update?: boolean;
- /** Enable the delete tool (default: true) */
- delete?: boolean;
- },
- selectionInfo?: {
- from: number;
- to: number;
- },
+ defaultStreamTools?: T,
+ selectionInfo?:
+ | {
+ from: number;
+ to: number;
+ }
+ | boolean,
onBlockUpdate?: (blockId: string) => void,
-) {
- const mergedStreamTools = {
- add: true,
- update: true,
- delete: true,
- ...defaultStreamTools,
- };
+): StreamToolsResult {
+ if (typeof selectionInfo === "boolean") {
+ const selection = selectionInfo
+ ? editor.getSelectionCutBlocks()
+ : undefined;
+
+ selectionInfo = selection
+ ? {
+ from: selection._meta.startPos,
+ to: selection._meta.endPos,
+ }
+ : undefined;
+ }
+
+ const mergedStreamTools =
+ defaultStreamTools ??
+ ({
+ add: true,
+ update: true,
+ delete: true,
+ } as T);
const streamTools: StreamTool[] = [
...(mergedStreamTools.update
@@ -51,19 +68,42 @@ function getStreamTools(
: []),
];
- return streamTools;
+ return streamTools as StreamToolsResult;
}
export const htmlBlockLLMFormat = {
/**
* Function to get the stream tools that can apply HTML block updates to the editor
*/
- getStreamTools,
+ getStreamToolsProvider: <
+ T extends StreamToolsConfig = { add: true; update: true; delete: true },
+ >(
+ opts: { withDelays?: boolean; defaultStreamTools?: T } = {},
+ ): StreamToolsProvider => ({
+ getStreamTools: (editor, selectionInfo, onBlockUpdate) => {
+ return getStreamTools(
+ editor,
+ opts.withDelays ?? true,
+ opts.defaultStreamTools,
+ selectionInfo,
+ onBlockUpdate,
+ );
+ },
+ }),
+
+ tools,
+
/**
* The default PromptBuilder that determines how a userPrompt is converted to an array of
* LLM Messages (CoreMessage[])
*/
defaultPromptBuilder: defaultHTMLPromptBuilder,
+
+ /**
+ * The default PromptInputDataBuilder that can take an editor and user request and convert it to the input required for the PromptBuilder
+ */
+ defaultPromptInputDataBuilder: defaultHTMLPromptInputDataBuilder,
+
/**
* Helper functions which can be used when implementing a custom PromptBuilder
*/
diff --git a/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts b/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts
index aeceedd84b..1e99d5b94f 100644
--- a/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts
+++ b/packages/xl-ai/src/api/formats/html-blocks/htmlPromptData.ts
@@ -1,16 +1,47 @@
import { Block, BlockNoteEditor } from "@blocknote/core";
+import { AIRequest } from "../../../index.js";
import { addCursorPosition } from "../../promptHelpers/addCursorPosition.js";
import { convertBlocks } from "../../promptHelpers/convertBlocks.js";
import { flattenBlocks } from "../../promptHelpers/flattenBlocks.js";
import { suffixIDs } from "../../promptHelpers/suffixIds.js";
import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js";
+export type HTMLPromptData = (
+ | Awaited>
+ | Awaited>
+) & {
+ userPrompt: string;
+};
+
+export async function defaultHTMLPromptInputDataBuilder(
+ aiRequest: AIRequest,
+): Promise {
+ if (aiRequest.selectedBlocks) {
+ return {
+ ...(await getDataForPromptWithSelection(aiRequest.editor, {
+ selectedBlocks: aiRequest.selectedBlocks,
+ })),
+ userPrompt: aiRequest.userPrompt,
+ };
+ } else {
+ return {
+ ...(await getDataForPromptNoSelection(aiRequest.editor, {
+ excludeBlockIds: aiRequest.emptyCursorBlockToDelete
+ ? [aiRequest.emptyCursorBlockToDelete]
+ : undefined,
+ })),
+ userPrompt: aiRequest.userPrompt,
+ };
+ }
+}
+
export async function getDataForPromptNoSelection(
editor: BlockNoteEditor,
opts: {
excludeBlockIds?: string[];
},
) {
+ const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0;
const cursorBlockId = editor.getTextCursorPosition().block.id;
const input = trimEmptyBlocks(editor.document, {
cursorBlockId,
@@ -27,7 +58,9 @@ export async function getDataForPromptNoSelection(
);
const suffixed = suffixIDs(filtered);
return {
+ selection: false as const,
htmlBlocks: suffixed,
+ isEmptyDocument,
};
}
@@ -37,6 +70,7 @@ export async function getDataForPromptWithSelection(
selectedBlocks: Block[];
},
) {
+ const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0;
const blockArray = await convertBlocks(
flattenBlocks(opts.selectedBlocks),
async (block) => {
@@ -46,6 +80,8 @@ export async function getDataForPromptWithSelection(
const suffixed = suffixIDs(blockArray);
return {
+ isEmptyDocument,
+ selection: true as const,
htmlSelectedBlocks: suffixed,
htmlDocument: (
await convertBlocks(flattenBlocks(editor.document), async (block) => {
diff --git a/packages/xl-ai/src/api/formats/index.ts b/packages/xl-ai/src/api/formats/index.ts
new file mode 100644
index 0000000000..8c28b19d4d
--- /dev/null
+++ b/packages/xl-ai/src/api/formats/index.ts
@@ -0,0 +1,72 @@
+import { BlockNoteEditor } from "@blocknote/core";
+import { StreamTool } from "../../streamTool/streamTool.js";
+import { AddBlocksToolCall } from "./base-tools/createAddBlocksTool.js";
+import { UpdateBlockToolCall } from "./base-tools/createUpdateBlockTool.js";
+import { DeleteBlockToolCall } from "./base-tools/delete.js";
+import { htmlBlockLLMFormat } from "./html-blocks/htmlBlocks.js";
+import { HTMLPromptData } from "./html-blocks/htmlPromptData.js";
+import { jsonBlockLLMFormat } from "./json/json.js";
+import { markdownBlockLLMFormat } from "./markdown-blocks/markdownBlocks.js";
+import { PromptBuilder } from "./PromptBuilder.js";
+
+// Define the tool types
+export type AddTool = StreamTool>;
+export type UpdateTool = StreamTool>;
+export type DeleteTool = StreamTool;
+
+// Create a conditional type that maps boolean flags to tool types
+export type StreamToolsConfig = {
+ add?: boolean;
+ update?: boolean;
+ delete?: boolean;
+};
+
+export type StreamToolsResult = [
+ ...(T extends { update: true } ? [UpdateTool] : []),
+ ...(T extends { add: true } ? [AddTool] : []),
+ ...(T extends { delete: true } ? [DeleteTool] : []),
+];
+
+export type StreamToolsProvider<
+ TT,
+ T extends StreamToolsConfig = { add: true; update: true; delete: true },
+> = {
+ getStreamTools: (
+ editor: BlockNoteEditor,
+ selectionInfo?:
+ | {
+ from: number;
+ to: number;
+ }
+ | boolean,
+ onBlockUpdate?: (blockId: string) => void,
+ ) => StreamToolsResult;
+};
+
+export type AIDocumentFormat = {
+ /**
+ * Function to get the stream tools that can apply HTML block updates to the editor
+ */
+ getStreamToolsProvider: (
+ withDelays: boolean,
+ defaultStreamTools?: T,
+ ) => StreamToolsProvider;
+ /**
+ * The default PromptBuilder that determines how a userPrompt is converted to an array of
+ * LLM Messages (CoreMessage[])
+ */
+ defaultPromptBuilder: PromptBuilder;
+ /**
+ * Helper functions which can be used when implementing a custom PromptBuilder.
+ * The signature depends on the specific format
+ */
+ promptHelpers: any;
+};
+
+export const aiDocumentFormats = {
+ _experimental_json: jsonBlockLLMFormat,
+ _experimental_markdown: markdownBlockLLMFormat,
+ html: htmlBlockLLMFormat,
+};
+
+export * from "./PromptBuilder.js";
diff --git a/packages/xl-ai/src/api/formats/json/defaultJSONPromptBuilder.ts b/packages/xl-ai/src/api/formats/json/defaultJSONPromptBuilder.ts
index 0b1d7324be..e5b049cdec 100644
--- a/packages/xl-ai/src/api/formats/json/defaultJSONPromptBuilder.ts
+++ b/packages/xl-ai/src/api/formats/json/defaultJSONPromptBuilder.ts
@@ -1,146 +1,173 @@
-import { CoreMessage } from "ai";
-import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js";
-import { PromptBuilder } from "../PromptBuilder.js";
-import {
- getDataForPromptNoSelection,
- getDataForPromptWithSelection,
-} from "./jsonPromptData.js";
+import { UIMessage } from "ai";
+import type { PromptBuilder } from "../PromptBuilder.js";
+import { JSONPromptData } from "./jsonPromptData.js";
-function promptManipulateSelectionJSONBlocks(opts: {
- userPrompt: string;
- jsonSelectedBlocks: any[];
- jsonDocument: any[];
- isEmptyDocument: boolean;
-}): Array {
- return [
- {
- role: "system",
- content: `You're manipulating a selected part of a text document using JSON blocks.
- Make sure to follow the json schema provided and always include the trailing $ in ids.
- This is the selection as an array of JSON blocks:`,
- },
- {
- role: "system",
- content: JSON.stringify(opts.jsonSelectedBlocks),
- },
+function promptManipulateSelectionJSONBlocks(
+ messages: UIMessage[],
+ opts: Exclude,
+): void {
+ if (messages.length > 0) {
+ messages.push(
+ {
+ role: "assistant",
+ id: "document-state-" + messages.length,
+ parts: [
+ {
+ 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: JSON.stringify(opts.jsonSelectedBlocks),
+ },
+ {
+ type: "text",
+ text: "This is the latest state of the document (INCLUDING the selected text), find the selected text in there to understand the context:",
+ },
+ {
+ type: "text",
+ text: JSON.stringify(opts.jsonDocument),
+ },
+ ],
+ },
+ {
+ role: "user",
+ id: "user-prompt-" + messages.length,
+ parts: [
+ {
+ type: "text",
+ text: "The user asks you to do the following:",
+ },
+ {
+ type: "text",
+ text: opts.userPrompt,
+ },
+ ],
+ },
+ );
+ }
+ messages.push(
{
role: "system",
- content:
- "This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:",
- },
- {
- role: "system",
- content: JSON.stringify(opts.jsonDocument),
- },
- {
- role: "system",
- content: "The user asks you to do the following:",
+ id: "document-state-intro",
+ parts: [
+ {
+ type: "text",
+ text: `You're manipulating a selected part of a text document using JSON blocks.
+ Make sure to follow the json schema provided and always include the trailing $ in ids.
+ This is the selection as an array of JSON blocks:`,
+ },
+ {
+ type: "text",
+ text: JSON.stringify(opts.jsonSelectedBlocks),
+ },
+ {
+ type: "text",
+ text: "This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:",
+ },
+ {
+ type: "text",
+ text: JSON.stringify(opts.jsonDocument),
+ },
+ ],
},
{
role: "user",
- content: opts.userPrompt,
+ id: "user-prompt",
+ parts: [
+ {
+ type: "text",
+ text: opts.userPrompt,
+ },
+ ],
},
- ];
+ );
}
-function promptManipulateDocumentUseJSONBlocks(opts: {
- userPrompt: string;
- jsonBlocks: Array<
- | any
- | {
- cursor: true;
- }
- >;
- isEmptyDocument: boolean;
-}): Array {
- return [
- {
- role: "system",
- content: `You're manipulating a text document using JSON blocks.
- Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $).
- This is the document as an array of JSON blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):`,
- },
- {
- role: "system",
- content: JSON.stringify(opts.jsonBlocks),
- },
- ...(opts.isEmptyDocument
- ? ([
+function promptManipulateDocumentUseJSONBlocks(
+ messages: UIMessage[],
+ opts: Exclude,
+): void {
+ if (messages.length > 0) {
+ messages.push(
+ {
+ role: "assistant",
+ id: "document-state-" + messages.length,
+ parts: [
{
- role: "system",
- content: `Because the actual document is empty, this is an example document to understand the schema:`,
+ type: "text",
+ text: `This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document):`,
},
{
- role: "system",
- content: JSON.stringify({
- id: "ref3",
- type: "paragraph",
- content: [
- {
- type: "text",
- text: "Hello, world! ",
- styles: {},
- },
- {
- type: "text",
- text: "Bold text. ",
- styles: {
- bold: true,
- },
- },
- {
- type: "link",
- href: "https://www.w3.org",
- content: "Link.",
- },
- ],
- }),
+ type: "text",
+ text: JSON.stringify(opts.jsonBlocks),
},
- ] satisfies Array)
- : []),
- {
- role: "system",
- content: "The user asks you to do the following:",
- },
+ ],
+ },
+ {
+ role: "user",
+ id: "user-prompt-" + messages.length,
+ parts: [
+ {
+ type: "text",
+ text: opts.userPrompt,
+ },
+ ],
+ },
+ );
+ return;
+ }
+ messages.push(
{
role: "system",
- content:
- `First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.
+ id: "document-state",
+ parts: [
+ {
+ type: "text",
+ text: `You're manipulating a text document using JSON blocks.
+ Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $).
+ This is the initial document as an array of JSON blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):`,
+ },
+ {
+ type: "text",
+ text: JSON.stringify(opts.jsonBlocks),
+ },
+ {
+ type: "text",
+ text:
+ `First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.
EXAMPLE: if user says "below" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor.
- 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\`).
+ 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\`).
` +
- (opts.isEmptyDocument
- ? `Because the document is empty, first update the empty block before adding new blocks.`
- : "Prefer updating existing blocks over removing and adding (but this also depends on the user's question)."),
+ (opts.isEmptyDocument
+ ? `Because the document is empty, first update the empty block before adding new blocks.`
+ : "Prefer updating existing blocks over removing and adding (but this also depends on the user's question)."),
+ },
+ ],
},
{
role: "user",
- content: opts.userPrompt,
+ id: "user-prompt",
+ parts: [
+ {
+ type: "text",
+ text: opts.userPrompt,
+ },
+ ],
},
- ];
+ );
}
-export const defaultJSONPromptBuilder: PromptBuilder = async (editor, opts) => {
- const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0;
-
- if (opts.selectedBlocks) {
- const data = await getDataForPromptWithSelection(editor, {
- selectedBlocks: opts.selectedBlocks,
- });
-
- return promptManipulateSelectionJSONBlocks({
- ...data,
- userPrompt: opts.userPrompt,
- isEmptyDocument,
- });
+export const defaultJSONPromptBuilder: PromptBuilder = async (
+ messages,
+ inputData,
+) => {
+ if (inputData.selection) {
+ promptManipulateSelectionJSONBlocks(messages, inputData);
} else {
- const data = await getDataForPromptNoSelection(editor, opts);
- return promptManipulateDocumentUseJSONBlocks({
- ...data,
- userPrompt: opts.userPrompt,
- isEmptyDocument,
- });
+ promptManipulateDocumentUseJSONBlocks(messages, inputData);
}
};
diff --git a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts
index 5edee6b452..851f3c7d89 100644
--- a/packages/xl-ai/src/api/formats/json/errorHandling.test.ts
+++ b/packages/xl-ai/src/api/formats/json/errorHandling.test.ts
@@ -1,25 +1,20 @@
import { afterAll, afterEach, beforeAll, describe, expect, it } from "vitest";
-import { createOpenAI } from "@ai-sdk/openai";
import { BlockNoteEditor } from "@blocknote/core";
import { HttpResponse, http } from "msw";
import { setupServer } from "msw/node";
-import { createBlockNoteAIClient } from "../../../blocknoteAIClient/client.js";
-import { doLLMRequest } from "../../LLMRequest.js";
-import { jsonLLMFormat } from "./json.js";
-// Create client and models outside of test suites so they can be shared
-const client = createBlockNoteAIClient({
- baseURL: "https://localhost:3000/ai",
- apiKey: "PLACEHOLDER",
-});
-
-const openai = createOpenAI({
- ...client.getProviderSettings("openai"),
-})("gpt-4o-2024-08-06", {});
+import { Chat } from "@ai-sdk/react";
+import { UIMessage } from "ai";
+import { aiDocumentFormats } from "../../../index.js";
+import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js";
+import { testAIModels } from "../../../testUtil/testAIModels.js";
+import { defaultAIRequestSender } from "../../aiRequest/defaultAIRequestSender.js";
+import { buildAIRequest, executeAIRequest } from "../../aiRequest/execute.js";
// Separate test suite for error handling with its own server
-describe("Error handling", () => {
+// skipping because it throws a (false) unhandled promise rejection in vitest
+describe.skip("Error handling", () => {
// Create a separate server for error tests with custom handlers
const errorServer = setupServer();
@@ -35,60 +30,77 @@ describe("Error handling", () => {
errorServer.resetHandlers();
});
- it("handles 429 Too Many Requests error", async () => {
- // Set up handler for this specific test
- errorServer.use(
- http.post("*", () => {
- return new HttpResponse(
- JSON.stringify({
- error: {
- message: "Rate limit exceeded, please try again later",
- type: "rate_limit_exceeded",
- code: "rate_limit_exceeded",
+ [{ stream: true }, { stream: false }].forEach(({ stream }) => {
+ it(`handles 429 Too Many Requests error ${stream ? "streaming" : "non-streaming"}`, async () => {
+ // Set up handler for this specific test
+ errorServer.use(
+ http.post("*", () => {
+ return new HttpResponse(
+ JSON.stringify({
+ error: {
+ message: "Rate limit exceeded, please try again later",
+ type: "rate_limit_exceeded",
+ code: "rate_limit_exceeded",
+ },
+ }),
+ {
+ status: 429,
+ headers: {
+ "Content-Type": "application/json",
+ },
},
- }),
+ );
+ }),
+ );
+
+ const editor = BlockNoteEditor.create({
+ initialContent: [
{
- status: 429,
- headers: {
- "Content-Type": "application/json",
- },
+ type: "paragraph",
+ content: "Hello world",
},
- );
- }),
- );
-
- const editor = BlockNoteEditor.create({
- initialContent: [
- {
- type: "paragraph",
- content: "Hello world",
- },
- ],
- });
+ ],
+ });
- // Use a flag to track if an error was thrown
- let errorThrown = false;
- let caughtError: any = null;
+ // Use a flag to track if an error was thrown
+ let errorThrown = false;
+ let caughtError: any = null;
- try {
- const result = await doLLMRequest(editor, {
- stream: true,
- userPrompt: "translate to Spanish",
- model: openai,
- maxRetries: 0,
- dataFormat: jsonLLMFormat,
- });
- await result.execute();
- } catch (error: any) {
- errorThrown = true;
- caughtError = error;
- }
+ try {
+ const chat = new Chat({
+ sendAutomaticallyWhen: () => false,
+ transport: new ClientSideTransport({
+ model: testAIModels.openai,
+ stream,
+ _additionalOptions: {
+ maxRetries: 0,
+ },
+ objectGeneration: true, // TODO: switch to text
+ }),
+ });
+ const aiRequest = buildAIRequest({
+ editor,
+ chat,
+ userPrompt: "translate to Spanish",
+ });
+ await executeAIRequest({
+ aiRequest,
+ sender: defaultAIRequestSender(
+ aiDocumentFormats.html.defaultPromptBuilder,
+ aiDocumentFormats.html.defaultPromptInputDataBuilder,
+ ),
+ });
+ } catch (error: any) {
+ errorThrown = true;
+ caughtError = error;
+ }
- // Assertions outside the try/catch
- expect(errorThrown).toBe(true);
- expect(caughtError).toBeDefined();
- expect(caughtError.message || caughtError.toString()).toContain(
- "Rate limit exceeded, please try again later",
- );
+ // Assertions outside the try/catch
+ expect(errorThrown).toBe(true);
+ expect(caughtError).toBeDefined();
+ expect(caughtError.message || caughtError.toString()).toContain(
+ "Rate limit exceeded, please try again later",
+ );
+ });
});
});
diff --git a/packages/xl-ai/src/api/formats/json/json.test.ts b/packages/xl-ai/src/api/formats/json/json.test.ts
index 16abc26e43..3a30076da6 100644
--- a/packages/xl-ai/src/api/formats/json/json.test.ts
+++ b/packages/xl-ai/src/api/formats/json/json.test.ts
@@ -6,9 +6,10 @@ import { setupServer } from "msw/node";
import path from "path";
import { generateSharedTestCases } from "../tests/sharedTestCases.js";
+import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js";
import { testAIModels } from "../../../testUtil/testAIModels.js";
-import { doLLMRequest } from "../../LLMRequest.js";
-import { jsonLLMFormat } from "./json.js";
+import { defaultAIRequestSender } from "../../aiRequest/defaultAIRequestSender.js";
+import { aiDocumentFormats } from "../../index.js";
const BASE_FILE_PATH = path.resolve(
__dirname,
@@ -112,16 +113,24 @@ describe.skip("Models", () => {
describe(`${params.model.provider}/${params.model.modelId} (${
params.stream ? "streaming" : "non-streaming"
})`, () => {
- generateSharedTestCases((editor, options) =>
- doLLMRequest(editor, {
- ...options,
- stream: params.stream,
+ generateSharedTestCases({
+ streamToolsProvider:
+ aiDocumentFormats._experimental_json.getStreamToolsProvider({
+ withDelays: false,
+ }),
+ aiRequestSender: defaultAIRequestSender(
+ aiDocumentFormats._experimental_json.defaultPromptBuilder,
+ aiDocumentFormats._experimental_json.defaultPromptInputDataBuilder,
+ ),
+ transport: new ClientSideTransport({
model: params.model,
- maxRetries: 0,
- withDelays: false,
- dataFormat: jsonLLMFormat,
+ stream: params.stream,
+ objectGeneration: true,
+ _additionalOptions: {
+ maxRetries: 0,
+ },
}),
- );
+ });
});
}
});
diff --git a/packages/xl-ai/src/api/formats/json/json.ts b/packages/xl-ai/src/api/formats/json/json.ts
index cceba2d5c3..93484b6815 100644
--- a/packages/xl-ai/src/api/formats/json/json.ts
+++ b/packages/xl-ai/src/api/formats/json/json.ts
@@ -1,34 +1,53 @@
import { BlockNoteEditor } from "@blocknote/core";
import { StreamTool } from "../../../streamTool/streamTool.js";
-import { defaultJSONPromptBuilder } from "./defaultJSONPromptBuilder.js";
+
import {
+ defaultJSONPromptDataBuilder,
getDataForPromptNoSelection,
getDataForPromptWithSelection,
} from "./jsonPromptData.js";
import { tools } from "./tools/index.js";
-function getStreamTools(
+// Import the tool call types
+import { StreamToolsProvider } from "../../index.js";
+import { defaultJSONPromptBuilder } from "./defaultJSONPromptBuilder.js";
+
+import { StreamToolsConfig, StreamToolsResult } from "../index.js";
+
+function getStreamTools<
+ T extends StreamToolsConfig = { add: true; update: true; delete: true },
+>(
editor: BlockNoteEditor,
withDelays: boolean,
- defaultStreamTools?: {
- /** Enable the add tool (default: true) */
- add?: boolean;
- /** Enable the update tool (default: true) */
- update?: boolean;
- /** Enable the delete tool (default: true) */
- delete?: boolean;
- },
- selectionInfo?: {
- from: number;
- to: number;
- },
-) {
- const mergedStreamTools = {
- add: true,
- update: true,
- delete: true,
- ...defaultStreamTools,
- };
+ defaultStreamTools?: T,
+ selectionInfo?:
+ | {
+ from: number;
+ to: number;
+ }
+ | boolean,
+ onBlockUpdate?: (blockId: string) => void,
+): StreamToolsResult {
+ if (typeof selectionInfo === "boolean") {
+ const selection = selectionInfo
+ ? editor.getSelectionCutBlocks()
+ : undefined;
+
+ selectionInfo = selection
+ ? {
+ from: selection._meta.startPos,
+ to: selection._meta.endPos,
+ }
+ : undefined;
+ }
+
+ const mergedStreamTools =
+ defaultStreamTools ??
+ ({
+ add: true,
+ update: true,
+ delete: true,
+ } as T);
const streamTools: StreamTool[] = [
...(mergedStreamTools.update
@@ -37,30 +56,54 @@ function getStreamTools(
idsSuffixed: true,
withDelays,
updateSelection: selectionInfo,
+ onBlockUpdate,
}),
]
: []),
...(mergedStreamTools.add
- ? [tools.add(editor, { idsSuffixed: true, withDelays })]
+ ? [tools.add(editor, { idsSuffixed: true, withDelays, onBlockUpdate })]
: []),
...(mergedStreamTools.delete
- ? [tools.delete(editor, { idsSuffixed: true, withDelays })]
+ ? [tools.delete(editor, { idsSuffixed: true, withDelays, onBlockUpdate })]
: []),
];
- return streamTools;
+ return streamTools as StreamToolsResult;
}
-export const jsonLLMFormat = {
+export const jsonBlockLLMFormat = {
/**
- * Function to get the stream tools that can apply BlockNote JSON block updates to the editor
+ * Function to get the stream tools that can apply JSON block updates to the editor
*/
- getStreamTools,
+ getStreamToolsProvider: <
+ T extends StreamToolsConfig = { add: true; update: true; delete: true },
+ >(
+ opts: { withDelays?: boolean; defaultStreamTools?: T } = {},
+ ): StreamToolsProvider => ({
+ getStreamTools: (editor, selectionInfo, onBlockUpdate) => {
+ return getStreamTools(
+ editor,
+ opts.withDelays ?? true,
+ opts.defaultStreamTools,
+ selectionInfo,
+ onBlockUpdate,
+ );
+ },
+ }),
+
+ tools,
+
/**
* The default PromptBuilder that determines how a userPrompt is converted to an array of
* LLM Messages (CoreMessage[])
*/
defaultPromptBuilder: defaultJSONPromptBuilder,
+
+ /**
+ * The default PromptInputDataBuilder that can take an editor and user request and convert it to the input required for the PromptBuilder
+ */
+ defaultPromptInputDataBuilder: defaultJSONPromptDataBuilder,
+
/**
* Helper functions which can be used when implementing a custom PromptBuilder
*/
diff --git a/packages/xl-ai/src/api/formats/json/jsonPromptData.ts b/packages/xl-ai/src/api/formats/json/jsonPromptData.ts
index 2ac81328f3..2c9b0395fc 100644
--- a/packages/xl-ai/src/api/formats/json/jsonPromptData.ts
+++ b/packages/xl-ai/src/api/formats/json/jsonPromptData.ts
@@ -1,16 +1,45 @@
import { Block, BlockNoteEditor } from "@blocknote/core";
+import { AIRequest } from "../../../index.js";
import { addCursorPosition } from "../../promptHelpers/addCursorPosition.js";
import { convertBlocks } from "../../promptHelpers/convertBlocks.js";
import { flattenBlocks } from "../../promptHelpers/flattenBlocks.js";
import { suffixIDs } from "../../promptHelpers/suffixIds.js";
import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js";
+export type JSONPromptData = (
+ | Awaited>
+ | Awaited>
+) & {
+ userPrompt: string;
+};
+
+export async function defaultJSONPromptDataBuilder(aiRequest: AIRequest) {
+ if (aiRequest.selectedBlocks) {
+ return {
+ ...(await getDataForPromptWithSelection(aiRequest.editor, {
+ selectedBlocks: aiRequest.selectedBlocks,
+ })),
+ userPrompt: aiRequest.userPrompt,
+ };
+ } else {
+ return {
+ ...(await getDataForPromptNoSelection(aiRequest.editor, {
+ excludeBlockIds: aiRequest.emptyCursorBlockToDelete
+ ? [aiRequest.emptyCursorBlockToDelete]
+ : undefined,
+ })),
+ userPrompt: aiRequest.userPrompt,
+ };
+ }
+}
+
export async function getDataForPromptNoSelection(
editor: BlockNoteEditor,
opts: {
excludeBlockIds?: string[];
},
) {
+ const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0;
const cursorBlockId = editor.getTextCursorPosition().block.id;
const input = trimEmptyBlocks(editor.document, {
cursorBlockId,
@@ -30,7 +59,9 @@ export async function getDataForPromptNoSelection(
);
const suffixed = suffixIDs(filtered);
return {
+ selection: false as const,
jsonBlocks: suffixed,
+ isEmptyDocument,
};
}
@@ -40,6 +71,7 @@ export async function getDataForPromptWithSelection(
selectedBlocks: Block[];
},
) {
+ const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0;
const blockArray = await convertBlocks(
flattenBlocks(opts.selectedBlocks),
async (block) => {
@@ -49,6 +81,8 @@ export async function getDataForPromptWithSelection(
const suffixed = suffixIDs(blockArray);
return {
+ isEmptyDocument,
+ selection: true as const,
jsonSelectedBlocks: suffixed,
jsonDocument: (
await convertBlocks(flattenBlocks(editor.document), async (block) => {
diff --git a/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts b/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts
index 065a09b5ac..6791375a1f 100644
--- a/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts
+++ b/packages/xl-ai/src/api/formats/json/tools/jsontools.test.ts
@@ -6,8 +6,7 @@ import { combinedOperationsTestCases } from "../../../../testUtil/cases/combined
import { deleteOperationTestCases } from "../../../../testUtil/cases/deleteOperationTestCases.js";
import { DocumentOperationTestCase } from "../../../../testUtil/cases/index.js";
import { updateOperationTestCases } from "../../../../testUtil/cases/updateOperationTestCases.js";
-import { createAsyncIterableStreamFromAsyncIterable } from "../../../../util/stream.js";
-import { LLMResponse } from "../../../LLMResponse.js";
+
import { AddBlocksToolCall } from "../../base-tools/createAddBlocksTool.js";
import { UpdateBlockToolCall } from "../../base-tools/createUpdateBlockTool.js";
import { DeleteBlockToolCall } from "../../base-tools/delete.js";
@@ -15,8 +14,11 @@ import { tools } from "./index.js";
// Helper function to create a mock stream from operations
import { getAIExtension } from "../../../../AIExtension.js";
+import { StreamToolExecutor } from "../../../../streamTool/StreamToolExecutor.js";
+import { StreamTool } from "../../../../streamTool/streamTool.js";
import { getExpectedEditor } from "../../../../testUtil/cases/index.js";
import { validateRejectingResultsInOriginalDoc } from "../../../../testUtil/suggestChangesTestUtil.js";
+
async function* createMockStream(
...operations: {
operation:
@@ -31,6 +33,7 @@ async function* createMockStream(
yield {
isUpdateToPreviousOperation: false,
isPossiblyPartial: false,
+ metadata: undefined,
...op,
};
}
@@ -55,26 +58,14 @@ async function executeTestCase(
...testCase.baseToolCalls.map((u) => ({ operation: u })),
);
- // bit hacky way to instantiate an LLMResponse just so we can call execute
- const result = new LLMResponse(
- undefined as any,
- {
- operationsSource: createAsyncIterableStreamFromAsyncIterable(stream),
- streamObjectResult: undefined,
- generateObjectResult: undefined,
- getGeneratedOperations: undefined as any,
- },
- streamTools,
- );
+ const executor = new StreamToolExecutor(streamTools as StreamTool[]); // TODO: fix cast
- await result.execute();
+ await executor.execute(stream);
validateRejectingResultsInOriginalDoc(editor, originalDoc);
getAIExtension(editor).acceptChanges();
expect(editor.document).toEqual(getExpectedEditor(testCase).document);
-
- return result;
}
describe("Add", () => {
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/defaultMarkdownPromptBuilder.ts b/packages/xl-ai/src/api/formats/markdown-blocks/defaultMarkdownPromptBuilder.ts
index 5d76927ec1..155ea95405 100644
--- a/packages/xl-ai/src/api/formats/markdown-blocks/defaultMarkdownPromptBuilder.ts
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/defaultMarkdownPromptBuilder.ts
@@ -1,111 +1,172 @@
-import { CoreMessage } from "ai";
-import { PromptBuilder } from "../PromptBuilder.js";
-import {
- getDataForPromptNoSelection,
- getDataForPromptWithSelection,
-} from "./markdownPromptData.js";
+import { UIMessage } from "ai";
+import type { PromptBuilder } from "../PromptBuilder.js";
+import { MarkdownPromptData } from "./markdownPromptData.js";
-function promptManipulateSelectionMarkdownBlocks(opts: {
- userPrompt: string;
- markdownSelectedBlocks: {
- id: string;
- block: string;
- }[];
- markdownDocument: {
- block: string;
- }[];
-}): Array {
- return [
- {
- role: "system",
- content: `You're manipulating a selected part of a text document using markdown blocks.
- Make sure to follow the json schema provided and always include the trailing $ in ids.
- This is the selection as an array of markdown blocks:`,
- },
- {
- role: "system",
- content: JSON.stringify(opts.markdownSelectedBlocks),
- },
+function promptManipulateSelectionMarkdownBlocks(
+ messages: UIMessage[],
+ opts: Exclude,
+): void {
+ if (messages.length > 0) {
+ messages.push(
+ {
+ role: "assistant",
+ id: "document-state-" + messages.length,
+ parts: [
+ {
+ 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: JSON.stringify(opts.markdownSelectedBlocks),
+ },
+ {
+ type: "text",
+ text: "This is the latest state of the document (INCLUDING the selected text), find the selected text in there to understand the context:",
+ },
+ {
+ type: "text",
+ text: JSON.stringify(opts.markdownDocument),
+ },
+ ],
+ },
+ {
+ role: "user",
+ id: "user-prompt-" + messages.length,
+ parts: [
+ {
+ type: "text",
+ text: "The user asks you to do the following:",
+ },
+ {
+ type: "text",
+ text: opts.userPrompt,
+ },
+ ],
+ },
+ );
+ }
+ messages.push(
{
role: "system",
- content:
- "This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:",
- },
- {
- role: "system",
- content: JSON.stringify(opts.markdownDocument),
- },
- {
- role: "system",
- content: "The user asks you to do the following:",
+ id: "document-state-intro",
+ parts: [
+ {
+ type: "text",
+ text: `You're manipulating a selected part of a text document using Markdown blocks.
+ Make sure to follow the json schema provided and always include the trailing $ in ids.
+ This is the selection as an array of Markdown blocks:`,
+ },
+ {
+ type: "text",
+ text: JSON.stringify(opts.markdownSelectedBlocks),
+ },
+ {
+ type: "text",
+ text: "This is the entire document (INCLUDING the selected text), find the selected text in there to understand the context:",
+ },
+ {
+ type: "text",
+ text: JSON.stringify(opts.markdownDocument),
+ },
+ ],
},
{
role: "user",
- content: opts.userPrompt,
+ id: "user-prompt",
+ parts: [
+ {
+ type: "text",
+ text: opts.userPrompt,
+ },
+ ],
},
- ];
+ );
}
-function promptManipulateDocumentUseMarkdownBlocks(opts: {
- userPrompt: string;
- markdownBlocks: Array<
- | {
- id: string;
- block: string;
- }
- | {
- cursor: true;
- }
- >;
-}): Array {
- return [
+function promptManipulateDocumentUseMarkdownBlocks(
+ messages: UIMessage[],
+ opts: Exclude,
+): void {
+ if (messages.length > 0) {
+ messages.push(
+ {
+ role: "assistant",
+ id: "document-state-" + messages.length,
+ parts: [
+ {
+ type: "text",
+ text: `This is the latest state of the document (ignore previous documents, you MUST issue operations against this latest version of the document):`,
+ },
+ {
+ type: "text",
+ text: JSON.stringify(opts.markdownBlocks),
+ },
+ ],
+ },
+ {
+ role: "user",
+ id: "user-prompt-" + messages.length,
+ parts: [
+ {
+ type: "text",
+ text: opts.userPrompt,
+ },
+ ],
+ },
+ );
+ return;
+ }
+ messages.push(
{
role: "system",
- content: `You're manipulating a text document using markdown blocks.
+ id: "document-state",
+ parts: [
+ {
+ type: "text",
+ text: `You're manipulating a text document using Markdown blocks.
Make sure to follow the json schema provided. When referencing ids they MUST be EXACTLY the same (including the trailing $).
- This is the document as an array of markdown blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):`,
- },
- {
- role: "system",
- content: JSON.stringify(opts.markdownBlocks),
- },
- {
- role: "system",
- content: "The user asks you to do the following:",
+ This is the initial document as an array of Markdown blocks (the cursor is BETWEEN two blocks as indicated by cursor: true):`,
+ },
+ {
+ type: "text",
+ text: JSON.stringify(opts.markdownBlocks),
+ },
+ {
+ type: "text",
+ text:
+ `First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.
+ EXAMPLE: if user says "below" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor.
+ 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\`).
+
+ ` +
+ (opts.isEmptyDocument
+ ? `Because the document is empty, first update the empty block before adding new blocks.`
+ : "Prefer updating existing blocks over removing and adding (but this also depends on the user's question)."),
+ },
+ ],
},
{
role: "user",
- content: opts.userPrompt,
- },
- {
- role: "system",
- content: `First, determine what part of the document the user is talking about. You SHOULD probably take cursor info into account if needed.
- EXAMPLE: if user says "below" (without pointing to a specific part of the document) he / she probably indicates the block(s) after the cursor.
- 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\`).
-
- Prefer updating blocks over adding or removing (but this also depends on the user's question).`,
+ id: "user-prompt",
+ parts: [
+ {
+ type: "text",
+ text: opts.userPrompt,
+ },
+ ],
},
- ];
+ );
}
-export const defaultMarkdownPromptBuilder: PromptBuilder = async (
- editor,
- opts,
-) => {
- if (opts.selectedBlocks) {
- const data = await getDataForPromptWithSelection(editor, {
- selectedBlocks: opts.selectedBlocks,
- });
- return promptManipulateSelectionMarkdownBlocks({
- ...data,
- userPrompt: opts.userPrompt,
- });
+export const defaultMarkdownPromptBuilder: PromptBuilder<
+ MarkdownPromptData
+> = async (messages, inputData) => {
+ if (inputData.selection) {
+ promptManipulateSelectionMarkdownBlocks(messages, inputData);
} else {
- const data = await getDataForPromptNoSelection(editor, opts);
- return promptManipulateDocumentUseMarkdownBlocks({
- ...data,
- userPrompt: opts.userPrompt,
- });
+ promptManipulateDocumentUseMarkdownBlocks(messages, inputData);
}
};
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts
index 4bb89079f6..1c52a1c766 100644
--- a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.ts
@@ -4,10 +4,12 @@ import { getCurrentTest } from "@vitest/runner";
import { getSortedEntries, snapshot, toHashString } from "msw-snapshot";
import { setupServer } from "msw/node";
import path from "path";
+
+import { ClientSideTransport } from "../../../streamTool/vercelAiSdk/clientside/ClientSideTransport.js";
import { testAIModels } from "../../../testUtil/testAIModels.js";
-import { doLLMRequest } from "../../LLMRequest.js";
+import { defaultAIRequestSender } from "../../aiRequest/defaultAIRequestSender.js";
+import { aiDocumentFormats } from "../../index.js";
import { generateSharedTestCases } from "../tests/sharedTestCases.js";
-import { markdownBlocksLLMFormat } from "./markdownBlocks.js";
const BASE_FILE_PATH = path.resolve(
__dirname,
@@ -111,22 +113,25 @@ describe("Models", () => {
params.stream ? "streaming" : "non-streaming"
})`, () => {
generateSharedTestCases(
- (editor, options) =>
- doLLMRequest(editor, {
- ...options,
+ {
+ streamToolsProvider:
+ aiDocumentFormats._experimental_markdown.getStreamToolsProvider({
+ withDelays: false,
+ }),
+ aiRequestSender: defaultAIRequestSender(
+ aiDocumentFormats._experimental_markdown.defaultPromptBuilder,
+ aiDocumentFormats._experimental_markdown
+ .defaultPromptInputDataBuilder,
+ ),
+ transport: new ClientSideTransport({
model: params.model,
- maxRetries: 0,
stream: params.stream,
- withDelays: false,
- dataFormat: markdownBlocksLLMFormat,
- // _generateObjectOptions: {
- // providerOptions: {
- // "albert-etalab": {
- // guided_decoding_backend: "outlines",
- // },
- // },
- // },
+ objectGeneration: true,
+ _additionalOptions: {
+ maxRetries: 0,
+ },
}),
+ },
// markdownblocks doesn't support these:
{
mentions: true,
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts
index 3b0af6c164..389754a8d1 100644
--- a/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.ts
@@ -1,34 +1,53 @@
import { BlockNoteEditor } from "@blocknote/core";
import { StreamTool } from "../../../streamTool/streamTool.js";
-import { defaultMarkdownPromptBuilder } from "./defaultMarkdownPromptBuilder.js";
+
import {
getDataForPromptNoSelection,
getDataForPromptWithSelection,
} from "./markdownPromptData.js";
import { tools } from "./tools/index.js";
-function getStreamTools(
+// Import the tool call types
+import { StreamToolsProvider } from "../../index.js";
+import { defaultMarkdownPromptBuilder } from "./defaultMarkdownPromptBuilder.js";
+import { defaultMarkdownPromptDataBuilder } from "./markdownPromptData.js";
+
+import { StreamToolsConfig, StreamToolsResult } from "../index.js";
+
+function getStreamTools<
+ T extends StreamToolsConfig = { add: true; update: true; delete: true },
+>(
editor: BlockNoteEditor,
withDelays: boolean,
- defaultStreamTools?: {
- /** Enable the add tool (default: true) */
- add?: boolean;
- /** Enable the update tool (default: true) */
- update?: boolean;
- /** Enable the delete tool (default: true) */
- delete?: boolean;
- },
- selectionInfo?: {
- from: number;
- to: number;
- },
-) {
- const mergedStreamTools = {
- add: true,
- update: true,
- delete: true,
- ...defaultStreamTools,
- };
+ defaultStreamTools?: T,
+ selectionInfo?:
+ | {
+ from: number;
+ to: number;
+ }
+ | boolean,
+ onBlockUpdate?: (blockId: string) => void,
+): StreamToolsResult {
+ if (typeof selectionInfo === "boolean") {
+ const selection = selectionInfo
+ ? editor.getSelectionCutBlocks()
+ : undefined;
+
+ selectionInfo = selection
+ ? {
+ from: selection._meta.startPos,
+ to: selection._meta.endPos,
+ }
+ : undefined;
+ }
+
+ const mergedStreamTools =
+ defaultStreamTools ??
+ ({
+ add: true,
+ update: true,
+ delete: true,
+ } as T);
const streamTools: StreamTool[] = [
...(mergedStreamTools.update
@@ -37,30 +56,54 @@ function getStreamTools(
idsSuffixed: true,
withDelays,
updateSelection: selectionInfo,
+ onBlockUpdate,
}),
]
: []),
...(mergedStreamTools.add
- ? [tools.add(editor, { idsSuffixed: true, withDelays })]
+ ? [tools.add(editor, { idsSuffixed: true, withDelays, onBlockUpdate })]
: []),
...(mergedStreamTools.delete
- ? [tools.delete(editor, { idsSuffixed: true, withDelays })]
+ ? [tools.delete(editor, { idsSuffixed: true, withDelays, onBlockUpdate })]
: []),
];
- return streamTools;
+ return streamTools as StreamToolsResult;
}
-export const markdownBlocksLLMFormat = {
+export const markdownBlockLLMFormat = {
/**
- * Function to get the stream tools that can apply BlockNote Markdown block updates to the editor
+ * Function to get the stream tools that can apply Markdown block updates to the editor
*/
- getStreamTools,
+ getStreamToolsProvider: <
+ T extends StreamToolsConfig = { add: true; update: true; delete: true },
+ >(
+ opts: { withDelays?: boolean; defaultStreamTools?: T } = {},
+ ): StreamToolsProvider => ({
+ getStreamTools: (editor, selectionInfo, onBlockUpdate) => {
+ return getStreamTools(
+ editor,
+ opts.withDelays ?? true,
+ opts.defaultStreamTools,
+ selectionInfo,
+ onBlockUpdate,
+ );
+ },
+ }),
+
+ tools,
+
/**
* The default PromptBuilder that determines how a userPrompt is converted to an array of
* LLM Messages (CoreMessage[])
*/
defaultPromptBuilder: defaultMarkdownPromptBuilder,
+
+ /**
+ * The default PromptInputDataBuilder that can take an editor and user request and convert it to the input required for the PromptBuilder
+ */
+ defaultPromptInputDataBuilder: defaultMarkdownPromptDataBuilder,
+
/**
* Helper functions which can be used when implementing a custom PromptBuilder
*/
diff --git a/packages/xl-ai/src/api/formats/markdown-blocks/markdownPromptData.ts b/packages/xl-ai/src/api/formats/markdown-blocks/markdownPromptData.ts
index 91394e738d..faec6bf397 100644
--- a/packages/xl-ai/src/api/formats/markdown-blocks/markdownPromptData.ts
+++ b/packages/xl-ai/src/api/formats/markdown-blocks/markdownPromptData.ts
@@ -1,16 +1,46 @@
import { Block, BlockNoteEditor } from "@blocknote/core";
+
+import { AIRequest } from "../../../index.js";
import { addCursorPosition } from "../../promptHelpers/addCursorPosition.js";
import { convertBlocks } from "../../promptHelpers/convertBlocks.js";
import { flattenBlocks } from "../../promptHelpers/flattenBlocks.js";
import { suffixIDs } from "../../promptHelpers/suffixIds.js";
import { trimEmptyBlocks } from "../../promptHelpers/trimEmptyBlocks.js";
+export type MarkdownPromptData = (
+ | Awaited>
+ | Awaited>
+) & {
+ userPrompt: string;
+};
+
+export async function defaultMarkdownPromptDataBuilder(aiRequest: AIRequest) {
+ if (aiRequest.selectedBlocks) {
+ return {
+ ...(await getDataForPromptWithSelection(aiRequest.editor, {
+ selectedBlocks: aiRequest.selectedBlocks,
+ })),
+ userPrompt: aiRequest.userPrompt,
+ };
+ } else {
+ return {
+ ...(await getDataForPromptNoSelection(aiRequest.editor, {
+ excludeBlockIds: aiRequest.emptyCursorBlockToDelete
+ ? [aiRequest.emptyCursorBlockToDelete]
+ : undefined,
+ })),
+ userPrompt: aiRequest.userPrompt,
+ };
+ }
+}
+
export async function getDataForPromptNoSelection(
editor: BlockNoteEditor,
opts: {
excludeBlockIds?: string[];
},
) {
+ const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0;
const cursorBlockId = editor.getTextCursorPosition().block.id;
const input = trimEmptyBlocks(editor.document, {
cursorBlockId,
@@ -27,14 +57,19 @@ export async function getDataForPromptNoSelection(
);
const suffixed = suffixIDs(filtered);
return {
+ selection: false as const,
markdownBlocks: suffixed,
+ isEmptyDocument,
};
}
export async function getDataForPromptWithSelection(
editor: BlockNoteEditor,
- opts: { selectedBlocks: Block[] },
+ opts: {
+ selectedBlocks: Block[];
+ },
) {
+ const isEmptyDocument = trimEmptyBlocks(editor.document).length === 0;
const blockArray = await convertBlocks(
flattenBlocks(opts.selectedBlocks),
async (block) => {
@@ -44,6 +79,8 @@ export async function getDataForPromptWithSelection(
const suffixed = suffixIDs(blockArray);
return {
+ isEmptyDocument,
+ selection: true as const,
markdownSelectedBlocks: suffixed,
markdownDocument: (
await convertBlocks(flattenBlocks(editor.document), async (block) => {
diff --git a/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts b/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts
index a2026ff442..d32533865c 100644
--- a/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts
+++ b/packages/xl-ai/src/api/formats/tests/sharedTestCases.ts
@@ -1,9 +1,11 @@
+import { Chat, UIMessage } from "@ai-sdk/react";
import { BlockNoteEditor } from "@blocknote/core";
import { getCurrentTest, TaskContext } from "@vitest/runner";
import path from "path";
import { TextSelection } from "prosemirror-state";
import { describe, expect, it } from "vitest";
import { getAIExtension } from "../../../AIExtension.js";
+import { aiDocumentFormats, defaultAIRequestSender } from "../../../index.js";
import { addOperationTestCases } from "../../../testUtil/cases/addOperationTestCases.js";
import { combinedOperationsTestCases } from "../../../testUtil/cases/combinedOperationsTestCases.js";
import { deleteOperationTestCases } from "../../../testUtil/cases/deleteOperationTestCases.js";
@@ -13,7 +15,8 @@ import {
} from "../../../testUtil/cases/index.js";
import { updateOperationTestCases } from "../../../testUtil/cases/updateOperationTestCases.js";
import { validateRejectingResultsInOriginalDoc } from "../../../testUtil/suggestChangesTestUtil.js";
-import { LLMResponse } from "../../LLMResponse.js";
+import { AIRequestHelpers } from "../../../types.js";
+import { buildAIRequest, executeAIRequest } from "../../aiRequest/execute.js";
const BASE_FILE_PATH = path.resolve(__dirname, "__snapshots__");
@@ -32,10 +35,7 @@ async function matchFileSnapshot(data: any, postFix = "") {
}
export function generateSharedTestCases(
- callLLM: (
- editor: BlockNoteEditor,
- params: { userPrompt: string; useSelection?: boolean },
- ) => Promise,
+ aiOptions: AIRequestHelpers,
skipTestsRequiringCapabilities?: {
mentions?: boolean;
textAlignment?: boolean;
@@ -75,13 +75,38 @@ export function generateSharedTestCases(
const originalDoc = editor.prosemirrorState.doc;
- const result = await callLLM(editor, {
+ const chat = new Chat({
+ sendAutomaticallyWhen: () => false,
+ transport: aiOptions.transport,
+ });
+
+ const aiRequest = buildAIRequest({
+ editor,
+ chat,
userPrompt: test.userPrompt,
useSelection: selection !== undefined,
+ streamToolsProvider: aiOptions.streamToolsProvider,
});
+ const sender =
+ aiOptions.aiRequestSender ??
+ defaultAIRequestSender(
+ aiDocumentFormats.html.defaultPromptBuilder,
+ aiDocumentFormats.html.defaultPromptInputDataBuilder,
+ );
+
+ await executeAIRequest({
+ aiRequest,
+ sender,
+ chatRequestOptions: aiOptions.chatRequestOptions,
+ });
+
+ // const result = await callLLM(editor, {
+ // userPrompt: test.userPrompt,
+ // useSelection: selection !== undefined,
+ // });
// await result._logToolCalls();
- await result.execute();
+ // await result.execute();
// the prosemirrorState has all details with suggested changes
// This can be used for snapshots, but currently we've disabled this as there can
@@ -89,7 +114,7 @@ export function generateSharedTestCases(
// granularity of the suggested changes. Can be enabled for debugging:
// await matchFileSnapshot(editor.prosemirrorState.doc.toJSON());
-
+ // console.log(JSON.stringify(editor.prosemirrorState.doc.toJSON(), null, 2));
validateRejectingResultsInOriginalDoc(editor, originalDoc);
// we first need to accept changes to get the correct result
diff --git a/packages/xl-ai/src/api/formats/tests/validateTestEnvironment.test.ts b/packages/xl-ai/src/api/formats/tests/validateTestEnvironment.test.ts
index 79960f3342..2ad555c35f 100644
--- a/packages/xl-ai/src/api/formats/tests/validateTestEnvironment.test.ts
+++ b/packages/xl-ai/src/api/formats/tests/validateTestEnvironment.test.ts
@@ -38,9 +38,15 @@ describe("MSW Snapshots", () => {
.map(([testName, files]) => ({
testName: path.basename(testName),
count: files.length,
- files: files.map((file) => path.basename(file)),
+ files: files,
}));
+ // for (const duplicate of duplicates) {
+ // for (const file of duplicate.files) {
+ // rmSync(file);
+ // }
+ // }
+
// Create error message if duplicates are found
const errorMessage =
duplicates.length > 0
@@ -48,7 +54,7 @@ describe("MSW Snapshots", () => {
`Found duplicate MSW snapshot files for the following (${duplicates.length}) tests:`,
...duplicates.map(
({ testName, count, files }) =>
- ` - ${testName}: ${count} files\n ${files.join("\n ")}`,
+ ` - ${testName}: ${count} files\n ${files.map((file) => path.basename(file)).join("\n ")}`,
),
"",
"Each test should have only one snapshot file.",
diff --git a/packages/xl-ai/src/api/index.ts b/packages/xl-ai/src/api/index.ts
index fef3fbc230..a12d884a67 100644
--- a/packages/xl-ai/src/api/index.ts
+++ b/packages/xl-ai/src/api/index.ts
@@ -1,45 +1,3 @@
-import { BlockNoteEditor } from "@blocknote/core";
-import { StreamTool } from "../streamTool/streamTool.js";
-import { htmlBlockLLMFormat } from "./formats/html-blocks/htmlBlocks.js";
-import { jsonLLMFormat } from "./formats/json/json.js";
-import { markdownBlocksLLMFormat } from "./formats/markdown-blocks/markdownBlocks.js";
-import { PromptBuilder } from "./formats/PromptBuilder.js";
-
-export type LLMFormat = {
- /**
- * Function to get the stream tools that can apply HTML block updates to the editor
- */
- getStreamTools: (
- editor: BlockNoteEditor,
- withDelays: boolean,
- defaultStreamTools?: {
- add?: boolean;
- update?: boolean;
- delete?: boolean;
- },
- selectionInfo?: {
- from: number;
- to: number;
- },
- onBlockUpdate?: (blockId: string) => void,
- ) => StreamTool[];
- /**
- * The default PromptBuilder that determines how a userPrompt is converted to an array of
- * LLM Messages (CoreMessage[])
- */
- defaultPromptBuilder: PromptBuilder;
- /**
- * Helper functions which can be used when implementing a custom PromptBuilder.
- * The signature depends on the specific format
- */
- promptHelpers: any;
-};
-
-export const llmFormats = {
- _experimental_json: jsonLLMFormat,
- _experimental_markdown: markdownBlocksLLMFormat,
- html: htmlBlockLLMFormat,
-};
-
-export { doLLMRequest as callLLM } from "./LLMRequest.js";
+export * from "./aiRequest/index.js";
+export * from "./formats/index.js";
export { promptHelpers } from "./promptHelpers/index.js";
diff --git a/packages/xl-ai/src/api/schema/schemaToJSONSchema.ts b/packages/xl-ai/src/api/schema/schemaToJSONSchema.ts
index 9cd48e8755..0ee05de3b1 100644
--- a/packages/xl-ai/src/api/schema/schemaToJSONSchema.ts
+++ b/packages/xl-ai/src/api/schema/schemaToJSONSchema.ts
@@ -250,6 +250,7 @@ function schemaOps(
}),
);
return {
+ // TODO
removeFileBlocks() {
clone.blockSchema = Object.fromEntries(
Object.entries(clone.blockSchema).filter(
diff --git a/packages/xl-ai/src/blocknoteAIClient/client.ts b/packages/xl-ai/src/blocknoteAIClient/client.ts
index c64137972e..307bbeba8b 100644
--- a/packages/xl-ai/src/blocknoteAIClient/client.ts
+++ b/packages/xl-ai/src/blocknoteAIClient/client.ts
@@ -1,75 +1,19 @@
-/**
- * Fetch function to proxy requests to the @blocknote/xl-ai-server AI server.
- */
-const fetchViaBlockNoteAIServer =
- (baseURL: string, provider: string) =>
+export const fetchViaProxy =
+ (getUrl: (url: string) => string) =>
async (input: string | URL | Request, init?: RequestInit) => {
const request = new Request(input, init);
- // console.log("fetchViaBlockNoteAIServer", baseURL, provider, request);
- const newRequest = new Request(
- `${baseURL}?provider=${encodeURIComponent(
- provider,
- )}&url=${encodeURIComponent(request.url)}`,
- {
- headers: request.headers,
- // if we just pass request.body, it's a readablestream which is not visible in chrome inspector,
- // so use init?.body instead if it's available to make debugging easier
- body: init?.body || request.body,
- method: request.method,
- duplex: "half",
- } as any,
- );
- try {
- const resp = await fetch(newRequest);
- return resp;
- } catch (e) {
- // Temp fix for https://github.com/vercel/ai/issues/6370
- throw new TypeError("fetch failed", {
- cause: e,
- });
- }
- };
+ // console.log("fetchViaProxy", baseURL, provider, request);
+ const url = getUrl(request.url);
+ const newRequest = new Request(url, {
+ headers: request.headers,
+ // if we just pass request.body, it's a readablestream which is not visible in chrome inspector,
+ // so use init?.body instead if it's available to make debugging easier
+ body: init?.body || request.body,
+ method: request.method,
+ duplex: "half",
+ } as any);
-/**
- * Create a client to connect to the @blocknote/xl-ai-server AI server.
- * The BlockNote AI server is a proxy for AI model providers. It allows you to connect to
- * AI SDKs without exposing your model provider's API keys on the client.
- *
- * @param config - settings to connect to the @blocknote/xl-ai-server AI server
- * @returns a client to connect to the @blocknote/xl-ai-server AI server.
- * Use the `getProviderSettings` method to get the provider settings for the AI SDKs,
- * this will configure the AI SDK model to connect via the @blocknote/xl-ai-server AI server.
- */
-export function createBlockNoteAIClient(config: {
- /**
- * baseURL of the @blocknote/xl-ai-server AI server
- */
- baseURL: string;
- /**
- * API key for the @blocknote/xl-ai-server AI server
- */
- apiKey: string;
-}) {
- return {
- /**
- * Get settings for AI SDK providers. Pass the returned objects when creating the AI SDK provider, e.g.:
- *
- * createOpenAI({
- * ...client.getProviderSettings("openai"),
- * })("gpt-4o-2024-08-06", {});
- *
- * Explanation: we override the `fetch` and `apiKey` parameters of the AI SDK provider to instead
- * use the BlockNote AI server to proxy requests to the provider.
- *
- * Note: the `apiKey` is the API key for the @blocknote/xl-ai-server AI server, not the model provider.
- * The correct API key for the model provider will be added by the BlockNote AI server.
- */
- getProviderSettings: (provider: "openai" | "groq" | string) => {
- return {
- apiKey: config.apiKey,
- fetch: fetchViaBlockNoteAIServer(config.baseURL, provider),
- };
- },
+ const resp = await fetch(newRequest);
+ return resp;
};
-}
diff --git a/packages/xl-ai/src/components/AIMenu/AIMenu.tsx b/packages/xl-ai/src/components/AIMenu/AIMenu.tsx
index 555325ef54..f9e1de4683 100644
--- a/packages/xl-ai/src/components/AIMenu/AIMenu.tsx
+++ b/packages/xl-ai/src/components/AIMenu/AIMenu.tsx
@@ -64,7 +64,7 @@ export const AIMenu = (props: AIMenuProps) => {
const onManualPromptSubmitDefault = useCallback(
async (userPrompt: string) => {
- await ai.callLLM({
+ await ai.invokeAI({
userPrompt,
useSelection: editor.getSelection() !== undefined,
});
diff --git a/packages/xl-ai/src/components/AIMenu/getDefaultAIMenuItems.tsx b/packages/xl-ai/src/components/AIMenu/getDefaultAIMenuItems.tsx
index 7f34040552..33a1c35413 100644
--- a/packages/xl-ai/src/components/AIMenu/getDefaultAIMenuItems.tsx
+++ b/packages/xl-ai/src/components/AIMenu/getDefaultAIMenuItems.tsx
@@ -19,6 +19,7 @@ import {
} from "react-icons/ri";
import { getAIExtension } from "../../AIExtension.js";
+import { aiDocumentFormats } from "../../api/index.js";
import { getAIDictionary } from "../../i18n/dictionary.js";
export type AIMenuSuggestionItem = Omit<
@@ -47,15 +48,17 @@ function getDefaultAIMenuItemsWithoutSelection<
aliases: dict.ai_default_commands.continue_writing.aliases,
icon: ,
onItemClick: async () => {
- await ai.callLLM({
+ await ai.invokeAI({
userPrompt:
"Continue writing at the current cursor position related to the previous text. Add multiple blocks if needed. If the document looks like a template / draft, follow the template. Be extensive if needed.",
// By default, LLM will be able to add / update / delete blocks. For "continue writing", we only want to allow adding new blocks.
- defaultStreamTools: {
- add: true,
- delete: false,
- update: false,
- },
+ streamToolsProvider: aiDocumentFormats.html.getStreamToolsProvider({
+ defaultStreamTools: {
+ add: true,
+ delete: false,
+ update: false,
+ },
+ }),
});
},
size: "small",
@@ -67,14 +70,16 @@ function getDefaultAIMenuItemsWithoutSelection<
aliases: dict.ai_default_commands.summarize.aliases,
icon: ,
onItemClick: async () => {
- await ai.callLLM({
+ await ai.invokeAI({
userPrompt: "Summarize",
// By default, LLM will be able to add / update / delete blocks. For "summarize", we only want to allow adding new blocks.
- defaultStreamTools: {
- add: true,
- delete: false,
- update: false,
- },
+ streamToolsProvider: aiDocumentFormats.html.getStreamToolsProvider({
+ defaultStreamTools: {
+ add: true,
+ delete: false,
+ update: false,
+ },
+ }),
});
},
size: "small",
@@ -85,14 +90,16 @@ function getDefaultAIMenuItemsWithoutSelection<
aliases: dict.ai_default_commands.add_action_items.aliases,
icon: ,
onItemClick: async () => {
- await ai.callLLM({
+ await ai.invokeAI({
userPrompt: "Add action items",
// By default, LLM will be able to add / update / delete blocks. For "summarize", we only want to allow adding new blocks.
- defaultStreamTools: {
- add: true,
- delete: false,
- update: false,
- },
+ streamToolsProvider: aiDocumentFormats.html.getStreamToolsProvider({
+ defaultStreamTools: {
+ add: true,
+ delete: false,
+ update: false,
+ },
+ }),
});
},
size: "small",
@@ -130,15 +137,17 @@ function getDefaultAIMenuItemsWithSelection<
aliases: dict.ai_default_commands.improve_writing.aliases,
icon: ,
onItemClick: async () => {
- await ai.callLLM({
+ await ai.invokeAI({
useSelection: true,
userPrompt: "Improve writing",
// By default, LLM will be able to add / update / delete blocks. For "summarize", we only want to allow adding new blocks.
- defaultStreamTools: {
- add: false,
- delete: false,
- update: true,
- },
+ streamToolsProvider: aiDocumentFormats.html.getStreamToolsProvider({
+ defaultStreamTools: {
+ add: false,
+ delete: false,
+ update: true,
+ },
+ }),
});
},
size: "small",
@@ -149,15 +158,17 @@ function getDefaultAIMenuItemsWithSelection<
aliases: dict.ai_default_commands.fix_spelling.aliases,
icon: ,
onItemClick: async () => {
- await ai.callLLM({
+ await ai.invokeAI({
useSelection: true,
userPrompt: "Fix spelling",
// By default, LLM will be able to add / update / delete blocks. For "summarize", we only want to allow adding new blocks.
- defaultStreamTools: {
- add: false,
- delete: false,
- update: true,
- },
+ streamToolsProvider: aiDocumentFormats.html.getStreamToolsProvider({
+ defaultStreamTools: {
+ add: false,
+ delete: false,
+ update: true,
+ },
+ }),
});
},
size: "small",
@@ -178,15 +189,17 @@ function getDefaultAIMenuItemsWithSelection<
aliases: dict.ai_default_commands.simplify.aliases,
icon: ,
onItemClick: async () => {
- await ai.callLLM({
+ await ai.invokeAI({
useSelection: true,
userPrompt: "Simplify",
// By default, LLM will be able to add / update / delete blocks. For "summarize", we only want to allow adding new blocks.
- defaultStreamTools: {
- add: false,
- delete: false,
- update: true,
- },
+ streamToolsProvider: aiDocumentFormats.html.getStreamToolsProvider({
+ defaultStreamTools: {
+ add: false,
+ delete: false,
+ update: true,
+ },
+ }),
});
},
size: "small",
diff --git a/packages/xl-ai/src/index.ts b/packages/xl-ai/src/index.ts
index 0f35bd8e3f..843bb17d03 100644
--- a/packages/xl-ai/src/index.ts
+++ b/packages/xl-ai/src/index.ts
@@ -1,6 +1,7 @@
import "./style.css";
export * from "./AIExtension.js";
+export * from "./api/index.js";
export * from "./blocknoteAIClient/client.js";
export * from "./components/AIMenu/AIMenu.js";
export * from "./components/AIMenu/AIMenuController.js";
@@ -9,7 +10,5 @@ export * from "./components/AIMenu/getDefaultAIMenuItems.js";
export * from "./components/AIMenu/PromptSuggestionMenu.js";
export * from "./components/FormattingToolbar/AIToolbarButton.js";
export * from "./components/SuggestionMenu/getAISlashMenuItems.js";
-
export * from "./i18n/dictionary.js";
-
-export * from "./api/index.js";
+export * from "./streamTool/index.js";
diff --git a/packages/xl-ai/src/streamTool/StreamToolExecutor.ts b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts
new file mode 100644
index 0000000000..83263cc139
--- /dev/null
+++ b/packages/xl-ai/src/streamTool/StreamToolExecutor.ts
@@ -0,0 +1,261 @@
+import { getErrorMessage } from "@ai-sdk/provider-utils";
+import { parsePartialJson } from "ai";
+import { StreamTool, StreamToolCall } from "./streamTool.js";
+
+export class ChunkExecutionError extends Error {
+ constructor(
+ message: string,
+ public readonly chunk: any,
+ options?: { cause?: unknown },
+ ) {
+ super(message, options);
+ this.name = "ChunkExecutionError";
+ }
+}
+
+/**
+ * The Operation types wraps a StreamToolCall with metadata on whether
+ * it's an update to an existing and / or or a possibly partial (i.e.: incomplete, streaming in progress) operation
+ */
+type Operation[] | StreamTool> = {
+ /**
+ * The StreamToolCall (parameters representing a StreamTool invocation)
+ */
+ operation: StreamToolCall;
+ /**
+ * Whether this operation is an update to the previous operation
+ * (i.e.: the previous operation was a partial operation for which we now have additional data)
+ */
+ isUpdateToPreviousOperation: boolean;
+ /**
+ * Whether this operation is a partial operation
+ * (i.e.: incomplete, streaming in progress)
+ */
+ isPossiblyPartial: boolean;
+
+ metadata: any;
+};
+
+/**
+ * The StreamToolExecutor can apply StreamToolCalls to an editor.
+ *
+ * It accepts StreamToolCalls as JSON strings or already parsed and validated Operations.
+ * Note: When passing JSON strings, the executor will parse and validate them into Operations.
+ * When passing Operations, they're expected to have been validated by the StreamTool instances already.
+ * (StreamTool.validate)
+ *
+ * Applying the operations is delegated to the StreamTool instances.
+ *
+ * @example see the `manual-execution` example
+ */
+export class StreamToolExecutor[]> {
+ private readonly stream: TransformStream<
+ string | Operation,
+ {
+ status: "ok";
+ chunk: Operation;
+ }
+ > & {
+ finishPromise: Promise;
+ };
+
+ /**
+ * @param streamTools - The StreamTools to use to apply the StreamToolCalls
+ */
+ constructor(private streamTools: T) {
+ this.stream = this.createStream();
+ }
+
+ private createStream() {
+ let lastParsedResult: Operation | undefined;
+ const stream = new TransformStream, Operation>({
+ transform: async (chunk, controller) => {
+ const operation =
+ typeof chunk === "string"
+ ? await partialJsonToOperation(
+ chunk,
+ lastParsedResult?.isPossiblyPartial ?? false,
+ this.streamTools,
+ )
+ : chunk;
+ if (operation) {
+ // TODO: string operations have been validated, but object-based operations have not.
+ // To make this consistent, maybe we should extract the string parser to a separate transformer
+ lastParsedResult = operation;
+ controller.enqueue(operation);
+ }
+ },
+
+ flush: (controller) => {
+ // Check if the stream ended with a partial operation
+ if (lastParsedResult?.isPossiblyPartial) {
+ controller.error(new Error("stream ended with a partial operation"));
+ }
+ },
+ });
+
+ // - internal dummy sink ensures all downstream writes are completed.
+ // - pipeline.close() waits for both the first writable to close and the pipe to finish internally, so the consumer doesn’t need to know about internal transforms.
+ // - Works regardless of the number of internal transforms.
+ // - The readable can still be exposed if the consumer wants it, but they don’t have to consume it for close() to guarantee processing is done.
+
+ const secondTransform = stream.readable.pipeThrough(this.createExecutor());
+
+ const [internalReadable, externalReadable] = secondTransform.tee();
+
+ // internalReadable goes to the dummy sink
+ const finishPromise = internalReadable.pipeTo(new WritableStream());
+
+ return {
+ writable: stream.writable,
+ // expose externalReadable to the consumer
+ readable: externalReadable,
+ finishPromise,
+ };
+ }
+
+ private createExecutor() {
+ const executors = this.streamTools.map((tool) => tool.executor());
+
+ return new TransformStream<
+ Operation,
+ { status: "ok"; chunk: Operation }
+ >({
+ transform: async (chunk, controller) => {
+ let handled = false;
+ for (const executor of executors) {
+ try {
+ const result = await executor.execute(chunk);
+ if (result) {
+ controller.enqueue({ status: "ok", chunk });
+ handled = true;
+ break;
+ }
+ } catch (error) {
+ throw new ChunkExecutionError(
+ `Tool execution failed: ${getErrorMessage(error)}`,
+ chunk,
+ {
+ cause: error,
+ },
+ );
+ }
+ }
+ if (!handled) {
+ const operationType = (chunk.operation as any)?.type || "unknown";
+ throw new Error(
+ `No tool could handle operation of type: ${operationType}`,
+ );
+ }
+ },
+ });
+ }
+
+ /**
+ * Returns a WritableStream that can be used to write StreamToolCalls to the executor.
+ *
+ * The WriteableStream accepts JSON strings or Operation objects.
+ *
+ * Make sure to call `close` on the StreamToolExecutor instead of on the writable returned here!
+ */
+ public get writable() {
+ return this.stream.writable;
+ }
+
+ /**
+ * Returns a ReadableStream that can be used to read the results of the executor.
+ */
+ public get readable() {
+ return this.stream.readable;
+ }
+
+ public async finish() {
+ await this.stream.finishPromise;
+ }
+
+ async executeOperationsArray(source: AsyncIterable) {
+ const writer = this.writable.getWriter();
+ for await (const chunk of source) {
+ const parsed = await parsePartialJson(chunk);
+
+ if (
+ parsed.state === "undefined-input" ||
+ parsed.state === "failed-parse"
+ ) {
+ return undefined;
+ }
+
+ if (!parsed) {
+ return;
+ }
+
+ await writer.write(chunk);
+ }
+ await writer.close();
+ await this.finish();
+ }
+
+ /**
+ * Accepts an async iterable and writes each chunk to the internal stream.
+ *
+ * (alternative to writing to the writable stream using {@link writable})
+ */
+ async execute(source: AsyncIterable>): Promise {
+ const writer = this.writable.getWriter();
+ for await (const chunk of source) {
+ await writer.write(chunk);
+ }
+ await writer.close();
+ await this.finish();
+ }
+
+ /**
+ * Accepts a single chunk and processes it using the same logic.
+ *
+ * (alternative to writing to the writable stream using {@link writable})
+ */
+ async executeOne(chunk: StreamToolCall): Promise {
+ await this.execute(
+ (async function* () {
+ yield {
+ operation: chunk,
+ isUpdateToPreviousOperation: false,
+ isPossiblyPartial: false,
+ metadata: {},
+ };
+ })(),
+ );
+ }
+}
+
+async function partialJsonToOperation[]>(
+ chunk: string,
+ isUpdateToPreviousOperation: boolean,
+ streamTools: T,
+): Promise | undefined> {
+ const parsed = await parsePartialJson(chunk);
+
+ if (parsed.state === "undefined-input" || parsed.state === "failed-parse") {
+ return undefined;
+ }
+
+ if (!parsed) {
+ return;
+ }
+
+ const func = streamTools.find((f) => f.name === (parsed.value as any)?.type);
+
+ const validated = func && func.validate(parsed.value);
+
+ if (validated?.ok) {
+ return {
+ operation: validated.value as StreamToolCall,
+ isPossiblyPartial: parsed.state === "repaired-parse",
+ isUpdateToPreviousOperation,
+ metadata: undefined,
+ };
+ } else {
+ // no worries, probably a partial operation that's not valid yet
+ return;
+ }
+}
diff --git a/packages/xl-ai/src/streamTool/asTool.ts b/packages/xl-ai/src/streamTool/asTool.ts
deleted file mode 100644
index f1f18fc44e..0000000000
--- a/packages/xl-ai/src/streamTool/asTool.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import { jsonSchema, tool } from "ai";
-import { operationsToStream } from "./callLLMWithStreamTools.js";
-import { createStreamToolsArraySchema } from "./jsonSchema.js";
-import { StreamTool } from "./streamTool.js";
-
-// TODO: remove or implement
-
-export function streamToolAsTool>(streamTool: T) {
- return tool({
- parameters: jsonSchema(streamTool.parameters, {
- validate: (value) => {
- const result = streamTool.validate(value);
- if (!result.ok) {
- return { success: false, error: new Error(result.error) };
- }
- return { success: true, value: result.value };
- },
- }),
- execute: async (_value) => {
- // console.log("execute", value);
- // TODO
- },
- });
-}
-
-export function streamToolsAsTool[]>(streamTools: T) {
- const schema = createStreamToolsArraySchema(streamTools);
-
- return tool({
- parameters: jsonSchema(schema, {
- validate: (value) => {
- const stream = operationsToStream(value);
- if (!stream.ok) {
- return { success: false, error: new Error(stream.error) };
- }
- return { success: true, value: stream.value };
- },
- }),
- execute: async (_value) => {
- // TODO
- // console.log("execute", value);
- },
- });
-}
diff --git a/packages/xl-ai/src/streamTool/callLLMWithStreamTools.ts b/packages/xl-ai/src/streamTool/callLLMWithStreamTools.ts
deleted file mode 100644
index 1dd310ff85..0000000000
--- a/packages/xl-ai/src/streamTool/callLLMWithStreamTools.ts
+++ /dev/null
@@ -1,362 +0,0 @@
-import {
- CoreMessage,
- GenerateObjectResult,
- LanguageModel,
- ObjectStreamPart,
- StreamObjectResult,
- generateObject,
- jsonSchema,
- streamObject,
-} from "ai";
-
-import { createStreamToolsArraySchema } from "./jsonSchema.js";
-
-import {
- AsyncIterableStream,
- createAsyncIterableStream,
- createAsyncIterableStreamFromAsyncIterable,
-} from "../util/stream.js";
-import { filterNewOrUpdatedOperations } from "./filterNewOrUpdatedOperations.js";
-import {
- preprocessOperationsNonStreaming,
- preprocessOperationsStreaming,
-} from "./preprocess.js";
-import { Result, StreamTool, StreamToolCall } from "./streamTool.js";
-
-type LLMRequestOptions = {
- model: LanguageModel;
- messages: CoreMessage[];
- maxRetries: number;
-};
-
-/**
- * Result of an LLM call with stream tools
- */
-export type OperationsResult[]> = {
- /**
- * Result of the underlying `streamObject` (AI SDK) call, or `undefined` if non-streaming mode
- */
- streamObjectResult: StreamObjectResult | undefined;
- /**
- * Result of the underlying `generateObject` (AI SDK) call, or `undefined` if streaming mode
- */
- generateObjectResult: GenerateObjectResult | undefined;
- /**
- * Stream of tool call operations, these are the operations the LLM "decided" to execute
- *
- * Calling this consumes the underlying streams
- */
- operationsSource: AsyncIterableStream<{
- /**
- * The operation the LLM wants to execute
- */
- operation: StreamToolCall;
- /**
- * Whether {@link operation} is an update to the previous operation in the stream.
- *
- * For non-streaming mode, this will always be `false`
- */
- isUpdateToPreviousOperation: boolean;
- /**
- * Whether the {@link operation} is possibly partial (i.e. the LLM is still streaming data about this operation)
- *
- * For non-streaming mode, this will always be `false`
- */
- isPossiblyPartial: boolean;
- }>;
- /**
- * All tool call operations the LLM decided to execute
- */
- getGeneratedOperations: () => Promise<{
- operations: StreamToolCall[];
- }>;
-};
-
-/**
- * Calls an LLM with StreamTools, using the `generateObject` of the AI SDK.
- *
- * This is the non-streaming version.
- */
-export async function generateOperations[]>(
- streamTools: T,
- opts: LLMRequestOptions & {
- _generateObjectOptions?: Partial>[0]>;
- },
-): Promise> {
- const { _generateObjectOptions, ...rest } = opts;
-
- if (
- _generateObjectOptions &&
- ("output" in _generateObjectOptions || "schema" in _generateObjectOptions)
- ) {
- throw new Error(
- "Cannot provide output or schema in _generateObjectOptions",
- );
- }
-
- const schema = jsonSchema(createStreamToolsArraySchema(streamTools));
- const options = {
- // non-overridable options for streamObject
- output: "object" as const,
- schema,
-
- // configurable options for streamObject
-
- // - optional, with defaults
-
- // mistral somehow needs "auto", while groq/llama needs "tool"
- // google needs "auto" because https://github.com/vercel/ai/issues/6959
- // TODO: further research this and / or make configurable
- // for now stick to "tool" by default as this has been tested mostly
- mode:
- rest.model.provider === "mistral.chat" ||
- rest.model.provider === "google.generative-ai"
- ? "auto"
- : "tool",
- // - mandatory ones:
- ...rest,
-
- // extra options for streamObject
- ...((_generateObjectOptions ?? {}) as any),
- };
-
- const ret = await generateObject<{ operations: any }>(options);
-
- // because the rest of the codebase always expects a stream, we convert the object to a stream here
- const stream = operationsToStream(ret.object);
-
- if (!stream.ok) {
- throw new Error(stream.error);
- }
-
- let _operationsSource: OperationsResult["operationsSource"];
-
- return {
- streamObjectResult: undefined,
- generateObjectResult: ret,
- get operationsSource() {
- if (!_operationsSource) {
- _operationsSource = createAsyncIterableStreamFromAsyncIterable(
- preprocessOperationsNonStreaming(stream.value, streamTools),
- );
- }
- return _operationsSource;
- },
- async getGeneratedOperations() {
- return ret.object;
- },
- };
-}
-
-export function operationsToStream[]>(
- object: unknown,
-): Result<
- AsyncIterable<{
- partialOperation: StreamToolCall;
- isUpdateToPreviousOperation: boolean;
- isPossiblyPartial: boolean;
- }>
-> {
- if (
- !object ||
- typeof object !== "object" ||
- !("operations" in object) ||
- !Array.isArray(object.operations)
- ) {
- return {
- ok: false,
- error: "No operations returned",
- };
- }
- const operations = object.operations;
- async function* singleChunkGenerator() {
- for (const op of operations) {
- yield {
- partialOperation: op,
- isUpdateToPreviousOperation: false,
- isPossiblyPartial: false,
- };
- }
- }
-
- return {
- ok: true,
- value: singleChunkGenerator(),
- };
-}
-
-/**
- * Calls an LLM with StreamTools, using the `streamObject` of the AI SDK.
- *
- * This is the streaming version.
- */
-export async function streamOperations[]>(
- streamTools: T,
- opts: LLMRequestOptions & {
- _streamObjectOptions?: Partial<
- Parameters>[0]
- >;
- },
- onStart: () => void = () => {
- // noop
- },
-): Promise> {
- const { _streamObjectOptions, ...rest } = opts;
-
- if (
- _streamObjectOptions &&
- ("output" in _streamObjectOptions || "schema" in _streamObjectOptions)
- ) {
- throw new Error("Cannot provide output or schema in _streamObjectOptions");
- }
-
- const schema = jsonSchema(createStreamToolsArraySchema(streamTools));
-
- const options = {
- // non-overridable options for streamObject
- output: "object" as const,
- schema,
- // configurable options for streamObject
-
- // - optional, with defaults
- // mistral somehow needs "auto", while groq/llama needs "tool"
- // google needs "auto" because https://github.com/vercel/ai/issues/6959
- // TODO: further research this and / or make configurable
- // for now stick to "tool" by default as this has been tested mostly
- mode:
- rest.model.provider === "mistral.chat" ||
- rest.model.provider === "google.generative-ai"
- ? "auto"
- : "tool",
- // - mandatory ones:
- ...rest,
-
- // extra options for streamObject
- ...((opts._streamObjectOptions ?? {}) as any),
- };
-
- const ret = streamObject<{ operations: any }>(options);
-
- let _operationsSource: OperationsResult["operationsSource"];
-
- const [fullStream1, fullStream2] = ret.fullStream.tee();
-
- // Always consume fullStream2 in the background and store the last operations
- const allOperationsPromise = (async () => {
- let lastOperations: { operations: StreamToolCall[] } = {
- operations: [],
- };
- const objectStream = createAsyncIterableStream(
- partialObjectStream(fullStream2),
- );
-
- for await (const chunk of objectStream) {
- if (chunk && typeof chunk === "object" && "operations" in chunk) {
- lastOperations = chunk as any;
- }
- }
- return lastOperations;
- })();
-
- // Note: we can probably clean this up by switching to streams instead of async iterables
- return {
- streamObjectResult: ret,
- generateObjectResult: undefined,
- get operationsSource() {
- if (!_operationsSource) {
- _operationsSource = createAsyncIterableStreamFromAsyncIterable(
- preprocessOperationsStreaming(
- filterNewOrUpdatedOperations(
- streamOnStartCallback(
- partialObjectStreamThrowError(
- createAsyncIterableStream(fullStream1),
- ),
- onStart,
- ),
- ),
- streamTools,
- ),
- );
- }
- return _operationsSource;
- },
- async getGeneratedOperations() {
- // Simply return the stored operations
- // If the stream hasn't completed yet, this will return the latest available operations
- return allOperationsPromise;
- },
- };
-}
-
-async function* streamOnStartCallback(
- stream: AsyncIterable,
- onStart: () => void,
-): AsyncIterable {
- let first = true;
- for await (const chunk of stream) {
- if (first) {
- onStart();
- first = false;
- }
- yield chunk;
- }
-}
-
-// adapted from https://github.com/vercel/ai/blob/5d4610634f119dc394d36adcba200a06f850209e/packages/ai/core/generate-object/stream-object.ts#L1041C7-L1066C1
-// change made to throw errors (with the original they're silently ignored)
-function partialObjectStreamThrowError(
- stream: ReadableStream>,
-): AsyncIterableStream {
- return createAsyncIterableStream(
- stream.pipeThrough(
- new TransformStream, PARTIAL>({
- transform(chunk, controller) {
- switch (chunk.type) {
- case "object":
- controller.enqueue(chunk.object);
- break;
-
- case "text-delta":
- case "finish":
- break;
- case "error":
- controller.error(chunk.error);
- break;
- default: {
- const _exhaustiveCheck: never = chunk;
- throw new Error(`Unsupported chunk type: ${_exhaustiveCheck}`);
- }
- }
- },
- }),
- ),
- );
-}
-
-// from https://github.com/vercel/ai/blob/5d4610634f119dc394d36adcba200a06f850209e/packages/ai/core/generate-object/stream-object.ts#L1041C7-L1066C1
-function partialObjectStream(
- stream: ReadableStream>,
-): AsyncIterableStream {
- return createAsyncIterableStream(
- stream.pipeThrough(
- new TransformStream, PARTIAL>({
- transform(chunk, controller) {
- switch (chunk.type) {
- case "object":
- controller.enqueue(chunk.object);
- break;
- case "text-delta":
- case "finish":
- break;
- case "error":
- break;
- default: {
- const _exhaustiveCheck: never = chunk;
- throw new Error(`Unsupported chunk type: ${_exhaustiveCheck}`);
- }
- }
- },
- }),
- ),
- );
-}
diff --git a/packages/xl-ai/src/streamTool/filterNewOrUpdatedOperations.test.ts b/packages/xl-ai/src/streamTool/filterNewOrUpdatedOperations.test.ts
index c68e9bdc7f..68b96da0d9 100644
--- a/packages/xl-ai/src/streamTool/filterNewOrUpdatedOperations.test.ts
+++ b/packages/xl-ai/src/streamTool/filterNewOrUpdatedOperations.test.ts
@@ -21,7 +21,7 @@ describe("filterNewOrUpdatedOperations", () => {
}
const result = [];
- for await (const chunk of filterNewOrUpdatedOperations(mockStream())) {
+ for await (const chunk of filterNewOrUpdatedOperations(mockStream(), {})) {
result.push(chunk);
}
@@ -32,30 +32,35 @@ describe("filterNewOrUpdatedOperations", () => {
partialOperation: { id: 1, content: "op1" },
isUpdateToPreviousOperation: false,
isPossiblyPartial: false,
+ metadata: {},
});
expect(result[1]).toEqual({
partialOperation: { id: 2, content: "op2-partial" },
isUpdateToPreviousOperation: false,
isPossiblyPartial: true,
+ metadata: {},
});
expect(result[2]).toEqual({
partialOperation: { id: 2, content: "op2-complete" },
isUpdateToPreviousOperation: true,
isPossiblyPartial: false,
+ metadata: {},
});
expect(result[3]).toEqual({
partialOperation: { id: 3, content: "op3" },
isUpdateToPreviousOperation: false,
isPossiblyPartial: true,
+ metadata: {},
});
expect(result[4]).toEqual({
partialOperation: { id: 3, content: "op3" },
isUpdateToPreviousOperation: true,
isPossiblyPartial: false,
+ metadata: {},
});
});
@@ -74,7 +79,7 @@ describe("filterNewOrUpdatedOperations", () => {
}
const result = [];
- for await (const chunk of filterNewOrUpdatedOperations(mockStream())) {
+ for await (const chunk of filterNewOrUpdatedOperations(mockStream(), {})) {
result.push(chunk);
}
@@ -85,6 +90,7 @@ describe("filterNewOrUpdatedOperations", () => {
partialOperation: { id: 1, content: "op1-partial" },
isUpdateToPreviousOperation: false,
isPossiblyPartial: true,
+ metadata: {},
});
// Second chunk should have op1-complete
@@ -92,6 +98,7 @@ describe("filterNewOrUpdatedOperations", () => {
partialOperation: { id: 1, content: "op1-complete" },
isUpdateToPreviousOperation: true,
isPossiblyPartial: false,
+ metadata: {},
});
// Third chunk should have op2
@@ -99,12 +106,14 @@ describe("filterNewOrUpdatedOperations", () => {
partialOperation: { id: 2, content: "op2" },
isUpdateToPreviousOperation: false,
isPossiblyPartial: true,
+ metadata: {},
});
expect(result[3]).toEqual({
partialOperation: { id: 2, content: "op2" },
isUpdateToPreviousOperation: true,
isPossiblyPartial: false,
+ metadata: {},
});
});
@@ -115,7 +124,7 @@ describe("filterNewOrUpdatedOperations", () => {
}
const result = [];
- for await (const chunk of filterNewOrUpdatedOperations(mockStream())) {
+ for await (const chunk of filterNewOrUpdatedOperations(mockStream(), {})) {
result.push(chunk);
}
@@ -124,11 +133,13 @@ describe("filterNewOrUpdatedOperations", () => {
partialOperation: { id: 1, content: "op1" },
isUpdateToPreviousOperation: false,
isPossiblyPartial: true,
+ metadata: {},
});
expect(result[1]).toEqual({
partialOperation: { id: 1, content: "op1" },
isUpdateToPreviousOperation: true,
isPossiblyPartial: false,
+ metadata: {},
});
});
@@ -139,7 +150,7 @@ describe("filterNewOrUpdatedOperations", () => {
}
const result = [];
- for await (const chunk of filterNewOrUpdatedOperations(mockStream())) {
+ for await (const chunk of filterNewOrUpdatedOperations(mockStream(), {})) {
result.push(chunk);
}
@@ -148,11 +159,13 @@ describe("filterNewOrUpdatedOperations", () => {
partialOperation: { id: 1, content: "op1" },
isUpdateToPreviousOperation: false,
isPossiblyPartial: true,
+ metadata: {},
});
expect(result[1]).toEqual({
partialOperation: { id: 1, content: "op1" },
isUpdateToPreviousOperation: true,
isPossiblyPartial: false,
+ metadata: {},
});
});
});
diff --git a/packages/xl-ai/src/streamTool/filterNewOrUpdatedOperations.ts b/packages/xl-ai/src/streamTool/filterNewOrUpdatedOperations.ts
index 6f1d17611d..4be2ad0bfe 100644
--- a/packages/xl-ai/src/streamTool/filterNewOrUpdatedOperations.ts
+++ b/packages/xl-ai/src/streamTool/filterNewOrUpdatedOperations.ts
@@ -14,11 +14,13 @@
export async function* filterNewOrUpdatedOperations(
partialObjectStream: AsyncIterable<{
operations?: any[];
- }>
+ }>,
+ metadata: any,
): AsyncGenerator<{
partialOperation: any;
isUpdateToPreviousOperation: boolean;
isPossiblyPartial: boolean;
+ metadata: any;
}> {
let numOperationsAppliedCompletely = 0;
let first = true;
@@ -43,6 +45,7 @@ export async function* filterNewOrUpdatedOperations(
isUpdateToPreviousOperation:
i === numOperationsAppliedCompletely && !first,
isPossiblyPartial: i === chunk.operations.length - 1,
+ metadata,
};
first = false;
}
@@ -60,5 +63,6 @@ export async function* filterNewOrUpdatedOperations(
partialOperation: lastOp,
isUpdateToPreviousOperation: true,
isPossiblyPartial: false,
+ metadata,
};
}
diff --git a/packages/xl-ai/src/streamTool/filterValidOperations.test.ts b/packages/xl-ai/src/streamTool/filterValidOperations.test.ts
index 016829b65b..1ad0f993f5 100644
--- a/packages/xl-ai/src/streamTool/filterValidOperations.test.ts
+++ b/packages/xl-ai/src/streamTool/filterValidOperations.test.ts
@@ -21,6 +21,7 @@ describe("filterValidOperations", () => {
} as Result | UpdateBlockToolCall>,
isUpdateToPreviousOperation: false,
isPossiblyPartial: false,
+ metadata: undefined,
};
yield {
@@ -30,6 +31,7 @@ describe("filterValidOperations", () => {
} as Result | UpdateBlockToolCall>,
isUpdateToPreviousOperation: false,
isPossiblyPartial: false,
+ metadata: undefined,
};
yield {
@@ -43,6 +45,7 @@ describe("filterValidOperations", () => {
} as Result | UpdateBlockToolCall>,
isUpdateToPreviousOperation: true,
isPossiblyPartial: true,
+ metadata: undefined,
};
}
@@ -81,6 +84,7 @@ describe("filterValidOperations", () => {
} as Result | UpdateBlockToolCall>,
isUpdateToPreviousOperation: false,
isPossiblyPartial: false,
+ metadata: undefined,
};
yield {
@@ -90,6 +94,7 @@ describe("filterValidOperations", () => {
} as Result | UpdateBlockToolCall>,
isUpdateToPreviousOperation: true,
isPossiblyPartial: false,
+ metadata: undefined,
};
}
diff --git a/packages/xl-ai/src/streamTool/filterValidOperations.ts b/packages/xl-ai/src/streamTool/filterValidOperations.ts
index 3f06db50f1..91b513a4f4 100644
--- a/packages/xl-ai/src/streamTool/filterValidOperations.ts
+++ b/packages/xl-ai/src/streamTool/filterValidOperations.ts
@@ -10,6 +10,7 @@ export async function* filterValidOperations(
operation: Result;
isUpdateToPreviousOperation: boolean;
isPossiblyPartial: boolean;
+ metadata: any;
}>,
onInvalidOperation?: (chunk: {
operation: Result & {
@@ -17,11 +18,13 @@ export async function* filterValidOperations(
};
isUpdateToPreviousOperation: boolean;
isPossiblyPartial: boolean;
+ metadata: any;
}) => void,
): AsyncGenerator<{
operation: T;
isUpdateToPreviousOperation: boolean;
isPossiblyPartial: boolean;
+ metadata: any;
}> {
let forceNewOperation = false;
for await (const chunk of operationsStream) {
@@ -33,6 +36,7 @@ export async function* filterValidOperations(
? false
: chunk.isUpdateToPreviousOperation,
isPossiblyPartial: chunk.isPossiblyPartial,
+ metadata: chunk.metadata,
};
forceNewOperation = false;
} else {
diff --git a/packages/xl-ai/src/streamTool/index.ts b/packages/xl-ai/src/streamTool/index.ts
new file mode 100644
index 0000000000..9ba961d59e
--- /dev/null
+++ b/packages/xl-ai/src/streamTool/index.ts
@@ -0,0 +1,6 @@
+export * from "./jsonSchema.js";
+export * from "./StreamToolExecutor.js";
+export * from "./toolDefinitionsToToolSet.js";
+export * from "./vercelAiSdk/clientside/ClientSideTransport.js";
+export * from "./vercelAiSdk/util/partialObjectStreamUtil.js";
+export * from "./vercelAiSdk/util/UIMessageStreamToOperationsResult.js";
diff --git a/packages/xl-ai/src/streamTool/jsonSchema.ts b/packages/xl-ai/src/streamTool/jsonSchema.ts
index 048af716e7..03784dca2e 100644
--- a/packages/xl-ai/src/streamTool/jsonSchema.ts
+++ b/packages/xl-ai/src/streamTool/jsonSchema.ts
@@ -7,7 +7,7 @@ function streamToolToJSONSchema(tool: StreamTool): {
$defs?: Record;
} {
// this adds the tool name as the "type". (not very clean way to do it)
- const { properties, required, $defs, ...rest } = tool.parameters;
+ const { properties, required, $defs, ...rest } = tool.inputSchema;
return {
schema: {
type: "object",
@@ -65,6 +65,8 @@ export function createStreamToolsArraySchema(
type: "object",
properties: {
operations: {
+ //description:
+ // "Operations to apply to the document. Put all operations in this array in ONE tool call / function call. DO NOT use multiple operation arrays with parallel tool calls.",
type: "array",
items: {
anyOf: schemas.map((schema) => schema.schema),
diff --git a/packages/xl-ai/src/streamTool/preprocess.test.ts b/packages/xl-ai/src/streamTool/preprocess.test.ts
index ba608aaee3..814c6455f5 100644
--- a/packages/xl-ai/src/streamTool/preprocess.test.ts
+++ b/packages/xl-ai/src/streamTool/preprocess.test.ts
@@ -78,6 +78,7 @@ describe("preprocess", () => {
partialOperation: addOperationValid,
isUpdateToPreviousOperation: false,
isPossiblyPartial: false,
+ metadata: undefined,
};
}
@@ -94,11 +95,13 @@ describe("preprocess", () => {
partialOperation: addOperationInvalidId,
isUpdateToPreviousOperation: false,
isPossiblyPartial: true,
+ metadata: undefined,
};
yield {
partialOperation: invalidOperationType,
isUpdateToPreviousOperation: false,
isPossiblyPartial: true,
+ metadata: undefined,
};
}
@@ -115,11 +118,13 @@ describe("preprocess", () => {
partialOperation: addOperationInvalidId,
isUpdateToPreviousOperation: false,
isPossiblyPartial: false,
+ metadata: undefined,
};
yield {
partialOperation: invalidOperationType,
isUpdateToPreviousOperation: false,
isPossiblyPartial: false,
+ metadata: undefined,
};
}
@@ -150,6 +155,7 @@ describe("preprocess", () => {
partialOperation: addOperationValid,
isUpdateToPreviousOperation: false,
isPossiblyPartial: false,
+ metadata: undefined,
};
}
@@ -166,6 +172,7 @@ describe("preprocess", () => {
partialOperation: addOperationInvalidId,
isUpdateToPreviousOperation: false,
isPossiblyPartial: false,
+ metadata: undefined,
};
}
@@ -182,6 +189,7 @@ describe("preprocess", () => {
partialOperation: invalidOperationType,
isUpdateToPreviousOperation: false,
isPossiblyPartial: false,
+ metadata: undefined,
};
}
diff --git a/packages/xl-ai/src/streamTool/preprocess.ts b/packages/xl-ai/src/streamTool/preprocess.ts
index 0a98ecc216..8292eec7e0 100644
--- a/packages/xl-ai/src/streamTool/preprocess.ts
+++ b/packages/xl-ai/src/streamTool/preprocess.ts
@@ -6,6 +6,7 @@ export type PreprocessOperationResult[]> = {
operation: StreamToolCall;
isUpdateToPreviousOperation: boolean;
isPossiblyPartial: boolean;
+ metadata: any;
};
/**
@@ -18,6 +19,7 @@ export async function* preprocessOperationsStreaming<
partialOperation: any;
isUpdateToPreviousOperation: boolean;
isPossiblyPartial: boolean;
+ metadata: any;
}>,
streamTools: T,
): AsyncGenerator> {
@@ -43,6 +45,10 @@ export async function* preprocessOperationsStreaming<
/**
* Validates an stream of operations and throws an error if an invalid operation is found.
+ *
+ * TODO: remove
+ *
+ * @deprecated
*/
export async function* preprocessOperationsNonStreaming<
T extends StreamTool[],
@@ -51,6 +57,7 @@ export async function* preprocessOperationsNonStreaming<
partialOperation: any;
isUpdateToPreviousOperation: boolean;
isPossiblyPartial: boolean;
+ metadata: any;
}>,
streamTools: T,
): AsyncGenerator> {
diff --git a/packages/xl-ai/src/streamTool/streamTool.ts b/packages/xl-ai/src/streamTool/streamTool.ts
index d907d1315e..91f5b1eb71 100644
--- a/packages/xl-ai/src/streamTool/streamTool.ts
+++ b/packages/xl-ai/src/streamTool/streamTool.ts
@@ -27,7 +27,7 @@ export type StreamTool = {
/**
* The schema of the input that the tool expects. The language model will use this to generate the input.
*/
- parameters: JSONSchema7;
+ inputSchema: JSONSchema7;
/**
* Validates the input of the tool call
*
@@ -45,17 +45,14 @@ export type StreamTool = {
*
* @returns the stream of operations that have not been processed (and should be passed on to execute handlers of other StreamTools)
*/
- execute: (
- operationsStream: AsyncIterable<{
+ executor: () => {
+ execute: (chunk: {
operation: StreamToolCall[]>;
isUpdateToPreviousOperation: boolean;
isPossiblyPartial: boolean;
- }>,
- ) => AsyncIterable<{
- operation: StreamToolCall[]>;
- isUpdateToPreviousOperation: boolean;
- isPossiblyPartial: boolean;
- }>;
+ metadata: any;
+ }) => Promise;
+ };
};
export type StreamToolCallSingle> =
@@ -66,14 +63,14 @@ export type StreamToolCallSingle> =
*
* Its type is the same as what a validated StreamTool returns
*/
-export type StreamToolCall | StreamTool[]> =
+export type StreamToolCall | readonly any[]> =
T extends StreamTool
? U
: // when passed an array of StreamTools, StreamToolCall represents the type of one of the StreamTool invocations
- T extends StreamTool[]
- ? T[number] extends StreamTool
- ? V
- : never
+ T extends readonly unknown[]
+ ? {
+ [K in keyof T]: T[K] extends StreamTool ? V : never;
+ }[number]
: never;
/**
diff --git a/packages/xl-ai/src/streamTool/toValidatedOperations.test.ts b/packages/xl-ai/src/streamTool/toValidatedOperations.test.ts
index cc4010efe4..69dea922a6 100644
--- a/packages/xl-ai/src/streamTool/toValidatedOperations.test.ts
+++ b/packages/xl-ai/src/streamTool/toValidatedOperations.test.ts
@@ -81,6 +81,7 @@ describe("toValidatedOperations", () => {
partialOperation: operation,
isUpdateToPreviousOperation: false,
isPossiblyPartial: false,
+ metadata: undefined,
};
}
}
diff --git a/packages/xl-ai/src/streamTool/toValidatedOperations.ts b/packages/xl-ai/src/streamTool/toValidatedOperations.ts
index 0b19668cda..f1dd5af047 100644
--- a/packages/xl-ai/src/streamTool/toValidatedOperations.ts
+++ b/packages/xl-ai/src/streamTool/toValidatedOperations.ts
@@ -12,12 +12,14 @@ export async function* toValidatedOperations[]>(
partialOperation: any;
isUpdateToPreviousOperation: boolean;
isPossiblyPartial: boolean;
+ metadata: any;
}>,
streamTools: T,
): AsyncGenerator<{
operation: Result>;
isUpdateToPreviousOperation: boolean;
isPossiblyPartial: boolean;
+ metadata: any;
}> {
for await (const chunk of partialObjectStream) {
const func = streamTools.find(
@@ -34,6 +36,7 @@ export async function* toValidatedOperations[]>(
},
isUpdateToPreviousOperation: chunk.isUpdateToPreviousOperation,
isPossiblyPartial: chunk.isPossiblyPartial,
+ metadata: chunk.metadata,
};
continue;
}
@@ -44,6 +47,7 @@ export async function* toValidatedOperations[]>(
operation,
isUpdateToPreviousOperation: chunk.isUpdateToPreviousOperation,
isPossiblyPartial: chunk.isPossiblyPartial,
+ metadata: chunk.metadata,
};
}
}
diff --git a/packages/xl-ai/src/streamTool/toolDefinitionsToToolSet.ts b/packages/xl-ai/src/streamTool/toolDefinitionsToToolSet.ts
new file mode 100644
index 0000000000..8c7b217fa1
--- /dev/null
+++ b/packages/xl-ai/src/streamTool/toolDefinitionsToToolSet.ts
@@ -0,0 +1,24 @@
+import { jsonSchema, JSONSchema7, tool } from "ai";
+
+export function toolDefinitionsToToolSet(
+ toolDefinitions: Record<
+ string,
+ {
+ name: string;
+ description?: string;
+ inputSchema: JSONSchema7;
+ outputSchema: JSONSchema7;
+ }
+ >,
+) {
+ return Object.fromEntries(
+ Object.entries(toolDefinitions).map(([name, definition]) => [
+ name,
+ tool({
+ ...definition,
+ inputSchema: jsonSchema(definition.inputSchema),
+ outputSchema: jsonSchema(definition.outputSchema),
+ }),
+ ]),
+ );
+}
diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts
new file mode 100644
index 0000000000..72b3b388e7
--- /dev/null
+++ b/packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts
@@ -0,0 +1,219 @@
+import {
+ ChatTransport,
+ LanguageModel,
+ ToolSet,
+ UIMessage,
+ UIMessageChunk,
+ convertToModelMessages,
+ generateObject,
+ generateText,
+ streamObject,
+ streamText,
+} from "ai";
+import { toolDefinitionsToToolSet } from "../../../streamTool/toolDefinitionsToToolSet.js";
+import {
+ objectAsToolCallInUIMessageStream,
+ partialObjectStreamAsToolCallInUIMessageStream,
+} from "../util/partialObjectStreamUtil.js";
+
+export const PROVIDER_OVERRIDES = {
+ "mistral.chat": {
+ mode: "auto" as const,
+ },
+ "google.generative-ai": {
+ mode: "auto" as const,
+ },
+ "groq.chat": {
+ providerOptions: {
+ groq: {
+ structuredOutputs: false,
+ },
+ },
+ },
+} as const;
+
+export function getProviderOverrides(model: Exclude) {
+ return (
+ PROVIDER_OVERRIDES[model.provider as keyof typeof PROVIDER_OVERRIDES] || {}
+ );
+}
+
+export class ClientSideTransport
+ implements ChatTransport
+{
+ constructor(
+ public readonly opts: {
+ /**
+ * The language model to use for the LLM call (AI SDK)
+ *
+ * (when invoking `callLLM` via the `AIExtension` this will default to the
+ * model set in the `AIExtension` options)
+ *
+ * Note: perhaps we want to remove this
+ */
+ model: LanguageModel;
+
+ /**
+ * Whether to stream the LLM response or not
+ *
+ * When streaming, we use the AI SDK stream functions `streamObject` / `streamText,
+ * otherwise, we use the AI SDK `generateObject` / `generateText` functions.
+ *
+ * @default true
+ */
+ stream?: boolean;
+
+ /**
+ * Use object generation instead of tool calling
+ *
+ * @default false
+ */
+ objectGeneration?: boolean;
+
+ /**
+ * Additional options to pass to the AI SDK `generateObject` / `streamObject` / `streamText` / `generateText` functions
+ */
+ _additionalOptions?:
+ | Partial[0]>
+ | Partial[0]>
+ | Partial[0]>
+ | Partial[0]>;
+ },
+ ) {}
+
+ /**
+ * Calls an LLM with StreamTools, using the `generateObject` of the AI SDK.
+ *
+ * This is the non-streaming version.
+ */
+ protected async generateObject(messages: UIMessage[], tools: ToolSet) {
+ const { model, _additionalOptions } = this.opts;
+
+ if (typeof model === "string") {
+ throw new Error("model must be a LanguageModelV2");
+ }
+
+ // (we assume there is only one tool definition passed and that should be used for object generation)
+ const toolName = Object.keys(tools)[0];
+ const schema = tools[toolName].inputSchema;
+
+ const ret = await generateObject({
+ output: "object" as const,
+ schema,
+ model,
+ mode: "tool",
+ messages: convertToModelMessages(messages),
+ ...getProviderOverrides(model),
+ ...((_additionalOptions ?? {}) as any),
+ });
+
+ return objectAsToolCallInUIMessageStream(ret.object, toolName);
+ }
+
+ /**
+ * Calls an LLM with StreamTools, using the `streamObject` of the AI SDK.
+ *
+ * This is the streaming version.
+ */
+ protected async streamObject(messages: UIMessage[], tools: ToolSet) {
+ const { model, _additionalOptions } = this.opts;
+
+ if (typeof model === "string") {
+ throw new Error("model must be a LanguageModelV2");
+ }
+
+ // (we assume there is only one tool definition passed and that should be used for object generation)
+ const toolName = Object.keys(tools)[0];
+ const schema = tools[toolName].inputSchema;
+
+ const ret = streamObject({
+ output: "object" as const,
+ schema,
+ model,
+ mode: "tool",
+ messages: convertToModelMessages(messages),
+ ...getProviderOverrides(model),
+ ...((_additionalOptions ?? {}) as any),
+ });
+
+ // Transform the partial object stream to a data stream format
+ return partialObjectStreamAsToolCallInUIMessageStream(
+ ret.fullStream,
+ toolName,
+ );
+ }
+
+ /**
+ * Calls an LLM with StreamTools, using the `streamText` of the AI SDK.
+ *
+ * This is the streaming version.
+ */
+ protected async streamText(messages: UIMessage[], tools: ToolSet) {
+ const { model, _additionalOptions } = this.opts;
+
+ const ret = streamText({
+ model,
+ messages: convertToModelMessages(messages),
+ tools,
+ toolChoice: "required",
+ // extra options for streamObject
+ ...((_additionalOptions ?? {}) as any),
+ // activeTools: ["applyDocumentOperations"],
+ });
+
+ return ret.toUIMessageStream();
+ }
+
+ async sendMessages({
+ messages,
+ body,
+ // metadata,
+ }: Parameters["sendMessages"]>[0]): Promise<
+ ReadableStream
+ > {
+ const stream = this.opts.stream ?? true;
+ const toolDefinitions = (body as any).toolDefinitions;
+ const tools = toolDefinitionsToToolSet(toolDefinitions);
+
+ if (this.opts.objectGeneration) {
+ if (stream) {
+ return this.streamObject(messages, tools);
+ } else {
+ return this.generateObject(messages, tools);
+ }
+ }
+
+ if (stream) {
+ // this can be used to simulate initial network errors
+ // if (Math.random() < 0.5) {
+ // throw new Error("fake network error");
+ // }
+
+ const ret = await this.streamText(messages, tools);
+
+ // this can be used to simulate network errors while streaming
+ // let i = 0;
+ // return ret.pipeThrough(
+ // new TransformStream({
+ // transform(chunk, controller) {
+ // controller.enqueue(chunk);
+
+ // if (++i === 200) {
+ // console.log("cancel stream");
+ // controller.error(new Error("fake network error"));
+ // }
+ // },
+ // }),
+ // );
+
+ return ret;
+ } else {
+ // https://github.com/vercel/ai/issues/8380
+ throw new Error("Not implemented (generateText)");
+ }
+ }
+
+ reconnectToStream(): Promise | null> {
+ throw new Error("Not implemented");
+ }
+}
diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts
new file mode 100644
index 0000000000..5995265190
--- /dev/null
+++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts
@@ -0,0 +1,51 @@
+import { DeepPartial } from "ai";
+import {
+ createAsyncIterableStream,
+ createAsyncIterableStreamFromAsyncIterable,
+} from "../../../util/stream.js";
+import { filterNewOrUpdatedOperations } from "../../filterNewOrUpdatedOperations.js";
+import { preprocessOperationsStreaming } from "../../preprocess.js";
+import { StreamTool, StreamToolCall } from "../../streamTool.js";
+
+import { AsyncIterableStream } from "../../../util/stream.js";
+
+/**
+ * Result of an LLM call with stream tools
+ */
+type OperationsResult[]> = AsyncIterableStream<{
+ /**
+ * The operation the LLM wants to execute
+ */
+ operation: StreamToolCall;
+ /**
+ * Whether {@link operation} is an update to the previous operation in the stream.
+ *
+ * For non-streaming mode, this will always be `false`
+ */
+ isUpdateToPreviousOperation: boolean;
+ /**
+ * Whether the {@link operation} is possibly partial (i.e. the LLM is still streaming data about this operation)
+ *
+ * For non-streaming mode, this will always be `false`
+ */
+ isPossiblyPartial: boolean;
+
+ metadata: any;
+}>;
+
+export function objectStreamToOperationsResult[]>(
+ stream: ReadableStream[] }>>,
+ streamTools: T,
+ chunkMetadata: any,
+): OperationsResult {
+ // Note: we can probably clean this up by switching to streams instead of async iterables
+ return createAsyncIterableStreamFromAsyncIterable(
+ preprocessOperationsStreaming(
+ filterNewOrUpdatedOperations(
+ createAsyncIterableStream(stream),
+ chunkMetadata,
+ ),
+ streamTools,
+ ),
+ );
+}
diff --git a/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts
new file mode 100644
index 0000000000..e39530d8d9
--- /dev/null
+++ b/packages/xl-ai/src/streamTool/vercelAiSdk/util/chatHandlers.ts
@@ -0,0 +1,314 @@
+import { getErrorMessage } from "@ai-sdk/provider-utils";
+import { Chat } from "@ai-sdk/react";
+import { DeepPartial, isToolUIPart, UIMessage } from "ai";
+import { StreamTool, StreamToolCall } from "../../streamTool.js";
+import {
+ ChunkExecutionError,
+ StreamToolExecutor,
+} from "../../StreamToolExecutor.js";
+import { objectStreamToOperationsResult } from "./UIMessageStreamToOperationsResult.js";
+
+/**
+ * Listens to messages received in the `chat` object and processes tool calls
+ * by streaming them to an executor
+ *
+ * It also listens to the status and error events of the chat object and handles them
+ * appropriately.
+ *
+ * It also waits for all tool calls to be completed and then adds the results to the chat object.
+ *
+ * NOTE: listening to the `chat` object + error handling is a bit cumbersome. It might have been
+ * cleaner to directly listen to the UIMessageStream. However, for that we'd probably
+ * need to wrap the transport or chat object in AIExtension
+ *
+ * The error handling is currently quite convoluted. To properly test this,
+ * you can:
+ * a) make sure a tool call fails
+ * b) make sure the entire request fails (network error)
+ *
+ */
+export async function setupToolCallStreaming(
+ streamTools: StreamTool[],
+ chat: Chat,
+ onStart?: () => void,
+) {
+ /*
+ We use a single executor even for multiple tool calls.
+ This is because a tool call operation (like Add), might behave differently
+ if a block has been added earlier (i.e.: executing tools can keep state,
+ and this state is shared across parallel tool calls).
+ */
+ const executor = new StreamToolExecutor(streamTools);
+
+ const appendableStream = createAppendableStream();
+
+ appendableStream.output.pipeTo(executor.writable);
+
+ const toolCallStreams = new Map();
+
+ let first = true;
+
+ // Possible improvement: instead of pushing tool call updates directly,
+ // we could make this a readablestream where we return the latest state
+ // of the tool call input. This way we don't process all intermediate
+ // streaming steps in case downstream consumer (like the StreamToolExecutor)
+ // are slower than the producer
+ const unsub = chat["~registerMessagesCallback"](() => {
+ processToolCallParts(chat, (data) => {
+ if (!toolCallStreams.has(data.toolCallId)) {
+ const toolCallStreamData = createToolCallStream(
+ streamTools,
+ data.toolName,
+ data.toolCallId,
+ );
+ appendableStream.append(toolCallStreamData.operationsStream);
+ toolCallStreams.set(data.toolCallId, toolCallStreamData);
+ if (first) {
+ first = false;
+ onStart?.();
+ }
+ }
+ return toolCallStreams.get(data.toolCallId)!;
+ });
+ });
+
+ const statusHandler = new Promise((resolve) => {
+ const unsub2 = chat["~registerStatusCallback"](() => {
+ if (chat.status === "ready" || chat.status === "error") {
+ unsub();
+ unsub2();
+ if (chat.status !== "error") {
+ // don't unsubscribe the error listener if chat.status === "error"
+ // we need to wait for the error event, because only in the error event we can read chat.error
+ // (in this status listener, it's still undefined)
+ unsub3();
+ }
+ resolve();
+ }
+ });
+
+ const unsub3 = chat["~registerErrorCallback"](() => {
+ if (chat.error) {
+ unsub3();
+ for (const data of toolCallStreams.values()) {
+ if (!data.complete) {
+ // this can happen in case of a network error for example
+ data.writer.abort(chat.error);
+ }
+ }
+ // reject(chat.error);
+ // we intentionally commented out the above line to not reject here
+ // instead, we abort (raise an error) in the unfinished tool calls
+ }
+ });
+ });
+
+ // wait until all messages have been received
+ // (possible improvement(?): we can abort the request if any of the tool calls fail
+ // instead of waiting for the entire llm response)
+ await statusHandler;
+
+ // we're not going to append any more streams from tool calls, because we've seen all tool calls
+ await appendableStream.finalize();
+ // let all stream executors finish, this can take longer due to artificial delays
+ // (e.g. to simulate human typing behaviour)
+ const result = (await Promise.allSettled([executor.finish()]))[0];
+
+ let error: ChunkExecutionError | undefined;
+ if (result.status === "rejected") {
+ if (result.reason instanceof ChunkExecutionError) {
+ error = result.reason;
+ } else {
+ if (!chat.error) {
+ throw new Error(
+ "Unexpected: no ChunkExecutionError but also no chat.error (network error?)",
+ );
+ }
+ }
+ }
+
+ let errorSeen = false;
+ // process results
+ const toolCalls = Array.from(
+ toolCallStreams.values().filter((data) => data.complete),
+ );
+ toolCalls.forEach((toolCall, index) => {
+ const isErrorTool =
+ toolCall.toolCallId === error?.chunk.metadata.toolCallId;
+
+ if (isErrorTool) {
+ errorSeen = true;
+ }
+
+ chat.addToolResult({
+ tool: toolCalls[index].toolName,
+ toolCallId: toolCalls[index].toolCallId,
+ output:
+ errorSeen === false
+ ? { status: "ok" }
+ : isErrorTool
+ ? { status: "error", error: getErrorMessage(error) }
+ : { status: "not-executed-previous-tool-errored" },
+ });
+ });
+
+ if (error) {
+ throw error;
+ }
+
+ if (chat.error) {
+ // response failed
+ throw chat.error;
+ }
+}
+
+function createAppendableStream() {
+ let controller: ReadableStreamDefaultController;
+ let ready = Promise.resolve();
+ let canceled = false;
+ const output = new ReadableStream({
+ start(c) {
+ controller = c;
+ },
+ cancel(reason) {
+ canceled = true;
+ controller.error(reason);
+ },
+ });
+
+ async function append(readable: ReadableStream) {
+ if (canceled) {
+ throw new Error("Appendable stream canceled, can't append");
+ }
+ const reader = readable.getReader();
+
+ // Chain appends in sequence
+ ready = ready.then(async () => {
+ // eslint-disable-next-line no-constant-condition
+ while (true) {
+ try {
+ const { done, value } = await reader.read();
+ if (done || canceled) {
+ break;
+ }
+ controller.enqueue(value);
+ } catch (e) {
+ canceled = true;
+ controller.error(e);
+ break;
+ }
+ }
+ });
+
+ return ready;
+ }
+
+ async function finalize() {
+ await ready; // wait for last appended stream to finish
+
+ if (!canceled) {
+ controller.close(); // only close once no more streams will come
+ }
+ }
+
+ return { output, append, finalize };
+}
+
+// Types for tool call streaming
+type ToolCallStreamData = {
+ // stream: TransformStream[] }>>;
+ writer: WritableStreamDefaultWriter<
+ DeepPartial<{ operations: StreamToolCall[] }>
+ >;
+ complete: boolean;
+ toolName: string;
+ toolCallId: string;
+ operationsStream: ReadableStream